我正在尝试在 jsFiddle 中实现谷歌地图来问另一个问题,但我看不到地图:http: //jsfiddle.net/hashie5/aknYP/
我在资源中添加了 gmap 脚本
如何在 jsFiddle 中显示地图?
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);
});
}