• JMap.Geolocation.goToMyLocation

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

    Parameters

    Returns Promise<JLocation>

    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))