= Geographical Maps
:description: Learn more about the geographical map in {page-component-title} that displays nodes with address asset information, including dynamic alarm status.

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 under *Geographical Map* in the side 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 xref:deep-dive/admin/configuration/geocoder.adoc[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.

[options="header, autowidth"]
[cols="1,1a"]
|===
| Severity
| Map Pin

| Normal
| image::geographical-map/severity_normal.png[]

| Warning
| image::geographical-map/severity_warning.png[]

| Minor
| image::geographical-map/severity_minor.png[]

| Major
| image::geographical-map/severity_major.png[]

| Critical
| image::geographical-map/severity_critical.png[]
|===

== 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 https://www.openstreetmap.org[OpenStreetMap] and https://opentopomap.org[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:

. Click the *tile* symbol image:geographical-map/tile-provider-selector.png[width=64] on the geographical map.

. Select a provider from the list:

image:geographical-map/tile-provider-list.png[Radio button menu with three map options.]

=== User defined tile provider configuration

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

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

. Set `gwt.openlayers.name` to provide a display name

If you specify a user-defined tile provider, it will be the default (displays as the first one, and loads by default instead of the built-in providers).

NOTE: The `opennms.properties` file that is installed with {page-component-title} already contains an entry for the OpenNMS tile provider.

NOTE: Instead of editing the `opennms.properties` file directly, you should create a `.properties` file in the `etc/opennms.properties.d` folder with your override properties.

```
###### 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.)
# 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>
```

[start=3]
. 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.

.. In `jetty-webapps/opennms/WEB-INF/web.xml`, search for the section shown below.
.. 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`.

```xml
  <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>
```
