Geographical Maps

OpenNMS includes a geographical map which can show nodes with address asset information on a world map, including dynamic alarm status.

The geographical map is located in the Maps menu or by going to the page of a node that has an address and/or longitude/latitude defined in its asset fields, and following the View in Geographical Map link.

Markers and clusters

The geographical map displays each node that has an associated longitude and latitude in the database. If a node does not have coordinates recorded, update the requisition to include address asset fields and verify the geocoder service is configured and enabled.

The geographical map automatically clusters nodes into groups if they are close together. A marker with a number in it indicates a cluster and the number of nodes in it. Hover over a cluster to show the contents of the nodes it contains. Click on a marker to show the summary of the nodes it contains.

Status

A node’s marker displays as the color associated with the most severe alarm for that node. A cluster’s marker displays as the color of the highest severity of the nodes the marker contains.

Severity Map Pin

Normal

severity normal

Warning

severity warning

Minor

severity minor

Major

severity major

Critical

severity critical

Tile providers

Tile providers are services that provide the image data (in the form of map tiles) for the geographical map. By default, OpenNMS uses the publicly available OpenStreetMap and OpenTopoMap.

However, if you need to use your own map server, for example on a local server inside a firewall, you can specify a user-defined tile provider.

To select among tile providers, follow these steps:

  1. Click the tile symbol tile provider selector on the geographical map.

  2. Select a provider from the list:

Radio button menu with three map options.

Tile provider configuration

To configure a user-defined tile provider, follow these steps:

  1. In etc/opennms.properties, use the configuration below. In this case the local tile provider is found at 192.168.0.99.

  2. Set gwt.openlayers.name to provide a display name, and specify gwt.openlayers.userDefinedAsDefault=true if you want this tile provider to be the default (displays as the first one, and loads by default instead of the built-in providers).

###### MAPPING AND GEOCODING ######

# The tile server URL to use for OpenLayers. This can be any mapnik-style tile server URL.
# (Sorry, no support for multiple URLs yet.)
# If 'gwt.openlayers.userDefinedAsDefault' is true, use this tile server as the default one on the Geographical Map page
# OpenNMS default tile server

gwt.openlayers.name=My Street Map
gwt.openlayers.url=http://192.168.0.99/{z}/{x}/{y}.png
gwt.openlayers.options.attribution=Map data &copy; <a tabindex="-1" target="_blank" href="http://192.168.0.99/copyright">My Street Map</a> contributors under <a tabindex="-1" target="_blank" href="192.168.0.99/licenses/odbl/">ODbL</a>, <a tabindex="-1" target="_blank" href="http://192.168.0.99/licenses/by-sa/2.0/">CC BY-SA 2.0</a>
gwt.openlayers.userDefinedAsDefault=true
  1. In addition, if you supply a user-defined tile provider, you need to update the 'Content-Security-Policy' of your OpenNMS instance to ensure the browser does not block the tile provider.

    1. In jetty-webapps/opennms/WEB-INF/web.xml, search for the section shown below.

    2. Update the param-value under Sets the header value to include your tile provider’s URL in the img-src section. The example below adds the URL http://192.168.0.99.

  <filter>
    <description>Set Content-Security-Policy header</description>
    <filter-name>Content-Security-Policy-Filter</filter-name>
    <filter-class>org.opennms.web.servlet.AddHeaderFilter</filter-class>
    <init-param>
      <description>Sets the header key.</description>
      <param-name>key</param-name>
      <param-value>Content-Security-Policy</param-value>
    </init-param>
    <init-param>
      <description>Sets the header value.</description>
      <param-name>value</param-name>
      <param-value>default-src 'none' ; frame-src 'self' ; manifest-src 'self' ; script-src 'self' 'unsafe-inline' 'unsafe-eval'; font-src 'self' https://fonts.googleapis.com  https://fonts.gstatic.com; connect-src 'self' ; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; base-uri 'self' ; form-action 'self' ; img-src 'self' https://tiles.opennms.org https://*.tile.openstreetmap.org https://*.tile.opentopomap.org http://192.168.0.99 data:</param-value>
    </init-param>
  </filter>