Understanding google maps urls - google-maps

i'd like to extract latitude and longitude values from google map links.
let's say you have the following link (this is the link that you'd get on http://maps.google.com link menu)
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=tokyo&aq=&sll=35.675147,-95.712891&sspn=47.800848,92.724609&ie=UTF8&hq=&hnear=Tokyo,+Japan&t=h&z=9
there are a couple of lat/lon values here (sll, sspn) but none of them seems right.
In this case the first pair links to Mongolia the second goes to Oklahoma.
the correct lat/lon would be around 35.6894875, 139.6917064.
my question is that how you can get this values from a link?
I found this site http://mapki.com/wiki/Google_Map_Parameters
but i could not really figure out the solution.
thanks and best,
Viktor

The value of ll in your URL should be the latitude and longitude of the center of your map. Unfortunately, your URL does not have an ll parameter. When I go to Google Maps, map a location, and click the link button to get a URL to share, it invariably has the ll parameter. I'm not sure how you generated the above URL, but that might have a clue to the solution.

Related

Is it possible to build a Google maps url from a lat/lng position to a place id?

I can use this to get directions between 2 lat/lngs:
https://maps.google.com/maps?saddr=0,0&daddr=50,40
And I can use this to view a particular place by place id:
https://www.google.com/maps/place/?q=place_id:PLACE_ID_HERE
Is it possible to do somethig similar to this?
https://maps.google.com/maps?saddr=0,0&daddr=PLACE_ID_HERE
I want to get the directions from any lat/long position to a particular Google place
Thanks to the useful link posted my Mr Upsidedown (its the docs for Google Maps URLs specifically, rather than places/maps API), I found that this is possible by constructing the url like this
https://www.google.com/maps/dir/?api=1&origin=51.315903303198624,-0.5612461159895105&destination=51.5007293621435, -0.1246254894957886&destination_place_id=ChIJ2dGMjMMEdkgRqVqkuXQkj7c
So we need these params in order to achieve it:
origin (lat/lng)
destination (lat/lng)
destination_place_id (placeId)
Following the url above will show directions between the 2 co-ordinates, but will also indicate the actual place we are travelling to (Big Ben), where as excluding the destination_place_id will just try and show the area being travelled to (e.g. Westminster).

Create Google Maps links based on coordinates - bug pin position

i tried make link to Google maps and place pin in position based on coordinates.
Make this link is not problem. When I click on this link and check pin position, then I see not correct position.
I tried reached areal of "Brutal Assault festival" (for example - another places have same bug).
Link to this place on Google maps - https://www.google.cz/maps/place/Festival+Brutal+Assault/#50.3404166,15.9333541,17z/data=!3m1!4b1!4m5!3m4!1s0x470e7de678b98f57:0x775f2cf0460db4c2!8m2!3d50.3404166!4d15.9355428
1st try:
https://www.google.com/maps/place/50.3404166,15.9333541
this link Google transformed to:
https://www.google.com/maps/place/50%C2%B020'25.5%22N+15%C2%B056'00.1%22E/#50.3404166,15.9311654,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d50.3404166!4d15.9333541
Here is problem my coordinates are "50.3404166,15.9333541", but in final Google link I see "50.3404166,15.9311654". But I donĀ“t know why... 1st coordinate Google allowed, but 2nd changed... Why???
2nd try:
http://maps.google.com/maps?q=50.3404166,15.9333541
Same final link on Google, same result, same bad placed pin...
3nd try:
https://www.google.com/maps/search/?api=1&query=50.3404166,15.9333541
Same final link on Google, same result, same bad placed pin...
4th try:
I tried to round off coordinates, but nothing happend. When I rounded to only two decimal places then I get different place. But this is logical only "two decimal" is few.
The latitude and longitude after the # sign is the center of the map, not the location of the place you searched for.
The coordinates of that place are in the data portion of the URL:
data=!3m1!4b1!4m5!3m4!1s0x470e7de678b98f57:0x775f2cf0460db4c2!8m2!3d50.3404166!4d15.9355428
at the very end: !3d50.3404166!4d15.9355428
link
related:
How do I get the address and coordinates given this google place url?
Finding the lat/long coordinates in a Google Maps URL

How to add a zip code search box to my Google Map that will only search my markers

I have created a map using the Google Maps API v3.
I have created a Fusion Table with a hundred locations (markers) or so and have that successfully pulling into my map.
Now I need to add a search box to this page that will allow the user to enter their zip code and have the map zoom in to that area, then only seeing the locations in that zip code or the nearest locations to that zip code. I would also like the location data to pull into a sidebar as seen with the now deprecated Local Search API.
I have read most (if not all) of the posts that seemed to be about this, but to no luck. I feel like this shouldn't be that difficult really, I mean Google does search primarily right? Yet adding a search bar to my custom map is such a difficult task.
Any help would be appreciated, I have a deadline of tomorrow. Thanks everyone, I love it here.
Ryan
You will need to geocode the zip code and use the results to center the map, then show the markers that fit the bounds of the map if they are not already shown.
See http://code.google.com/apis/maps/documentation/javascript/geocoding.html
There is an example with a search box.

How to display Google Maps directions result on page

I want to have customers be able to enter their address into a text box, press submit, and then display the results on my own page instead of it going directly to maps.google.com. I am not familiar with the Google Maps API, so I was wondering how I could go about doing this?
I know how to have customers enter their address and get directions (via this link: http://css-tricks.com/snippets/html/get-directions-form-google-maps/) but now I just need to know how to take those results and embed them into a page on my site.
Read this page to get started (an API key is optional)
https://developers.google.com/maps/documentation/javascript/tutorial
Then, you need a text field and a button, to convert (geocode) an address like 123 Main St. to latitude and longitude coordinates. You may have to validate and create fields like town and state because the geocoder might send the marker to the wrong place.
Read this page for the details, I think the example is enough:
https://developers.google.com/maps/documentation/javascript/geocoding

How to send TWO sets of coordinates to GoogleMaps

lovely to be here.
Quick question.
If you click on the following link: http://maps.google.com/maps?q=53.838061,-1.604025
It will take you to Google Maps and you can see a single pin on the map. This is done by sending two parameters via the URL which, in this case are: 53.838061,-1.604025. These are the Latitude and Longitude coordinates of one location.
What I wish to have is basically two sets of coordinates so I can see two pins on the map.
Does anyone know how to do this?
Any help is greatly appreciated.
Thank You.
I think you will have to use this api: http://code.google.com/apis/maps/documentation/staticmaps/#Markers
There are also some examples there. I hope this helps.
Am taking that you need to know the co-ordinates from the maps page and not via the api.
Right click on the spot, in the menu select "whats here", maps inserts a marker on the spot, coordinates are on the search text box and also on mouse hover on the marker.