公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ui.Label
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
文本标签。
用法 | 返回 |
---|
ui.Label(value, style, targetUrl, imageUrl) | ui.Label |
参数 | 类型 | 详细信息 |
---|
value | 字符串,可选 | 要显示的文本。默认为空字符串。 |
style | 对象,可选 | 一个对象,包含允许的 CSS 样式及其要为此 widget 设置的值。请参阅 style() 文档。 |
targetUrl | 字符串,可选 | 要链接到的网址。默认为空字符串。 |
imageUrl | 字符串,可选 | 可选的图片网址。如果提供,标签将以图片形式呈现,并且值文本将在鼠标悬停时显示。仅允许使用数据网址和从 gstatic.com 加载的图标。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eCreates a text label UI element that can optionally display an image and link to a URL.\u003c/p\u003e\n"],["\u003cp\u003eCustomization options include text value, CSS styling, target URL, and image URL.\u003c/p\u003e\n"],["\u003cp\u003eImage URLs are restricted to data URLs and icons from gstatic.com, displayed on hover with the text value as a tooltip.\u003c/p\u003e\n"],["\u003cp\u003eDefault values are provided for optional arguments, resulting in an empty label with no styling or linking.\u003c/p\u003e\n"]]],["The `ui.Label` function creates a text label with optional styling, a target URL, and an image. The `value` argument sets the displayed text, `style` customizes the CSS, `targetUrl` defines a link, and `imageUrl` displays an image with hover text. The text, style, URL, and image arguments are all optional and have default values. The label will only allow images from gstatic.com or data urls.\n"],null,["# ui.Label\n\n\u003cbr /\u003e\n\nA text label.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------------------------|----------|\n| `ui.Label(`*value* `, `*style* `, `*targetUrl* `, `*imageUrl*`)` | ui.Label |\n\n| Argument | Type | Details |\n|-------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `value` | String, optional | The text to display. Defaults to an empty string. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this widget. See style() documentation. |\n| `targetUrl` | String, optional | The url to link to. Defaults to an empty string. |\n| `imageUrl` | String, optional | Optional image url. If provided, the label will be rendered as an image and the value text will be shown on mouse hover. Only data: urls and icons loaded from gstatic.com are allowed. |"]]