在 google 地图上隐藏附加信息 window

Hide additional info window on google map

我使用融合 table 查询突出显示了国家/地区印度和墨西哥,并且当我点击标记时它为国家/地区印度添加了一些标记,它的超链接正确弹出。

我的问题是,当我点击地图时,我的自定义标记除外,它会弹出一个信息 window 如下所示 snap.It 包含一些关于该地点的信息。

演示:-Click Here

这里我想隐藏附加信息 window 除了标记信息 window,当你点击标记时它会打开。

示例代码:-

$(document).ready(function(){   

    var layer; // Fusion Tables layer

var tableid = 420419;


var image = new google.maps.MarkerImage(
                        '/static/img/icon-pin.png',
                        new google.maps.Size(68, 80),
                        new google.maps.Point(0,0),
                        new google.maps.Point(19, 49));

        var mapOptions = {
          center: new google.maps.LatLng(20.91129,-10.14098),
          zoom:3,
           el: '#map',
          disableDefaultUI: false,
          draggable: true, 
          zoomControl: true, 
          scrollwheel: true,
          icon: image,


        };

          var geocoder = new google.maps.Geocoder();
        var map = new google.maps.Map(document.getElementById("map-canvas"),
            mapOptions);



        new_boundary = new google.maps.LatLngBounds();



        var marker = new google.maps.Marker({
            map: map,
            position: new google.maps.LatLng(-25.2743980, 133.7751360),
            icon:new google.maps.MarkerImage(
            "/profiles/image/9",
            new google.maps.Size(68, 49),
            new google.maps.Point(0,0),
            new google.maps.Point(19, 49)),
            flat: true,
            anchor: 8,

          });

            new_boundary.extend(new google.maps.LatLng(-25.2743980, 133.7751360));



        var marker = new google.maps.Marker({
            map: map,
            position: new google.maps.LatLng(-40.9005570, 174.8859710),
            icon:new google.maps.MarkerImage(
            "/profiles/image/2",
            new google.maps.Size(68, 49),
            new google.maps.Point(0,0),
            new google.maps.Point(19, 49)),
            flat: true,
            anchor: 8,

          });
new_boundary.extend(new google.maps.LatLng(-40.9005570, 174.8859710));



            //map.fitBounds(new_boundary);


layer = new google.maps.FusionTablesLayer({
  query: {select: "kml_4326", 
          from: tableid,
         // where: "name_0 = 'India'"},
           where: "name_0 IN ('Mexico','India')"},

  styles: [{
  polygonOptions: {
    strokeWeight: "0",
    //strokeColor: "#FF0000",
    //strokeOpacity: "0.4",
    fillOpacity: "0.1",
    fillColor: "#FF0000"

  }
}]}); 
layer.setMap(map);
}); 

抑制 FusionTablesLayer 上的信息窗口(将 suppressInfoWindows option 设置为 true):

layer = new google.maps.FusionTablesLayer({
  suppressInfoWindows: true,  // ** set suppressInfowindows: true
  query: {select: "kml_4326", 
          from: tableid,
           where: "name_0 IN ('Mexico','India')"},
  styles: [{
  polygonOptions: {
    strokeWeight: "0",
    fillOpacity: "0.1",
    fillColor: "#FF0000"

  }
}]}); 
layer.setMap(map);