We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to navigate to the user's current GeoLocation?

Navigating to the users GeoLocation can be achieved by getting the respective latitude and longitude of that location.

The following steps help you meet the requirement.

Step 1: Create a map sample and include necessary script files.

Step 2: By using the following snippet you can get the users current location as latitude and longitude, and based on this you can navigate to the specified location.

HTML

In the following code example is used the markerTemplate to denote the navigated location, based on respective latitude and longitude.

You can refer the following online documentation link for more details on using the markerTemplate.

http://help.syncfusion.com/ug/js/documents/mapelements.htm

Sample Location for Markers:

http://js.syncfusion.com/demos/web/#!/azure/map/DataMarkers

HTML

Screenshot:

In the following example, you can see that the Chennai location with its corresponding latitude and longitude, as the current location and when you click the NavigateToCurrentLocation button, it starts to navigate to Chennai.

Figure 1: GeoLocation

Article ID: Published Date: Last Revised Date: Platform: Control:
3100 01/06/2015 01/06/2015 JavaScript ejMap
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon