Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get google map link with latitude/longitude

Tags:

google-maps

I want to get google map link that show title/content in marker that located at latitude/longitude.

so parameters are title, content, latitude , longitude . Result is a link like this https://maps.google.com/?ie=UTF8&ll=xxx,xxx&title=xxx&content=xxx

I searched google and don't find answer, event in google API.

like image 404
jziwenchen Avatar asked Jun 25 '13 06:06

jziwenchen


People also ask

How do you create a location link with latitude and longitude?

If the latitude and longitude in the URL is preceded by an "@" symbol, (e.g. https://www.google.ca/maps/@43.6474528,-79.3799409,14.78z): Latitude: \@(-?[\d\.]*)

How can I get latitude and longitude data from Google Maps?

If you have the URL to a Google Maps link, you can easily get the latitude and longitude data from it. 1. Go to the Google Maps link and add a command to Extract the page URL.

How do I find the URL of a location on Google Earth?

Open the following url with the latitude and longitude and zoom level. 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. Open google map and show URL schemes location and location pin

How to view the location corresponding to a latitude and longitude?

To easily view the location corresponding to a latitude and longitude, you can also build a custom URL. CAUTION! the point is the only decimal separator allowed for your latitudes and longitudes The Google URL is different from the previous URL with a search by postal address. The separator between latitude and longitude is the comma.

What is the difference between latitude and longitude on Google Maps?

Latitude lines are perpendicular to longitude lines and measure your North/South location. Latitude and longitude are measured in degrees (D), minutes (M), and seconds (S). Google maps displays coordinates in two ways: Degrees, Minutes, and Seconds: DDD° MM' SS.S; 42°13'08.2"N 83°44'00.9"W


6 Answers

I've tried doing the request you need using an iframe to show the result for latitude, longitude, and zoom needed:

<iframe 
  width="300" 
  height="170" 
  frameborder="0" 
  scrolling="no" 
  marginheight="0" 
  marginwidth="0" 
  src="https://maps.google.com/maps?q='+YOUR_LAT+','+YOUR_LON+'&hl=es&z=14&amp;output=embed"
 >
 </iframe>
 <br />
 <small>
   <a 
    href="https://maps.google.com/maps?q='+data.lat+','+data.lon+'&hl=es;z=14&amp;output=embed" 
    style="color:#0000FF;text-align:left" 
    target="_blank"
   >
     See map bigger
   </a>
 </small>
like image 184
mram888 Avatar answered Sep 29 '22 10:09

mram888


@vignesh the single quotes are only needed if you are using js variables

<iframe src = "https://maps.google.com/maps?q=10.305385,77.923029&hl=es;z=14&amp;output=embed"></iframe>
like image 23
gmlv Avatar answered Sep 29 '22 10:09

gmlv


None of the above answers work, but this will.

<iframe src="'https://maps.google.com/maps?q=' + lat + ',' + lng + '&t=&z=15&ie=UTF8&iwloc=&output=embed'" />
like image 42
Cutedu Avatar answered Oct 02 '22 10:10

Cutedu


See documentation on how to search using latitude/longitude here.

For location specified as: +38° 34' 24.00", -109° 32' 57.00

https://maps.google.com/maps?q=%2B38%C2%B0+34'+24.00%22,+-109%C2%B0+32'+57.00&ie=UTF-8

Note that the plus signs (%2B) and degree symbols(%C2%B0) need to be properly encoded.

like image 43
XiaoChuan Yu Avatar answered Oct 02 '22 10:10

XiaoChuan Yu


Keep it in iframe, dynamically bind data from object.

"https://www.google.com/maps/embed/v1/place?key=[APIKEY]%20&q=" + content..Latitude + ',' + content.Longitude;

References for longitude and Latitude.
https://developers.google.com/maps/documentation/embed/guide

Note:[APIKEY] will expire in 60days and regenerate key.

google-maps google-maps-embed

like image 37
GirishBabuC Avatar answered Oct 02 '22 10:10

GirishBabuC


Use View mode returns a map with no markers or directions.

The example below uses the optional maptype parameter to display a satellite view of the map.

https://www.google.com/maps/embed/v1/view
  ?key=YOUR_API_KEY
  &center=-33.8569,151.2152
  &zoom=18
  &maptype=satellite
like image 41
Marcelo Austria Avatar answered Sep 29 '22 10:09

Marcelo Austria