Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/377.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java GWT:将点击处理程序添加到信息窗口-使用谷歌地图V1_Java_Google Maps_Gwt_Infowindow - Fatal编程技术网

Java GWT:将点击处理程序添加到信息窗口-使用谷歌地图V1

Java GWT:将点击处理程序添加到信息窗口-使用谷歌地图V1,java,google-maps,gwt,infowindow,Java,Google Maps,Gwt,Infowindow,在我的GWT项目中,我有一个地图,当用户单击我在地图上绘制的各种标记之一时,它会显示一个信息窗口。一旦我有了坐标,mark_coords,我就是这样添加信息窗口的: map.getInfoWindow().open(mark_coords, new InfoWindowContent(name + "<br />" + description)); map.getInf

在我的GWT项目中,我有一个地图,当用户单击我在地图上绘制的各种标记之一时,它会显示一个信息窗口。一旦我有了坐标,mark_coords,我就是这样添加信息窗口的:

                        map.getInfoWindow().open(mark_coords,
                                new InfoWindowContent(name +  "<br />" + description));
map.getInfoWindow().open(标记),
新的InfoWindowContent(名称+“
”+说明));
我想在信息窗口中添加一个可单击的图标。然而,在没有各种库的情况下,我似乎找不到任何关于如何使用GoogleMapsV1实现这一点的文档


如果有人有任何建议,我们将不胜感激

您可以添加带有ImageView的XML文件,以及ImageView的XML文件

最后,您可以执行
map.setInfoWindowAdapter(新的MyInfoWindowAdapter())
调用自定义信息窗口


您可以访问以了解更多详细信息。

好的,谢谢您的帮助。但这是一个GWT项目,不幸的是,不是android。您可能需要签出GWT。
<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    <ImageView
        android:id="+@id/imageView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginRight="5dp"
        android:adjustViewBounds="true"
        android:src="@drawable/ic_launcher"/>
</LinearLayout>
  class MyInfoWindowAdapter implements InfoWindowAdapter {

      private final View myContentsView;

      MyInfoWindowAdapter() {
          myContentsView = getLayoutInflater().inflate(R.layout.custom_info_contents, null);
      }

      @Override
      public View getInfoContents(Marker marker) {
         ImageView imageView = ((ImageView)myContentsView.findViewById(R.id.imageView))
         imageView.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View arg0) {

             }
          });

         return myContentsView;
      }

      @Override
      public View getInfoWindow(Marker marker) {
       // TODO Auto-generated method stub
       return null;
      }

 }