谷歌地图API标记标题

Google Maps API Marker Title

本文关键字:标题 API 谷歌地图      更新时间:2023-09-26

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

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

任何想法吗?

今天的Fusion Tables没有办法做到这一点。我建议在Google Maps API问题跟踪器上提交一个特性请求。

有一个标题可以使用但它就像任何一般html控件上的title属性一样检查一下:http://code.google.com/apis/maps/documentation/javascript/reference.html#MarkerOptions

guardian的处理方式可能是在标记上使用事件处理程序并使用像这样的通知窗口

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);
  });