ui.util.getCurrentPosition
Gets the user's current geographic position from the browser's geolocation service.
Usage | Returns |
---|
ui.util.getCurrentPosition(success, error) | |
Argument | Type | Details |
---|
success | Function | A callback function that takes a ee.Geometry.Point object as its input parameter. |
error | Function, optional | An optional callback function that takes an error message as its input parameter. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["`ui.util.getCurrentPosition` retrieves the user's current location using the browser's geolocation service."],["The function accepts two arguments: a mandatory `success` callback function for handling the location data (as an `ee.Geometry.Point`) and an optional `error` callback for handling potential errors."]]],["This functionality retrieves the user's current location using the browser's geolocation. It utilizes `ui.util.getCurrentPosition(success, error)`. The `success` argument, a function, receives a `ee.Geometry.Point` object representing the location. An optional `error` argument, also a function, handles potential errors, receiving an error message as input. The function doesn't explicitly return any value but rather communicates the location or an error via callback functions.\n"]]