我的代码是:
var ctaLayer = new google.maps.KmlLayer(
'http://.../per1.kml',
{suppressInfoWindows: true});
ctaLayer.setMap(map);
var info_percurso = new google.maps.InfoWindow({
content: 'hi'
});
google.maps.event.addListener(ctaLayer, 'click', function() {
info_percurso.open(map,ctaLayer);
alert("dd");
});
这有可能吗?
这段代码不起作用......但操作是否可行?
我需要为数据库查询创建自己的infoWindow
答案 0 :(得分:4)
确保正在提供kml。您可能需要将kml MIME类型添加到服务器。
application/vnd.google-earth.kml+xml