公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ui.Map
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Google 地图。
用法 | 返回 |
---|
ui.Map(center, onClick, style) | ui.Map |
参数 | 类型 | 详细信息 |
---|
center | 对象,可选 | 一个对象,其中包含地图的纬度(“lat”)、经度(“lon”)和可选的缩放级别(“zoom”)。 |
onClick | 函数(可选) | 在点击地图时触发的回调。系统会向回调传递一个对象,其中包含地图上点击点的坐标(键为 lon 和 lat)以及地图 widget 本身。 |
style | 对象,可选 | 一个包含允许的 CSS 样式及其要为此地图设置的值的对象。请参阅 style() 文档。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThe \u003ccode\u003eui.Map\u003c/code\u003e function creates an interactive map widget within your Earth Engine app, accepting optional arguments to define its center, click behavior, and visual style.\u003c/p\u003e\n"],["\u003cp\u003eThe map's initial center is adjustable by specifying a \u003ccode\u003ecenter\u003c/code\u003e object containing latitude (\u003ccode\u003elat\u003c/code\u003e), longitude (\u003ccode\u003elon\u003c/code\u003e), and optionally zoom (\u003ccode\u003ezoom\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eClicking the map triggers an optional \u003ccode\u003eonClick\u003c/code\u003e callback function, providing coordinates (\u003ccode\u003elon\u003c/code\u003e, \u003ccode\u003elat\u003c/code\u003e) of the clicked point and the map widget for custom interactions.\u003c/p\u003e\n"],["\u003cp\u003eThe map's appearance can be customized using a \u003ccode\u003estyle\u003c/code\u003e object with valid CSS properties, analogous to the \u003ccode\u003estyle()\u003c/code\u003e function's capabilities.\u003c/p\u003e\n"]]],["The `ui.Map` function creates a Google Map. It accepts optional arguments: `center` (latitude, longitude, and zoom), `onClick` (a function triggered on map clicks, providing click coordinates), and `style` (CSS styling object). The function returns a `ui.Map` object. Clicking the map triggers the `onClick` callback, delivering the clicked location's latitude and longitude, as well as the map itself.\n"],null,["# ui.Map\n\n\u003cbr /\u003e\n\nA Google map.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------|---------|\n| `ui.Map(`*center* `, `*onClick* `, `*style*`)` | ui.Map |\n\n| Argument | Type | Details |\n|-----------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `center` | Object, optional | An object containing the latitude ('lat'), longitude ('lon') and optionally the zoom level ('zoom') for the map. |\n| `onClick` | Function, optional | A callback fired when the map is clicked. The callback is passed an object containing the coordinates of the clicked point on the map (with keys lon and lat) and the map widget itself. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this map. See style() documentation. |"]]