I've got a mysql-table with user data inside. Among them there are latitude/longitude position values. (as two separate values) To create a marker out of them this should work:
function initialize() {
var myLatlng = new google.maps.LatLng(**LATITUDE HERE**,**LONGITUDE HERE**);
var mapOptions = {
zoom: 4,
center: somewhere,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
});
}
google.maps.event.addDomListener(window, 'load', initialize);
I'd now like to place a single marker for every user on a map. How can I get the lat/lng values from the table for all users and finally place all those markers? So basically, how does this loop work?
Thanks a lot!