我使用带有自定义信息窗口的谷歌地图
http://jsfiddle.net/hashie5/KYtnb/
当你点击标记时它会弹出
我如何使用标准信息窗口,如谷歌地图本身的
例子:http://maps。 google.be/maps?q=Jaarbeurslaan,+Genk&hl=nl&ll=50.965036,5.485032&spn=0.01046,0.033023&sll=51.09623,4.227975&sspn=1.335072,4.22699&oq=jaar&hnear0+6,+Limburg,+3格韦斯特&t=m&z=16&iwloc=A
所以我可以使用“Routebeschrijving”(路线)链接等。
function initialize() {
var myLatlng = new google.maps.LatLng(50.965049,5.484231);
var myOptions = {
zoom: 14,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var contentString =
'<div id="infowindow">' +
'Galaconcert<br />' +
'Jaarbeurslaan 2-6<br />' +
'3690 Genk' +
'</div>'
;
var infowindow = new google.maps.InfoWindow();
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Galaconcert'
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(contentString);
infowindow.open(map, marker);
});
}
$(function(){
initialize();
});