Professional Documents
Culture Documents
Abrindo Navegador Com Mapa e Localização
Abrindo Navegador Com Mapa e Localização
- Stack Overflow
I have a small application that gives the current location: longitude and latitude. Now I have to browse to google maps with the longitude and
latitude. Please suggest how I can do this.
html google-maps
11 Answers
https://www.google.com/maps/?q=-15.623037,18.388672
https://www.google.com/maps/preview/@-15.623037,18.388672,8z
http://maps.google.com/maps?ll=-15.623037,18.388672&spn=65.61535,79.013672
1 i could not get the map of particular place on map. – Hiren Patel Feb 5 '13 at 10:10
1 Is there somewhere information about the new format? Particularly, Internet is full of examples of old
format and it is hard to Google (sic) the new format from all the noise. – Mikko Ohtamaa Mar 4 '14 at
13:29
32 The "new" format above does not include a marker, if you use this format it works - google.com/maps/?
q=<lat>,<long>; eg: google.com/maps/?q=-15.623037,18.388672 – AaronM Oct 15 '14 at 1:54
1 Is there a way to specify the map type (hybrid, road, etc)? – Redtopia Nov 30 '14 at 6:27
1 it does not work now as of 20 Nov 2016 – maq Nov 20 '16 at 15:54
as additional info;
the best way is to use q= parameter, so that it displays the map with the point marked.
example;
http://maps.google.com/?q=<lat>,<lng>
@WareNinja do you know how to combine directions from/to with this? – Sérgio S. Filho Feb 11 '16 at
0:16
5 How do you add the zoom parameter? – Razgriz Nov 15 '16 at 17:56
Thanks, this also makes Citymapper understand the link in case this link is inside an app – vaskort Apr 9
'17 at 17:15
https://stackoverflow.com/questions/1801732/how-do-i-link-to-google-maps-with-a-particular-longitude-and-latitude 1/4
03/02/2018 html - How do I link to Google Maps with a particular longitude and latitude? - Stack Overflow
As of today (2014/09/23), I've found that to get marker on exact place (not an approximation)
you can use:
http://www.google.com/maps/place/49.46800006494457,17.11514008755796
.com/maps/place/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z
e/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z/data=!3m1!1e3
And If you want terrain view of the map, then append /data=!3m1!4b1
e/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z/data=!3m1!4b1
Any idea how to add the map type (hybrid, etc)? – Redtopia Nov 30 '14 at 6:01
1 @Redtopia, see my updated answer for satellite map type. – Pogo19 Dec 1 '14 at 13:52
Thanks! Do you know what that data variable means or how to interpret it? Also, are there any docs that
you know about that describe this new linking scheme? – Redtopia Dec 2 '14 at 17:15
1 @Redtopia, it is just an experimental knowledge. Actually, I had to try several URL parameters to find an
answer for you. I haven't found no such documentation. Sorry! – Pogo19 Dec 3 '14 at 22:07
2 It's February 2016 and it appears that this method still works. Well done. – gmeben Feb 9 '16 at 22:23
http://maps.google.com/?q=<lat>,<lng>
To open the Google Maps app on an iOS mobile device, use the Google Maps URL
Scheme:
comgooglemaps://?q=<lat>,<lng>
To open the Google Maps app on Android, use the geo: intent:
geo:<lat>,<lng>?z=<zoom>
1 this is actually more useful as an answer – Jason Sebring Jul 31 '16 at 1:07
You can also use "google.navigation:q=latitude,longitude" to start immediately the navigation with google
maps app, but does not work with some gps apps. The more generic is "geo:<lat>,<lng>?q=<lat>,<lng>
(Label,Name)" as referred ojus kulkarni em previous comment (the parameters force to show the
marker, helping to navigate) – Manuel Romeiro Oct 25 '17 at 2:52
It´s out of the scope of the question, but I think it might be also interesting to know how to link
to a route. The query would look like this:
https://www.google.es/maps/dir/'52.51758801683297,13.397978515625027'/'52.49083837044266,13.
Using the query parameter won't work, Google will try to approximate the location.
https://stackoverflow.com/questions/1801732/how-do-i-link-to-google-maps-with-a-particular-longitude-and-latitude 2/4
03/02/2018 html - How do I link to Google Maps with a particular longitude and latitude? - Stack Overflow
geo:<lat>,<lng>?z=<zoom>
Join Stack Overflow to learn, share knowledge, and build your career. Email Sign Up OR SIGN IN WITH Google Facebook
open app with marker for give location:-
geo:<lat>,<lng>?q=<lat>,<lng>(Label,Name)
comgooglemaps://?q=<lat>,<lng>
http://maps.google.com/maps?z=12&t=m&q=<lat>,<lng>
sample url:
http://www.google.com/maps/place/30.364124,48.22
7034
http://maps.google.com/?q=<LAT>,<LNG>
https://maps.google.com/?q=<LAT>,<LNG>&ll=<LAT>,<LNG>&z=18
https://www.google.com/maps/@<LAT>,<LNG>,16z
https://maps.google.com/?q=<LAT>,<LNG>&z=16
Although (for avid readers) This is the latest from google (August 22 2017):
Maps URLs
Maps URLs with map display
Maps URLs with search action
From google
Search: When searching for a specific place, the resulting map puts a pin in the specified
location and displays available place details.
Important: The parameter api=1 identifies the version of Maps URLs this URL is intended
for. This parameter is required in every request. The only valid value is 1. If api=1 is NOT
present in the URL, all parameters are ignored and the default Google Maps app will
launch, either in a browser or the Google Maps mobile app, depending on the platform in
use (for example, https://www.google.com/maps).
https://www.google.pl/maps/@<lat>,<lon>,<zoom>z
Example: https://www.google.pl/maps/@51.5088233,-0.1296787,13z
With pointer:
https://www.google.com/maps/place/<lat>,<lon>/@<lat>,<lon>,<zoom>z
https://stackoverflow.com/questions/1801732/how-do-i-link-to-google-maps-with-a-particular-longitude-and-latitude 3/4
03/02/2018 html - How do I link to Google Maps with a particular longitude and latitude? - Stack Overflow
Example:
https://www.google.com/maps/search/51.5088233,-0.1296787/@51.5088233,-0.1296787,13
z
Find your location in the Google Earth program, and click the icon "View in Google Maps". The
URL bar in your browser will show the URL you need.
https://stackoverflow.com/questions/1801732/how-do-i-link-to-google-maps-with-a-particular-longitude-and-latitude 4/4