The Position Chart allows for displaying the position of devices over a custom image, such as a floorplan. The block behaves similarly to the GPS History Block with the exception of the custom image in place of the world map.
The Position Chart configuration can be broken down into a number of sections.
Select the duration of data you would like to display for the devices on the chart. You may select time ranges between
Last received data point and
90 days. If choosing a duration other than
Last received data point, the data for each device will be represented by a colored line on the chart.
Select the device(s) and attributes for which you would like to display position data.
- Device IDs / Tags: A device query for which you would like to return data. Each device that matches the query will be represented separately on the Position Chart.
- X Attribute: The attribute on the selected device(s) that corresponds to the
xposition on the chart. This attribute must be a of the “Number” type, or a context variable that resolves to a Number attribute.
- Y Attribute: Similar to the X Attribute, except this represents the
yposition on the chart.
Choose the image atop which you would like to display position data. Enter an absolute URL to an image that is hosted on the service of your choosing.
The URL must resolve to an image; if it does not, the block will display an error message and position data will not be displayed within the block.
Once an image has been chosen, it is necessary to set a frame of reference for how to scale and position your device data over the image. By setting two reference pins, we are able to convert your
(xundefined y) position data into pixel positions on your image regardless of your data plane’s scale or orientation.
For each reference pin, you may click and drag the pin to a spot on the image or you may manually enter a pixel position in the format
xundefinedy, where the top left corner is position
0undefined0 and the bottom right is the image’s
Then, you must then enter the
xundefinedy coordinate that corresponds to that spot within your plane. Changing these values, or the position of the reference pins, will cause your position data to reorient.
Devices that have a large number of Attributes could potentially cause the block to take a long time to load. To avoid this, you can control what Attributes the device returns along with the location data.
- Additional Attributes: Choose how many Attributes are returned from the selected device.
- Select Attributes: Choose specific Attributes to return from the device when “Only return the following additional attributes” is selected under “Additional Attributes”.
Set the default viewport for the block. You can also interact with the chart in the block preview and pass its settings to the block configuration by clicking the “Set” button.
- Center: Automatically center the chart to the middle of the points returned by the query, or set a manual position for the chart’s center either as a context variable or in an
- Zoom: Automatically zoom the chart to display all points returned by the query, or set a manual zoom level. A zoom of
0displays the image at its natural size.
Once a user manually pans or zooms the chart in the dashboard view, the default settings are disregarded until the dashboard is reloaded.
Losant allows for customization of the pins for points on the map as well as the popups that appear when clicking on a map pin.
By default, Losant draws lines between data points on the map. You can remove these lines so that only the raw data points will be displayed.
Optionally, if line decorators are enabled, you can enable arrow decorators to show which direction your connected device was moving along the line.
By default, Losant places a red marker at the oldest (starting) point for a series and a green marker at the most recent (ending) point for a series. You can change the color and the transparency of either pin using the color picker for that pin, and the change will apply to all of the relevant start or end pins on the map.
If you want more control over marker pins, you can select
Advanced. Configuration is similar to advanced pin configuration in the GPS History Block.
When using the advanced mode, the following variables are available for you to use in the icon template:
isFirstPoint- True if this is the first (oldest) data point in the series.
isLastPoint- True if this is the last (most recent) data point in the series.
index- Index of the current data point in the series.
deviceName- Name of the device that generated this data point.
deviceId- Id of the device that generated this data point.
deviceTags- The tags (as an object) of the device that generated this data point.
x- The x position of the current data point.
y- The y position of the current data point.
time- Time of the current data point.
data.<attributeName>- Value of given attribute at this data point.
Just like the
Advanced pin configuration, the popup configuration allows you to provide a string template that will
be used for rendering the popup for a point. Configuration is similar to advanced pin configuration in the GPS History Block
The same variables exposed in the advanced pin style configuration are available in the popup configuration.