Skip to main content

Map tile and geocoder sources

The Location and Region fields in the content edit form render a Leaflet map. By default, the map draws tiles from OpenStreetMap's public tile server, and the address search box queries the public Nominatim geocoder. These settings let an environment point both maps at a different tile server or geocoder.

This feature is available in Brightspot 5.0.9 and later. In earlier releases, the maps are hard-coded to OpenStreetMap.

Why configure map sources​

The OpenStreetMap Tile Usage Policy and the Nominatim Usage Policy ask production deployments to self-host or use a commercial provider. The OpenStreetMap Foundation can block a domain without notice. Following the policies does not guarantee that OpenStreetMap serves your tiles, so a production environment that depends on the maps should set its own sources.

Settings​

These are per-environment Brightspot settings in the same style as other brightspot/* keys. They have no editorial UI. Each key is independent, and Brightspot falls back to the OpenStreetMap default for any key you leave unset. When you set none of them, the maps render the same markup as earlier releases.

KeyDefault when unsetDescription
brightspot/mapTileUrlhttps://tile.openstreetmap.org/{z}/{x}/{y}.pngA Leaflet tile URL template. Use the {z}, {x}, and {y} placeholders; the {s} subdomain placeholder also works.
brightspot/mapTileAttribution© <a href="https://openstreetmap.org">OpenStreetMap</a> contributorsAn HTML string displayed on the map. Set this whenever you change the tile URL; otherwise the OpenStreetMap attribution remains, which is likely incorrect for the new provider.
brightspot/mapGeocoderSearchUrlhttps://nominatim.openstreetmap.org/searchThe endpoint the address search box on both maps calls.
brightspot/mapGeocoderReverseUrlhttps://nominatim.openstreetmap.org/reverseReserved. No CMS map performs a reverse lookup, so this key has no effect.
warning

Brightspot renders the tile URL into the content edit form's HTML, so CMS users can see it. If your tile provider requires an API key in the URL, use a key restricted by domain or referrer.

Geocoder compatibility​

The geocoder endpoints must be Nominatim-compatible. A search endpoint must accept the q and format=json query parameters and return Nominatim's JSON, including lat, lon, display_name, and boundingbox. Hosted and self-hosted Nominatim instances work. Other geocoder APIs, such as Google or Mapbox, do not work without a proxy that translates the request and response.

Example​

The following snippet configures a commercial tile provider and a self-hosted Nominatim instance in the Tomcat context.xml file.

1
<Environment name="brightspot/mapTileUrl" type="java.lang.String" value="https://tiles.example.com/light/{z}/{x}/{y}.png" />
2
<Environment name="brightspot/mapTileAttribution" type="java.lang.String" value="&amp;copy; OpenStreetMap contributors &amp;copy; &lt;a href=&quot;https://tiles.example.com/attribution&quot;&gt;Example Tiles&lt;/a&gt;" />
3
<Environment name="brightspot/mapGeocoderSearchUrl" type="java.lang.String" value="https://geocoder.example.com/search" />

You can set the same keys in settings.properties or any other source of Brightspot settings. For details, see Overriding configuration values.

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.