- Overview
- Products
- Pricing
-
Documentation
- Guides
- Reference
- Samples
- Support
- Blog
- Community
This example listens for the click event, gets the latitude and longitude coordinates of the click from google.maps.MapMouseEvent.latLng, and displays those coordinates in an info window.
Read the documentation.
Try Sample
Clone Sample
Git and Node.js are required to run this sample locally. Follow these instructions to install Node.js and NPM. The following commands clone, install dependencies and start the sample application.
git clone -b sample-event-click-latlng //github.com/googlemaps/js-samples.git cd js-samples npm i npm startOther samples can be tried by switching to any branch beginning with sample-SAMPLE_NAME.
git checkout sample-SAMPLE_NAME npm i npm startExcept as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-11-17 UTC.
[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]
159 159 people found this article helpful Updated on August 24, 2021
Find GPS coordinates for any place on Earth
What to Know
This article explains how to get GPS coordinates for any location using Google Maps in a browser and the Google Maps app for Android and iOS devices. It also shows how to use GPS coordinates in Google Maps. Instructions apply to any current browser and Android or iOS device.
The instructions in this article require access to the Google Maps desktop site or the Google Maps mobile app for Android or iOS devices. It doesn't matter what operating system or phone you use.
How to Get GPS Coordinates From Google Maps
Retrieving GPS coordinates from Google Maps on a computer browser is simple. Follow these steps:
Open a web browser and go to the Google Maps website. Any browser will work.
Enter the name of the location or area for which you want the GPS coordinates in the search box.
Right-click (or Control+click on a Mac) on the location on the map.
Click the numbers at the top of the pop-up menu to copy them to the clipboard. The numbers represent the GPS coordinates in decimal degrees (DD) format.
If you prefer the familiar degrees, minutes, seconds (DMS) format for longitude and latitude, paste the numbers into the search field in Google Maps and select Search.
An information panel opens, revealing an image with the latitude and longitude in the familiar DMS format beneath it. Either of the GPS formats can be copied and used elsewhere.
How to Get Coordinates in the Google Maps App
It's also possible to get GPS coordinates from the Google Maps mobile app on your mobile device. It works with both the Android and iOS apps on iPhones. The steps differ slightly.
Android Phone or Tablet
If you're on an Android phone, you'll see the coordinates at the top of the screen.
Open the Google Maps app and select and hold the location until you see a red pin.
Look in the search box at the top of the screen to find the coordinates.
iPhone or iPad
If you use an iPhone, the process is a little different in iOS.
With the Google Maps app open, enter a location in the search field and go to it.
Press and hold a point on the map where you want to drop a red pin. (Choose an unlabeled area near the place where you want GPS coordinates.)
Select Dropped pin at the bottom of the screen to expand the section.
Tap the digital GPS coordinates to copy them.
Use Coordinates to Find a Location in Google Maps
If you have a set of GPS coordinates, such as for geocaching, enter the latitude and longitude into Google Maps to find the location and get directions.
Go to the Google Maps website.
Enter the coordinates in the search boxat the top of the Google Maps screen in one of the three acceptable formats:
- Degrees, minutes, seconds (DMS): for example, 36°59'21.2"N 84°13'53.3"W
- Degrees and decimal minutes (DMM): for example, 36 59.35333 -84 13.888333
- Decimal degrees (DD): for example, 36.989213,-84.231474
Select the magnifying glass next to the coordinates in the search bar to go to the location on Google Maps.
In the side panel, select Directions to view a map with directions to the location.
More About GPS Coordinates
Latitude is divided into 180 degrees. The equator is situated at 0 degrees latitude. The North Pole is at 90 degrees, and the South Pole is at -90 degrees latitude.
Longitude is divided into 360 degrees. The prime meridian, which is in Greenwich, England, is at 0 degrees longitude. Distance east and west is measured from this point, extending to 180 degrees east or -180 degrees west.
Minutes and seconds are smaller increments of degrees. They allow for precise positioning. Each degree is equal to 60 minutes, and each minute can be divided into 60 seconds. Minutes are indicated with an apostrophe (') and seconds with a double quotation mark (").
How to Find Elevation on Google Maps
Thanks for letting us know!
Get the Latest Tech News Delivered Every Day
Subscribe