• JMap.Geolocation.getMyLocation

    Returns the user current location if promise succeed.

    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

    // returns a promise that return the user current location if succeed
    JMap.Geolocation.getMyLocation()
    .then(location => console.info("My location is ", location))
    .error(error => console.error("Cannot get my location : ", error))