ui.util.getCurrentPosition
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Pobiera bieżące położenie geograficzne użytkownika z usługi geolokalizacji przeglądarki.
Wykorzystanie | Zwroty |
---|
ui.util.getCurrentPosition(success, error) | |
Argument | Typ | Szczegóły |
---|
success | Funkcja | Funkcja wywołania zwrotnego, która przyjmuje obiekt ee.Geometry.Point jako parametr wejściowy. |
error | Funkcja (opcjonalnie) | Opcjonalna funkcja wywołania zwrotnego, która przyjmuje komunikat o błędzie jako parametr wejściowy. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eui.util.getCurrentPosition\u003c/code\u003e retrieves the user's current location using the browser's geolocation service.\u003c/p\u003e\n"],["\u003cp\u003eThe function accepts two arguments: a mandatory \u003ccode\u003esuccess\u003c/code\u003e callback function for handling the location data (as an \u003ccode\u003eee.Geometry.Point\u003c/code\u003e) and an optional \u003ccode\u003eerror\u003c/code\u003e callback for handling potential errors.\u003c/p\u003e\n"]]],["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"],null,["# ui.util.getCurrentPosition\n\n\u003cbr /\u003e\n\nGets the user's current geographic position from the browser's geolocation service.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------|---------|\n| `ui.util.getCurrentPosition(success, `*error*`)` | |\n\n| Argument | Type | Details |\n|-----------|--------------------|-----------------------------------------------------------------------------------|\n| `success` | Function | A callback function that takes a ee.Geometry.Point object as its input parameter. |\n| `error` | Function, optional | An optional callback function that takes an error message as its input parameter. |"]]