0
我有以下代码,我想将外部链接添加到标记中,以便单击链接的标记应在新窗口中打开。请帮助,以便我可以将站点链接到URL以在新窗口中打开。在地图上的标记上设置外部链接
<html>
<body>
<p>Chirag</p>
<div id="map_canvas" style="width:1000px; height:650px"></div>
<p>Blah</p>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var map;
var markers = [];
initialize();
function initialize() {
var myOptions = {
zoom: 14,
center: new google.maps.LatLng(23.2101344,72.6532201),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
addMarker(new google.maps.LatLng(23.2101344,72.6532201), "Station1");
addMarker(new google.maps.LatLng(23.230682, 72.635013), "Station2");
addMarker(new google.maps.LatLng(23.217885, 72.642481), "Station3");
}
function addMarker(latlng, myTitle) {
markers.push(new google.maps.Marker({
position: latlng,
map: map,
title: myTitle,
icon: "http://maps.google.com/mapfiles/marker" + String.fromCharCode(markers.length + 65) + ".png"
}));
}
</script>
</body>