Google Map - Need to Add Multiple location

Permalink
I want to add multiple location in the google map, how can I do that. Can you please help me with that. Your immediate reply is appreciated.

View Replies:
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Here is a script that I've written in one of my clients site previously which creates markers on the map based on an array of addresses.

$(document).ready(function () {
    var map;
    var elevator;
    var myOptions = {
        zoom: 8,
        center: new google.maps.LatLng(0, 0),
        mapTypeId: 'terrain'
    };
    map = new google.maps.Map($('#map_canvas')[0], myOptions);
    var addresses = ['India', 'Russia', 'North Korea','China','Brazil'];
    for (var x = 0; x < addresses.length; x++) {
        $.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address='+addresses[x]+'&sensor=false', null, function (data) {
            var p = data.results[0].geometry.location
            var latlng = new google.maps.LatLng(p.lat, p.lng);
            new google.maps.Marker({
muralik replied on at Permalink Reply
Thanks for your quick reply.. I have used Google Map block. Where should I use this code. Can you please guide me. Your help is appreciated. How do I supply the multiple values to it.
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Its not google map block code. Its just a script that you need to add into your page where you want it to be displayed. Otherwise you need to customize the google map block.

Rony
muralik replied on at Permalink Reply
Rony, Where should I add this code. You can checkhttp://itssrc.com/index.php/contact-us/.... In this page below I have google map which just shows one address. I need to have it show all the 4 address on that page.

BTW, I still don't know where to place this code on this page. Appreciate your assistance.

Cheers
-Murali
ronyDdeveloper replied on at Permalink Reply 1 Attachment
ronyDdeveloper
I'm attaching a html file. Create a new page type for your contact us page and put the script and other code there. Note: Don't include jquery library.

If this is something that you are not familiar with, ask professional help

Rony
JohntheFish replied on at Permalink Reply
JohntheFish
If you are unable to implement @rony's solution, there are several multiple location map blocks in the marketplace.
muralik replied on at Permalink Reply
Multiple location map blocks is this free blocks. Can you please confirm. I was searching for them.
JohntheFish replied on at Permalink Reply
JohntheFish
I don't know if any such are free. For marketplace blocks you have to weigh up how much your time is worth.

Personally, I find pretty much anything in the marketplace is cheaper than a couple of hours of my time, just as long as it solves my problem.