0
How to fill state markers in google maps, searching the latitude, longitude and title data of a database.
Today I already have this function working, but the state data are 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);
Do you already have a database with this information? In what format?
– Ricardo Moraleida
Actually I don’t have the table yet. It will be a very simple thing, with latitude, longitude and title. The format was thinking of json or xml.
– Ariel Inacio Correa