Device map
The device map component lets you mark devices on a map and display their property data based on geographic location. This topic explains how to configure this component.
Step 1: Add the component
-
Create a web application. For more information, see Create a web application.
-
In the web application editor, click the component icon
on the far left. -
Above the component list on the left side of the canvas, enter device map in the search box. Find the component and drag it to the center of the canvas.
For more information about adding components, see Add a component.
Step 2: Configure the data source
-
In the Style pane on the right side of the web application editor, click Edit Device Map.
-
On the Location Information page of the Device Map Editor, configure the data source for the devices to display on the map.
-
Click Select Product, choose the products that you want to display, then click OK.
You can select multiple products. The component automatically imports all devices of the selected products.
ImportantYou must configure coordinates for the devices of the selected products. Otherwise, the devices will not be visible on the map.
-
In the product list, click a target product, then configure coordinates for its devices.
Parameter
Description
Device coordinates
By default, the component uses the geographic coordinates that the device automatically reports. If a device cannot report geographic coordinates, you can batch import or manually mark the device coordinates. To batch import device coordinates, see Batch import coordinates by using a coordinate data template in this table.
NoteWhen a device comes online, the platform can estimate its approximate city-level location from its IP address. If the device is equipped with a GPS module, it can report its precise location by using the standard GeoLocation field in the TSL model. For more information about reporting locations by using a TSL model, see Report device location by using device properties (Geolocation).
On the device coordinate information card, you can manually mark, locate, or delete a device's coordinates.
-
Mark
-
In the list to the right of Device coordinates, select No Coordinates.
-
On the device coordinate information card, click Mark.
-
In the dialog box that appears, enter the Longitude and Latitude for the device and click Save. The device map then displays the device at the corresponding location.
-
-
Locate
-
In the list to the right of Device coordinates, select With Coordinates.
-
On the device coordinate information card, click Locate.
-
In the dialog box that appears, modify the Longitude and Latitude for the device and click Save. The device map then displays the device at the updated location.
-
-
Delete
-
In the list to the right of Device coordinates, select With Coordinates.
-
On the device coordinate information card, click the delete icon
to remove the device's coordinates from the device map.
-
Download coordinate data template
This option appears if a device in a selected product is missing coordinates.
-
Click this button to download an Excel file. The file contains the ProductKey, DeviceName, and location (longitude, latitude) for all devices of the added products.
-
In the location column, enter the longitude and latitude for each device and save the file. You can use the coordinate picker tool from AMAP Open Platform.
NoteThe device coordinate format is
longitude,latitude. Separate the longitude and latitude with a comma.
Batch import coordinates by using a coordinate data template
This option appears if a device in an added product is missing coordinates.
Click Batch import coordinates by using a coordinate data template and upload the completed Excel file. The locations of the corresponding devices are displayed on the device map.
To clear a device's location, delete the value in the location column for that device in the Excel file and re-upload the file.
NoteIf a device's longitude and latitude are recorded in both the Excel file and the device's coordinate property, the value from the coordinate property takes precedence.
Support device control
Select this checkbox to send device commands from the control mode in the device bubble. For more information, see Step 3: Configure the style.
-
-
-
(Optional) In the product list, hover over a target product and click the settings icon
on the right to configure the display style for the devices of that product.Parameter
Description
Customize device point style
After you enable this switch, you can separately configure the color, size, opacity, and icon for the device point.
Note-
By default, no custom icon is configured. Click the add icon
to the right of Custom Icon to import a custom icon in SVG format. -
Custom icons added for a single product automatically sync with the custom icons for all global Map Display configurations in the project.
-
If a custom icon is selected for a product, you can delete it. If you delete the custom icon, devices of that product use the system default icon.
Bubble property display
Click Configure Attributes to configure which properties appear in the device point bubble.
You can drag the properties to change their order.
-
Step 3: Configure the style
-
Click the Map Display icon
in the function menu on the far right to configure the global map display style.You can set the display of interaction items, map background, default device point style, cluster point style, and bubble style.
Note-
The default device point style settings apply only to newly added devices and devices that do not have a custom style. The configuration method is the same as for a single product.
If the Customize device point style settings for a product differ from the Default device point style settings, the custom device point style is used for the devices of that product.
-
If device control is enabled for a product or if control properties are defined in its TSL model, a Control Mode button appears in the device point bubble. To send commands to the device, click Control Mode, modify device property values, then click Send to Device.
-
-
Click the save icon
in the upper-right corner of the page.
(Optional) Configure geospaces
-
Click the Geospace icon
in the function menu on the far right to configure geospaces for your devices.Parameter
Description
+ Geospace
Select one or more existing geospaces within the project.
For more information about geospaces, see Spaces.
Click the settings button
to the right of each space to enable and configure Customize geospace style.Display on map
When enabled, the map displays the geospace based on the configured style.
The Default style configuration applies to all geospaces that do not have a custom style.
Default style configuration
-
Click the save icon
in the upper-right corner of the page. -
Return to the web application editor, select the device map component, and click the refresh icon
in the upper-left corner of the component.The canvas displays the configured map. To test the interactions, click the Preview icon
in the upper-right corner of the page.
Step 4: Configure interactions
-
In the Interaction pane on the right side of the web application editor, click Add Interaction to set an Event and an Action.
The When Device Point Is Clicked event is supported. For example, you can configure the Open Link action to trigger when a device point is clicked. This lets you specify how the link opens and what content it displays.
For more information, see Configure interactions.
-
Click Preview in the upper-right corner of the page to view and debug the component's data and style.
in the upper-right corner of the page.
in the function menu on the far right to configure geospaces for your devices.
in the upper-left corner of the component.
in the upper-right corner of the page.