How would you fill in state markers in google maps, fetching latitude, longitude and title data from a database.
Today I already have this function working, but the state data is fixed in a javascript.
Below is the code I have today:
function init_map() {
var myOptions = {
zoom: 4,
center: new google.maps.LatLng(-14.2392976,-53.1805017),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
marker = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(-27.276409, -48.844043),
icon: "img/1444113052_map-marker.png",
title: "Santa Catarina"
});
marker = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(-18.5779703,-45.4514505),
icon: "img/1444113052_map-marker.png",
title: "Minas Gerais"
});
}
google.maps.event.addDomListener(window, "load", init_map);