How to get GPS coordinates from Google Maps
- July 29th, 2010
- Posted in Tutorials
- Write comment
In previous tutorial we made a simple google map in Flash. But how do we get desired coordinates of our location? You probably would like to show location of your company and set it as default map location. Getting coordinates is actually pretty simple.
Go to Google Maps and find the desired location. Now use right click and then select “center map here”. Now paste following code into browser URL:
javascript:void(prompt('',gApplication.getMap().getCenter()));
A pop up window with coordinates will appear. Just copy this coordinates and paste them to flash code:
map.setCenter(new LatLng(37.77114, -122.40159), 18, MapType.SATELLITE_MAP_TYPE);
var m:Marker = new Marker(new LatLng(37.77114, -122.40159),
coordinates for marker define exactly where marker of your location is placed.
And we’re done. Good luck using it in your projects.
A+ would read again