Note that there are some explanatory texts on larger screens.

plurals
  1. POmultiple marker in google map
    primarykey
    data
    text
    <p>i have a problem with placing multiple marker in google map.here is my code.it display only one marker during page reloading and when page is complettly load then map is not display.<br> <code>javascript code</code>: </p> <pre><code>&lt;head&gt; &lt;script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&amp;sensor=false"&gt; &lt;/script&gt; &lt;script&gt; function initialize(lat,lon) { var myCenter=new google.maps.LatLng(lat,lon); var mapProp = { center:myCenter, zoom:9, mapTypeId:google.maps.MapTypeId.ROADMAP }; var map=new google.maps.Map(document.getElementById("googleMap"),mapProp); var marker=new google.maps.Marker({ position:myCenter, }); marker.setMap(map); } google.maps.event.addDomListener(window, 'load', initialize); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="googleMap" style="width:500px;height:380px;"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><code>php code</code>:</p> <pre><code>&lt;?php require_once 'geocode.php'; $addarray=array(0=&gt;'a, ahmedabad,india',1=&gt;'b,ahmedabad,india'); foreach($addarray as $add) { // define the address and set sensor to false $opt = array ( 'address' =&gt; urlencode($add), 'sensor' =&gt; 'false' ); // now simply call the function $result = getLatLng($opt); // if status was successful, then print the lat/lon ? if ($result['status']) { echo '&lt;pre&gt;'; ?&gt; &lt;script&gt; initialize(&lt;?php echo $result['lat'];?&gt;,&lt;?php echo $result['lon'];?&gt;); &lt;/script&gt; &lt;?php echo '&lt;/pre&gt;'; } } ?&gt; </code></pre> <p>here first i got lat and lon according to address then i called javascript function to place marker.but something is missing or create a problem.<br> thanks in advance.</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.
 

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