Map Plugin

Overview

Map Plugin displays the status and parameters of stationary and moving objects on interactive OpenStreetMap maps. The plugin provides visual control of geographically distributed systems and transport. By clicking, a user is taken to a page with detailed information on the object of interest. Download the plugin using the link. The appearance of Map Plugin is shown in the following figure.

Map Plugin

Installation

Map Plugin is installed according to the instructions. During installation, complete the following additional step: copy the PlgMap.xml file from the plugin distribution into your project. The file should be displayed in the project explorer under the Webstation > Configuration Files node.

Configuring

Plugin Settings

General plugin settings that affect the display of all maps are located in the PlgMap.xml file.

The GeneralOptions section contains general plugin options:
PopupOnClick - whether to show the coordinates of the point a user clicked on.

The TileLayers section contains tile layer settings. Depending on the tile provider, each TileLayer has its own set of options. A user can switch tile layers on the map.

The MarkerIcons section defines the marker icons that are available on maps. There are two types of marker icons:

  1. Icons of the Classic type icons are based on an image file. The file name has a suffix corresponding to the object status: undefined, normal, error, and unbound (the status is not bound to a channel). The icon files are located in the SCADA\ScadaWeb\wwwroot\plugins\Map\images directory.
  2. Icons of the Awesome type use the popular graphic font called Font Awesome.

Creating Map

Each map is saved in a separate XML file with the map extension. The map example, MapExample.map, is included in the plugin installation package. Map files should be located in the views directory or its subdirectory.

So, to create a new map, in the Administrator application, create a new XML file with the map extension in the Views section of the project, and then specify the path to the created file in the Views table.

New file
Map file
Views table

Map File Structure

Consider the structure of the map file using MapExample.map as an example. All map XML elements are contained within the root MapView element.

The InitialView element contains the initial coordinates and scale of the map. The scale is an integer between 0 and 18.

<InitialView>
  <Lat>48.8430</Lat>
  <Lon>2.3275</Lon>
  <Zoom>13</Zoom>
</InitialView>

Next come the LayerGroup elements, each of which contains a group of map objects. A user can show and hide the group via the web interface.

The Options element inside a LayerGroup specifies the group's options.

<Options>
  <Name>Main</Name>
  <DefaultIcon>Site</DefaultIcon>
  <Visible>true</Visible>
  <ShowTooltips>true</ShowTooltips>
</Options>

Name - group name;
DefaultIcon - default marker icon;
Visible - visibility of group objects;
ShowTooltips - whether to display tooltips for objects.

Let's look at an example of a stationary object, the Location element:

<Location>
  <Name>Eiffel Tower</Name>
  <Descr>Avenue Anatole France, Paris, France</Descr>
  <Icon></Icon>
  <Lat>48.858222</Lat>
  <Lon>2.2945</Lon>
  <StatusCnlNum>0</StatusCnlNum>
  <DataItems>
    <DataItem cnlNum="101" />
    <DataItem cnlNum="104">My text</DataItem>
  </DataItems>
  <Links>
    <Link viewID="2" />
    <Link viewID="2">My link</Link>
  </Links>
</Location>

Name - object name;
Descr - object description;
Icon - marker icon. If not specified, the default icon is used;
Lat and Lon - latitude and longitude of the object;
StatusCnlNum - the number of the input channel that shows the object status. Equals 0 if the channel is not specified. Valid channel data: channel status equal to 0 means that the object status is not defined, channel value equal to 0 means the object is normal, channel value equal to 1 means the object is in an error state;
DataItems - channels whose values ​​are displayed in the object information popup;
Links - links to views that can be accessed from the information popup.

Let's consider an example of a mobile object, the Vehicle element:

<Vehicle>
  <Name>Taxi</Name>
  <Descr>Uber</Descr>
  <Icon>Car</Icon>
  <LatCnlNum>201</LatCnlNum>
  <LonCnlNum>202</LonCnlNum>
  <BearingCnlNum>203</BearingCnlNum>
  <StatusCnlNum>204</StatusCnlNum>
  <DataItems />
  <Links />
</Vehicle>

The Name, Descr, Icon, StatusCnlNum, DataItems and Links parameters are similar to a stationary object.
LatCnlNum and LonCnlNum - channel numbers that determine the latitude and longitude of the object;
BearingCnlNum - channel number that determines the rotation of the object. Rotation is measured in degrees. A channel value of 0 corresponds to neutral object rotation. A positive value means clockwise rotation, while a negative value means counterclockwise rotation.

The Circle, Polygon, Polyline and Rectangle elements are used to add corresponding geometric shapes to the map.