I am trying to add multiple google markers on a map and I am not sure why this code does not work. I am using php and javascript. I checked to see if $DNB had elements and it did. I am not sure what I am doing wrong.
while($DNB -> fetch())
{
?>
var point = new google.maps.LatLng(<?php echo initval( $lat)?>, <?php echo initval($lon)?>);
var marker = new google.maps.Marker({position: point, map:map});
<?php }
This code:
is Google Maps API V2. This code:
Is Google Maps API V3. Pick one, and I strongly suggest V3. Check out the documentation at https://developers.google.com/maps/documentation/