Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

Thanks

share|improve this question

You 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>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.