公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ui.util.getCurrentPosition
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
从浏览器的地理定位服务获取用户的当前地理位置。
用法 | 返回 |
---|
ui.util.getCurrentPosition(success, error) | |
参数 | 类型 | 详细信息 |
---|
success | 函数 | 一个回调函数,它将 ee.Geometry.Point 对象作为输入参数。 |
error | 函数(可选) | 一个可选的回调函数,该函数将错误消息作为其输入参数。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\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. |"]]