Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle-maps:Displaying address in infowindow
    primarykey
    data
    text
    <p>iam trying to implement infowindows with address displaying in it .. below is my code </p> <pre><code> $('#citiesdata').empty(); var listFavourite = []; $(responce).find("favorite").each(function() { var name = $(this).find("name").text(); var address = $(this).find("address").text(); var phoneNo = $(this).find("phoneNo").text(); var lattitude = $(this).find("lattitude").text(); var longitude = $(this).find("longitude").text(); var favouriteObject = new Object(); favouriteObject.name = name; favouriteObject.address = address; favouriteObject.lattitude = lattitude; favouriteObject.longitude = longitude; listFavourite.push(favouriteObject); $('#citiesdata').append('&lt;tr&gt;&lt;td&gt;&lt;b&gt;'+name+'&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;'); $('#citiesdata').append('&lt;tr&gt;&lt;td&gt;'+address+'&lt;/td&gt;&lt;/tr&gt;'); $('#citiesdata').append('&lt;tr&gt;&lt;td&gt;'+phoneNo+'&lt;/td&gt;&lt;/tr&gt;'); }); //call map service to load map with marker //method name(listFavourite); var content = "&lt;div id='tabs'&gt;"+ "&lt;form id='button'&gt;"+ "&lt;div&gt;"+ "&lt;input type='button' value='click me' onclick='alert(\"infoWindow\")'&gt;"+ "&lt;/div&gt;"+ "&lt;/form&gt;"+ "&lt;/div&gt;"; var map = new google.maps.Map(document.getElementById("map_canvas"), { mapTypeId: google.maps.MapTypeId.ROADMAP, streetViewControl: false }); var infowindow = new google.maps.InfoWindow({ //content: content }); for (var n = 0 ; n &lt;listFavourite.length ; n++) addMarker(listFavourite[n]); } function addMarker(data) { var marker = new google.maps.Marker({ position: new google.maps.LatLng(data.lattitude, data.longitude), map: map, title: data.address }); google.maps.event.addListener(marker, "click", function() { infowindow.setContent(data.address); infowindow.open(map, marker); }); }; </code></pre> <p>here i am getting the data(addresses) from a arraylist..and i want to display that address in the infowindows..thankyou</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload