在仪表板编辑模式下,点击屏幕顶部的「Add widget」按钮,或点击屏幕中央的大图标「Add new widget」(若为本仪表板第一个部件)。
找到「Maps」部件包并点击。该类别包含所有可用的地图部件类型。
选择最适合您使用场景的地图部件。
配置部件以匹配您的数据和可视化需求。可调整数据源、外观、地图提供商设置等。
点击部件配置窗口右下角的「Add」将部件添加到仪表板。
In dashboard edit mode, click the "Add widget" button at the top of the screen, or click the large "Add new widget" icon in the center of the screen (if this is your first widget on the dashboard).
Find the "Maps" widget bundle and click on it. This category includes all available map widget types.
Select the map widget that best fits your use case.
Configure the widget to match your data and visualization requirements. You can adjust data sources, appearance, map provider settings, and more. Click the "Add" in the bottom-right corner of the widget configuration window to place it on your dashboard.
The first step in configuring the map widget is selecting the map type. ThingsBoard offers several map widgets, including Image Map, which allows you to use a custom background image as the map. You can also configure map layers, enabling flexible switching between different map styles — such as satellite, hybrid, or custom layers — directly within the widget, with just a few clicks.
Click "Add layer".
Enter a label for the layer. Select a provider from the available options, or add a custom provider and specify its layer.
现在在部件上切换到新图层。
Click the "Layer" icon button on the widget.
You will see the available map layers. Switch between them.
Enter a label for the layer — this name will be shown in the widget's layer switcher. Choose the map provider by selecting from the available options (OpenStreetMap, Google, HERE, Tencent) or by specifying a custom tile server. Apply changes.
Go to the "Layer settings" by clicking the "gear" icon.
From the dropdown menu, select the layer type, or leave it as "No layer" if you don't want to use one. Apply changes.
Enter widget edit mode and go to the "Overlays" section. Make sure you're on the "Marker" tab and click "Add marker".
Select the data source - it can be a device, an entity alias, or a function. Define the coordinate keys. By default, ThingsBoard uses *latitude* and *longitude* attributes as the coordinate keys for the marker. If your entity uses different key names, update them here. Apply the changes.
The marker will appear on the map based on the specified coordinates.
To configure a specific marker, switch to the map widget's edit mode and, in the Overlays section, click the gear icon next to the desired marker to open its configuration panel.
Define the coordinate keys. ThingsBoard automatically sets the coordinate keys as latitude and longitude. If your entity uses custom coordinate key names, update them here. Additional data keys can be used for labels, tooltips, and displaying extra information directly on the map.
Customize the marker by selecting a different one from a variety of standard shapes and icons, and adjusting its size.
Use a function that dynamically changes the marker color based on the value of the "state" key.
Apply all changes.
Customize the marker by selecting a different one from a variety of standard shapes and icons, and adjusting its size.
Use a function that dynamically changes the marker color based on the value of the "state" key.
Apply all changes.
Here, you can customize the label displayed above the marker. By default, the label displays the entity name. You can edit the label text or use a label function to display more dynamic information;
Customized marker label.
Now, you need to add the tag action link to the tooltip function. Expand the tooltip function window to fullscreen for easier editing.
Edit the function by adding a link to the tag action. Be sure to specify the tag action name correctly.
Apply all changes.
Click the "Add tag action" icon button.
Configure the action and click "Add".
Now, you need to add the tag action link to the tooltip function. Expand the tooltip function window to fullscreen for easier editing.
Edit the function by adding a link to the tag action. Be sure to specify the tag action name correctly.
Apply all changes.
Click on the marker. In the tooltip that appears, you'll see a tag — click on it.
The action you defined in the tag's settings will be executed.
Behavior(行为)
设置点击标记时的行为。
Go to the "Behavior" section and click the "On click" action field to define the action instead of the default "Do nothing".
Set up the desired action and apply the changes.
Click on the marker.
The action you specified in the action settings will be triggered.
Go to the "Behavior" section and click the "On click" action field to define the action instead of the default "Do nothing".
Set up the desired action and apply the changes.
Click on the marker.
The action you specified in the action settings will be triggered.
Groups(分组)
标记可分组,便于后续通过「Groups」选项卡显示或隐藏分组元素。
在「Groups」区域输入要将此标记加入的组名称。
部件上将出现「Groups」图标按钮。点击它。
要隐藏某组,取消勾选其名称旁的复选框。
该组中的标记将被隐藏。
In the "Groups" section, enter a name for the group to which you want to add this marker.
A "Groups" icon button will appear on the widget. Click on it.
To hide a group, uncheck the box next to its name.
The markers that belong to this group have been hidden.
You can use the built-in tools to perform operations on markers such as Add / Move / Delete. By default, these tools are disabled. Check the boxes next to the tools you want to enable.
You can use the built-in tools to perform operations on markers such as Add / Move / Delete. By default, these tools are disabled. Check the boxes next to the tools you want to enable.
添加标记
若实体未设置坐标,可使用地图部件工具手动放置标记——其坐标将自动保存为实体的attributes。
首先,向地图添加标记放置工具:
在「Edit marker」区域勾选「Add」工具。
选择坐标存储的属性作用域:「Server」或「Shared」。
可选:启用吸附到其他顶点以精确绘制。
然后保存更改。
In the "Edit marker" section, check the "Add" tool. Next, select the attribute scope where the coordinates will be stored: "Server" or "Shared". Optionally, enable snapping to other vertices for precision drawing. Then, save the changes.
On the map widget, locate and click the "Place marker" icon button. If you're using an alias with multiple entities as the data source, you'll need to select the appropriate entity from the dropdown menu.
Find the location on the map where you want to place the marker and click on it.
The marker will be added, and its coordinates will be automatically saved to the entity as attributes.
On the map widget, locate and click the "Place marker" icon button. If you're using an alias with multiple entities as the data source, you'll need to select the appropriate entity from the dropdown menu.
Find the location on the map where you want to place the marker and click on it.
The marker will be added, and its coordinates will be automatically saved to the entity as attributes.
此外,勾选所需工具旁的复选框可移动或删除标记。
移动标记
别忘了在「Edit marker」区域的标记设置中启用「Move」工具。
要移动标记,用鼠标点击并按住标记,拖至新位置后松开鼠标。
To move the marker, click and hold the marker with your mouse, drag it to the new location, and then release the mouse button.
删除标记
别忘了在「Edit marker」区域的标记设置中启用「Remove」工具。
要删除标记,点击该标记,然后点击部件底部菜单中的垃圾桶图标。
To delete a marker, simply click on it, then click the trash bin icon in the menu at the bottom of the widget.
To enable clustering for map markers, check the corresponding option and configure the necessary settings.
Change the zoom level.
Your markers with clustering enabled will group into a circular icon that shows the number of clustered items inside.
Enter widget edit mode and go to the "Overlays" section. Switch to the "Polygons" tab and click "Add polygon".
Select the entity that will be represented as a polygon. This can be a device, entity alias, or function. Define the key with the coordinates of the polygon. ThingsBoard will use the "perimeter" key by default to read the polygon coordinates from the entity's attributes. If you use a different key, update it accordingly. Click "Apply".
The polygon will appear on the map based on the entity's data.
To configure a specific polygon, switch to the map widget's edit mode. Then, in the "Polygon" tab under the "Overlays" section, click the "gear" icon button next to the desired polygon to open its configuration panel.
Datasource(数据源)
指定多边形的数据源——可为设备、entity alias或function。
如有需要,可应用筛选缩小选择范围。
Specify the polygon data source — it can be a device, entity alias, or function. If necessary, use a filter.
Define the key that contains the polygon coordinates. By default, ThingsBoard uses "perimeter" as the polygon key. If your entity uses a different key name, make sure to update it here. Additional data keys can be used for labels, tooltips, or to display extra information directly on the map.
填充多边形
Fill(填充)— 定义多边形在地图上的填充方式:
Color(颜色)— 设置纯色填充。
Stripe(条纹)— 使用斜线填充代替纯色,便于标识特殊区域。
Image(图片)— 可使用图片作为背景填充。
Stroke(描边)— 定义多边形轮廓:
Border color(边框颜色)
Line thickness(线宽)
Change the fill color and stroke color of the polygon. For the fill, you can also use stripes or an image as a background.
Configure the label displayed above the polygon. By default, the label shows the name of the entity linked to that polygon. You can manually edit the label text or use a label function to display dynamic information.
Custom polygon label.
Here you can configure a tooltip that appears when you click on or hover over the polygon. Use the tooltip pattern or tooltip function to define more dynamic content. Alternatively, you can hide the tooltip altogether.
Click on the polygon to display the tooltip.
Behavior(行为)
Go to the "Behavior" section and click the "On click" action field to define the action instead of the default "Do nothing".
Set up the desired action and apply the changes.
Click on the polygon.
The action you specified in the action settings will be triggered.
Go to the "Behavior" section and click the "On click" action field to define the action instead of the default "Do nothing".
Set up the desired action and apply the changes.
Click on the polygon.
The action you specified in the action settings will be triggered.
Groups(分组)
多边形可分组,便于后续通过「Groups」选项卡显示或隐藏分组元素。
In the "Groups" section, enter a name for the group to which you want to add this polygon;
A "Groups" icon button will appear on the widget. Click on it;
To hide a group, uncheck the box next to its name.
The polygon that belong to this group have been hidden.
In the "Groups" section, enter a name for the group to which you want to add this polygon;
A "Groups" icon button will appear on the widget. Click on it;
To hide a group, uncheck the box next to its name.
The polygon that belong to this group have been hidden.
You can use the built-in tools to perform operations on markers such as Add / Move / Delete. By default, these tools are disabled. Check the boxes next to the tools you want to enable.
You can use the built-in tools to perform operations on markers such as Add / Move / Delete. By default, these tools are disabled. Check the boxes next to the tools you want to enable.
In the "Edit polygon" section, check the "Add" tool. Next, select the attribute scope where the coordinate will be stored: "Server" or "Shared". Optionally, enable snapping to other vertices for precision drawing. Then, save the changes.
现在可在地图上放置多边形:
The map widget now offers two tools for adding a polygon: "Drew rectangle" and "Drew polygon". Choose the option that suits your needs.
If you're using an alias with multiple entities as the data source, select the desired entity from the dropdown list.
Find the desired location on the map and click to place the first point;
Adjust the polygon to the desired size, then click again to finish. If you're using "Drew polygon", make sure to close the shape by clicking the first point once you've placed all others.
The polygon will be added, and its coordinates will be automatically saved to the entity as attribute.
The map widget now offers two tools for adding a polygon: "Drew rectangle" and "Drew polygon". Choose the option that suits your needs.
If you're using an alias with multiple entities as the data source, select the desired entity from the dropdown list.
Find the desired location on the map and click to place the first point;
Adjust the polygon to the desired size, then click again to finish. If you're using "Drew polygon", make sure to close the shape by clicking the first point once you've placed all others.
The polygon will be added, and its coordinates will be automatically saved to the entity as attribute.
编辑多边形
别忘了在「Edit polygon」区域的多边形设置中启用「Edit」工具。
要调整多边形大小,点击它——顶点将显示。 Drag any of the points to adjust the polygon’s size.
To resize the polygon, click on it — its vertices will appear. Drag any of the points to adjust the polygon's size.
Once you're satisfied with the new size, click anywhere outside the polygon to apply the current dimensions.
移动多边形
别忘了在「Edit polygon」区域的多边形设置中启用「Move」工具。
要移动多边形,点击多边形,按住鼠标并拖至新位置。
To enable moving a polygon on the map, activate the "Move" tool in the polygon settings under the "Edit polygon" section.
Now, click on the polygon, hold down the mouse button, and drag it to the new location.
旋转多边形
要旋转多边形:
Select the polygon by clicking on it, then click the "Rotate polygon" icon button from the tools at the bottom.
Grab any point of the polygon and drag it in the desired direction to rotate it.
Once you're satisfied with the rotation, click the "Rotate polygon" icon button again to finish.
Select the polygon by clicking on it, then click the "Rotate polygon" icon button from the tools at the bottom.
Grab any point of the polygon and drag it in the desired direction to rotate it.
Once you're satisfied with the rotation, click the "Rotate polygon" icon button again to finish.
裁剪多边形区域
从多边形中裁剪出区域:
Select the polygon by clicking on it, then choose "Cut polygon area" from the tools at the bottom.
Draw the area you want to remove by outlining it on the polygon.
Close the shape by connecting the first and last points.
Click anywhere outside the polygon to save the changes.
Select the polygon by clicking on it, then choose "Cut polygon area" from the tools at the bottom.
Draw the area you want to remove by outlining it on the polygon.
Close the shape by connecting the first and last points.
Click anywhere outside the polygon to save the changes.
删除多边形
别忘了在「Edit polygon」区域的多边形设置中启用「Remove」工具。
要删除多边形,点击它,然后点击部件底部菜单中的「trash bin」图标。
To delete a polygon, simply click on it, then click the "trash bin" icon in the menu at the bottom of the widget.
Enter widget edit mode and go to the "Overlays" section. Switch to the "Circles" tab and click "Add circle".
Select the entity that will be represented as a circle. This can be a device, entity alias, or function. Define the key with the coordinates of the circle. ThingsBoard will use the "perimeter" key by default to read the circle coordinates from the entity's attribute. If your entity uses a different key name, update it here. Click "Apply" — the circle will appear on the map based on the entity's data.
The circle has been successfully added to the map.
To configure a specific circle, switch to the map widget's edit mode. Then, in the "Circle" tab under the "Overlays" section, click the "gear" icon button next to the desired circle to open its configuration panel.
Define the key that contains the circle coordinates. By default, ThingsBoard uses "perimeter" as the circle key. If your entity uses a different key name, make sure to update it here. Additional data keys can be used for labels, tooltips, or to display extra information directly on the map.
填充圆形
Fill(填充)— 定义圆形在地图上的填充方式:
Color(颜色)— 设置纯色填充。
Stripe(条纹)— 使用斜线填充代替纯色,便于标识特殊区域。
Image(图片)— 可使用图片作为背景填充。
Stroke(描边)— 定义圆形轮廓:
Border color(边框颜色)
Line thickness(线宽)
Change the fill color and stroke color of the circle. For the fill, you can also use stripes or an image as a background.
Configure the label displayed above the circle. By default, the label shows the name of the entity linked to that circle. You can manually edit the label text or use a label function to display dynamic information.
Custom circle label.
Configure the label displayed above the circle. By default, the label shows the name of the entity linked to that circle. You can manually edit the label text or use a label function to display dynamic information.
Custom circle label.
Tooltip(提示)
Use tooltip pattern or tooltip function.
Click on the circle to display the tooltip.
Use tooltip pattern or tooltip function.
Click on the circle to display the tooltip.
Behavior(行为)
设置点击圆形时的行为。
Go to the "Behavior" section and click the "On click" action field to define the action instead of the default "Do nothing".
Set up the desired action and apply the changes.
Click on the circle.
The action you specified in the action settings will be triggered.
Go to the "Behavior" section and click the "On click" action field to define the action instead of the default "Do nothing".
Set up the desired action and apply the changes.
Click on the circle.
The action you specified in the action settings will be triggered.
Groups(分组)
圆形可分组,便于后续通过「Groups」选项卡显示或隐藏分组元素。
In the "Groups" section, enter a name for the group to which you want to add this circle.
Click on the "Groups" icon button.
To hide a group, uncheck the box next to its name.
The circle that belong to this group have been hidden.
In the "Groups" section, enter a name for the group to which you want to add this circle.
Click on the "Groups" icon button.
To hide a group, uncheck the box next to its name.
The circle that belong to this group have been hidden.
You can use the built-in tools to perform operations on circles such as Add / Move / Delete. By default, these tools are disabled. Check the boxes next to the tools you want to activate.
In the "Edit marker" section, check the "Add" tool. Next, select the attribute scope where the coordinates will be stored: "Server" or "Shared". Optionally, enable snapping to other vertices for precision drawing. Then, save the changes.
现在可在地图上放置圆形:
The map widget now offers a tool for adding a circle: "Draw circle". Click on this icon button to begin.
Find the desired location on the map and click to place the first point;
Adjust the circle to the desired size, then click again to finish.
The circle has been added to the map.
The map widget now offers a tool for adding a circle: "Draw circle". Click on this icon button to begin.
Find the desired location on the map and click to place the first point;
Adjust the circle to the desired size, then click again to finish.
The circle has been added to the map.
To resize the circle, click on it, and a radius edi point will appear. Drag it to adjust the size of the circle.
Once you're satisfied with the new size, click anywhere outside the circle to apply the current dimensions.
移动圆形
别忘了在「Edit circle」区域的圆形设置中启用「Move」工具。
要移动圆形,点击它,按住鼠标并将圆形拖至新位置。
To move a circle, click on it, hold down the mouse button, and drag circle to the new location.
To move a circle, click on it, hold down the mouse button, and drag circle to the new location.
删除圆形
别忘了在「Edit polygon」区域的圆形设置中启用「Remove」工具。
要删除圆形,点击它,然后点击部件底部菜单中的「trash bin」图标。
To delete a circle, simply click on it, then click the "trash bin" icon in the menu at the bottom of the widget.
Additional datasources are auxiliary data sources that can be used for processing, filtering, or overlaying data on the main entities. They are often used in map overlay features or tooltips when additional context or information needs to be provided.
地图控件
地图控件为部件内地图控制按钮的配置设置。可:
指定控件元素的位置(如左上、右下等);
配置缩放交互(按钮、鼠标滚轮或双击);
选择缩放比例单位:公制或英制。
Enable the "Remove" tool in the circle settings under the "Edit circle" section.
To delete a circle, simply click on it, then click the "trash bin" icon in the menu at the bottom of the widget.
In the "Map action buttons" section, click "Add button".
Specify a name for the new button — for our example, "Add building" — and set its icon and color. Click the "Action" field to define the action, and instead of the default "Do nothing"
Choose the "Place map item" action.
Select the map item type to be placed — in this case, it's "Marker". The custom action function field contains a default function that displays a dialog for creating a device or an asset — exactly what we need. Then, click "Add".
Save the changes.
In the "Overlays" section, under the "Marker" tab, create a new entity alias as the data source. Name it "buildings".
Since I'll be creating assets with the asset type "buildings", set the filter type to "Asset type" and specify the type as "buildings". Apply all changes.
现在,标为「Add building」的操作按钮已出现在地图顶部。
在地图上找到要放置实体的位置并点击。
在弹出的「Add entity」对话框中输入新实体名称并选择类型——Asset。其他字段可选。
然后点击「Create」。
新标记已添加到地图。
Now, the action button labeled "Add building" has appeared at the top of the map. Find the location on the map where you want to place the entity and click on it.
In the "Add entity" dialog window that appears, make sure to enter a name for the new entity and select its type — Asset. Other fields are optional. Then, click "Create".
The new marker is now added to the map.
进入「Assets」页面——可找到新建资产「Building A」。
Go to the "Assets" page — here you'll find your newly created asset, "Building A".
通用地图设置
通用地图设置为ThingsBoard中地图部件的基础全局设置,定义地图加载时的行为及初始显示内容。
Fit map bounds to cover all markers(使地图边界覆盖所有标记):在部件加载时自动调整缩放和位置,使所有标记可见。
Default map center position(默认地图中心位置):在禁用自动缩放时设置地图中心(lat/lng坐标)。用作部件打开时的初始位置。
Limit of entities to load(加载实体数量限制):限制加载到地图上的实体数量。有助于在大量数据时保护性能(例如限制100可防止一次加载超过100个标记)。
Common map settings are the basic global settings for the Map widget in ThingsBoard. They define how the map behaves on load and what is displayed initially.
In the "Overlays" section, under the "Marker" tab, create a new entity alias as the data source. Name it "EV stations".
Since we'll be creating entities of the type "EV station", set the filter type to "Asset type" and specify the type as "EV station". Apply changes.
接下来配置操作:
滚动到「Actions」区域并点击「Add action」按钮。
将打开新窗口显示所有已创建操作。点击右上角「plus」图标添加。
选择操作源为「Widget header button」,输入按钮名称并选择类型。
可选:更改按钮旁图标或完全隐藏。也可为按钮设置自定义颜色。
从下拉菜单选择要执行的操作类型。本例为「Place map item」。
选择要放置的地图项类型——本例为「Marker」。
Custom action function 字段已包含默认函数,用于打开创建设备或资产的对话框——恰好满足需求。
Scroll down to the "Actions" section and click the "Add action" button.
A new window will open, displaying all your created actions. Click the "plus" icon button in the top-right corner to add one.
Select the action source as "Widget header button", enter a name for the button, and choose its type.
Optionally, change the icon that will appear next to the button or hide it entirely. You can also set a custom color for the button.
From the dropdown menu, select the type of action to be performed. In our case, it's "Place map item". Next, choose the type of map item to be placed — we'll be placing a "Marker". The custom action function field already contains a default function that opens a dialog for creating a device or an asset — exactly what we need. Then, click "Add".
Apply all changes and save the dashboard.
A new action button labeled "Add EV station" has now appeared at the top of the map.
标为「Add EV station」的新操作按钮已出现在地图顶部。使用它:
Click the newly created "Add EV station" button. Then, find the location on the map where you want to place the EV station and click on it.
In the "Add entity" dialog that appears, make sure to enter a name for the new entity and select its type — Asset. The other fields are optional. Then click "Create".
The new "EV station" marker is now added to the map.
Click the newly created "Add EV station" button. Then, find the location on the map where you want to place the EV station and click on it.
In the "Add entity" dialog that appears, make sure to enter a name for the new entity and select its type — Asset. The other fields are optional. Then click "Create".
The new "EV station" marker is now added to the map.
进入「Assets」页面——可找到新建资产「EV station 1」。
Go to the "Assets" page — there you'll find your newly created asset, "EV station 1".