我的google标记链接拒绝运行。我点击它不会打开链接。
// Let's also add a marker while we're at it
var image = 'images/icons/mapicon.png';
var beachMarker = new google.maps.Marker({
position: new google.maps.LatLng(39.419659, -77.4126419),
map: map,
icon: image,
url: 'https://www.google.com'
});
google.maps.event.addListener(marker, 'click', function() {
window.open(marker.url);
});
答案 0 :(得分:1)
您的addListener指向标记变量,但您的标记定义为 beachMarker 。