I'd like to set up a Google Map or any other map with pins in certain locations and have those pins link to other websites.
Anyone know how I can do that?
Web Applications Stack Exchange is a question and answer site for power users of web applications. It only takes a minute to sign up.
Sign up to join this communityYou can use the following code:
<script type="text/javascript">
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 5,
center: new google.maps.LatLng(0,0),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var MyPlace = new google.maps.LatLng(18, 78);
var marker = new google.maps.Marker({
position: MyPlace,
url: 'http://www.wikipedia.org/',
title: 'This link opens Wikipedia home page',
map: map
});
google.maps.event.addListener(marker, 'click', function() {
window.location.href = marker.url;
});
</script>