Total Articles: 1

Using Geolocation and Google Maps

Published: 12/1/2020

As many users browse websites on their mobile phones, you might need the ability to guide the user from their current location to your location. This is easily accomplished using the browser's built-in navigator.geolocation object and Google maps. The geolocation object provides the latitude and longitude of the user's phone or desktop. You can embed a Google map on your web page and show the user their location based on that latitude and longitude. Additional API calls to Google's mapping API can give the user step-by-step directions to your location. This article shows you how to get started using these two powerful API's.