I have this code for my gmap3 and I would like to:
- Replace my address with GPS coordinates
- Put my marker at the center when I resize my page.
$(function(){
$('#adresse').gmap3({
marker: {
address: " Apple CAP 3000 Avenue Eugène Donadeï, 06700 Saint-Laurent Du Var, France"
},
map: {
options: {
zoom: 17
}
}
});
});
UPDATES
at this time I work on your first point, I replaced the marker line to have lat & long instead of adress but it doesn't work. I did something wrong ?
{marker: { address: " Apple CAP 3000 Avenue Eugène Donadeï, 06700 Saint-Laurent Du Var, France" },
by
{marker: { geometry: "lat: 37.4220323, lng: -122.0845109"},
1. Replace my address with GPS coordinates
You can use Geocoding process to convert addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers on a map, or position the map. The Google Maps Geocoding API provides a direct way to access these services via an HTTP request. You can check here the example which uses the Geocoding service through the Google Maps JavaScript API to demonstrate the basic functionality.
2. Put my marker at the center when I resize my page.
You can check on these related SO posts:
Hope this helps! :)