【发布时间】:2014-02-22 19:12:32
【问题描述】:
简单的问题:
我正在尝试将我的标记链接到 Google 地图 (API v3) 上的外部网址。 现在可以使用http://www.google.com作为链接。
Javascript:
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(-30.021664, 30.901578);
var mapOptions = {
zoom: 15,
center: myLatlng,
scrollwheel: false,
disableDefaultUI: true
}
var map = new google.maps.Map(document.getElementById('ContactMap'), mapOptions);
var image = '/Assets/Images/Icons/MapMarker.png';
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
animation: google.maps.Animation.DROP,
icon: image,
title: 'Perspex'
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
【问题讨论】:
-
link my marker to an external url是什么意思? -
你的意思是链接?在单击标记时打开另一个链接?
标签: javascript api google-maps google-maps-api-3