0

How can I show the information of a particular makers? Such as the name of the locality, address, phone, etc. I use eclipse with libraries phonegap, and in my project I use code html and jquery. The script of multiple makers is this:

var ltlng = [];

        ltlng.push(new google.maps.LatLng(44.342377, 9.229788));
        ltlng.push(new google.maps.LatLng(13.5, 79.2));
        ltlng.push(new google.maps.LatLng(15.24, 77.16));

        map.setCenter(ltlng[0]);
        for (var i = 0; i <= ltlng.length; i++) {
            marker = new google.maps.Marker({
                map: map,
                position: ltlng[i]
            });

            (function (i, marker) {



                google.maps.event.addListener(marker, 'click', function () {

                    if (!infowindow) {
                        infowindow = new google.maps.InfoWindow({ content: 'Location info:<br/>Country Name:<br/>LatLng:');
                    };

                    infowindow.setContent("Message" + i);

                    infowindow.open(map, marker);

                });

})(i, marker);
};
Overnet
  • 965
  • 3
  • 12
  • 20

1 Answers1

0

If you referring to having information icons when a user clicks a map marker the following solves your problem:

Adding multiple markers with infowindows (Google Maps API)

Community
  • 1
  • 1
Menelaos
  • 23,508
  • 18
  • 90
  • 155
  • I tried to add the code as in the link you sent me but does not work. Could you kindly tell me which part of the code and replace in that exact spot? Thanks – Overnet Apr 26 '13 at 14:11