• JMap.Geolocation.goToMyLocation

    Parameters

    Returns Promise<JLocation>

    Deprecated

    Use JMap.Geolocation.followMyLocation instead.

    Returns the user current location if promise succeed, and pan and zoom to this location.

    Throws

    if browser doesn't support geolocation, if geolocation is disabled, if an unexpected error occurs while getting location from browser

    Example

    // pan and zoom to the user location
    JMap.Geolocation.goToMyLocation()
    .then(location => console.info("Paned and zommed to user location ", location))
    .error(error => console.error("Cannot get my location : ", error))