Google map api v3 issue

vqdhgyd

New Member
I'm using google map API v3, and i have an issue.I need to display them with more than one map, and i don't know the number of maps.Here the code php code:\[code\]<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyA5DRxSgUpWIfkLYULGijHXFQdogRElRIg&sensor=false"></script><?phpfor ($i = 1; $i <= 4; $i++) { echo "map n:" . $i . "<br/>"; ?><script> function initialize(ltd,lgd) { var myOptions = { center: new google.maps.LatLng(ltd, lgd ), zoom: 15, panControl: false, zoomControl: false, mapTypeControl: false, scaleControl: false, streetViewControl: false, overviewMapControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas<?php echo $i ?>"), myOptions); google.maps.event.addListener(map, 'click', function(event) { placeMarker(event.latLng); }); var marker; marker = new google.maps.Marker({ position: new google.maps.LatLng(ltd, lgd), map: map }); } </script> <?php echo "<body onload='initialize(36.835769,10.247693)'>"; ?> <div id="map_canvas<?php echo $i ?>" style="margin-top:18px; width: 136px; height: 136px;"></div> <?php}?>\[/code\]Thanks for any help :)
 
Back
Top