【问题标题】:Google Maps API Marker TitleGoogle Maps API 标记标题
【发布时间】:2011-10-30 19:23:16
【问题描述】:

我正在使用 Fusion Table 图层来显示标记数据。使用 FT 处理标记,我看不到在标记上定义标题属性的方法。

想在鼠标悬停时做这样的事情: http://www.guardian.co.uk/travel/series/berlin-city-guide?intcmp=122

有什么想法吗?

【问题讨论】:

    标签: javascript google-maps google-maps-api-3


    【解决方案1】:

    有一个可以使用的标题,但它就像任何通用 html 控件上的标题属性,请在此处查看:http://code.google.com/apis/maps/documentation/javascript/reference.html#MarkerOptions

    监护人的做法可能是在标记上使用事件处理程序并使用类似这样的信息窗口

    var marker = new google.maps.Marker({
          position: myLatlng, 
          map: map,
          title:"Hello World!"  // see how title is used
      });
      google.maps.event.addListener(marker, 'mouseover', function() {
         infowindow = new google.maps.InfoWindow();
         infowindow.setContent(contentString); // contentString can be html as far as i  know whose style you can override
         infowindow.setPosition(event.latLng);
    
         infowindow.open(map);
      });
    

    【讨论】:

      【解决方案2】:

      目前无法使用 Fusion Tables 做到这一点。我建议在 Google Maps API 问题跟踪器上提交功能请求。

      【讨论】:

        猜你喜欢
        • 2022-11-26
        • 1970-01-01
        • 1970-01-01
        • 2016-12-24
        • 2011-12-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多