我已经在下面的代码上工作了一段时间,当鼠标悬停在标记上时,无法让 MapTips 为标记工作。
<html>
<head>
<style>
#map_canvas { width: 500px; height: 400px; }
</style>
<link href="../stylesheet.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://gmaps-utility-gis.googlecode.com/svn/trunk/fusiontips/src/fusiontips_compiled.js"></script>
<script type="text/javascript">
var map;
var layer;
var tableid = 5463275;
var layer2;
var tableid2 = 5492676;
function initialize() {
map = new google.maps.Map(document.getElementById('map_canvas'), {
center: new google.maps.LatLng(51.500000, -0.090000),
zoom: 9,
mapTypeControl: false,
mapTypeId: google.maps.MapTypeId.TERRAIN
});
layer = new google.maps.FusionTablesLayer(tableid, {
suppressInfoWindows: true
});
layer.setQuery("SELECT 'geometry' FROM " + tableid);
layer.setMap(map);
layer2 = new google.maps.FusionTablesLayer(tableid2);
layer2.setQuery("SELECT 'Full Address' FROM " + tableid2);
layer2.setMap(map);
layer2.enableMapTips({
select: "'Site Name'",
from: tableid,
geometryColumn: 'Full Address',
suppressMapTips: false,
delay: 100,
tolerance: 6 });
var legendDiv = document.createElement('DIV');
var legend = new Legend(legendDiv, map);
legendDiv.index = 1;
map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(legendDiv);
}
</script>
</head>
<body onLoad="initialize();">
<div id="map_canvas"></div>
</body>
</html>
该地图由两个融合表图层组成 - 我已链接到包含以下标记数据的表:
任何帮助将不胜感激!