Leaflet layers
Maps ships a set of built-in Leaflet base layers and overlays from the Leaflet-providers library. Any name below can be used as a value of the layers or overlaylayers parameters (see the Layers examples). To add your own, use the custom layers setting.
Base layers
These work without any configuration:
OpenStreetMap,OpenStreetMap.DE,OpenStreetMap.HOTOpenTopoMapEsri.WorldStreetMap,Esri.WorldTopoMap,Esri.WorldImagery,Esri.WorldTerrain,Esri.WorldShadedRelief,Esri.WorldPhysical,Esri.OceanBasemap,Esri.NatGeoWorldMap,Esri.WorldGrayCanvasCartoDB.Positron,CartoDB.PositronNoLabels,CartoDB.PositronOnlyLabels,CartoDB.DarkMatter,CartoDB.DarkMatterNoLabels,CartoDB.DarkMatterOnlyLabelsBasemapAT.basemap,BasemapAT.grau,BasemapAT.overlay,BasemapAT.highdpi,BasemapAT.orthofoto(Austria)NASAGIBS.ModisTerraTrueColorCR,NASAGIBS.ModisTerraBands367CR,NASAGIBS.ViirsEarthAtNight2012FreeMapSK(Slovakia),MtbMap
Layers that need an API key
These load only once a key is supplied. Set the Thunderforest key in $egMapsLeafletLayersApiKeys:
Thunderforest.OpenCycleMap,Thunderforest.Transport,Thunderforest.TransportDark,Thunderforest.SpinalMap,Thunderforest.Landscape,Thunderforest.Outdoors,Thunderforest.PioneerNLS(historical maps; needs a MapTiler key)
Overlay layers
Use these with the overlaylayers parameter:
OpenSeaMapNASAGIBS.ModisTerraLSTDay,NASAGIBS.ModisTerraSnowCover,NASAGIBS.ModisTerraAOD,NASAGIBS.ModisTerraChlorophyllOpenWeatherMap.Clouds,OpenWeatherMap.Precipitation,OpenWeatherMap.Rain,OpenWeatherMap.Pressure,OpenWeatherMap.Wind,OpenWeatherMap.Temperature,OpenWeatherMap.Snow(withClassicandContourvariants) — need an OpenWeatherMap API key
Custom layers
Since Maps 13.1.0.
To add your own tile or WMS layers, define them with $egMapsLeafletLayerDefinitions in LocalSettings.php. The name of each definition becomes a valid value for the layers and overlaylayers parameters, in both #display_map maps and query result formats.
Each definition supports:
url(required): an XYZ tile template such ashttps://tiles.example.org/{z}/{x}/{y}.png, or the service endpoint for a WMS layer.options(optional): an array passed directly to Leaflet. Common keys areattribution,minZoom,maxZoom,subdomainsandbounds. For a WMS layer, putlayers,formatandtransparenthere.wms(optional): set totrueto load the layer through the WMS protocol.
Definitions without a non-empty url are ignored. A definition whose name matches a built-in layer, such as OpenStreetMap, overrides that built-in layer. Only the definitions a map actually uses are sent to the browser.
$egMapsLeafletLayerDefinitions = [
'Historic 1904' => [
'url' => 'https://tiles.example.org/historic1904/{z}/{x}/{y}.png',
'options' => [
'attribution' => 'Historic map tiles',
'minZoom' => 1,
'maxZoom' => 18,
'subdomains' => 'abc',
'bounds' => [ [ 49.5, 5.8 ], [ 53.6, 15.2 ] ],
],
],
'Weather' => [
'wms' => true,
'url' => 'https://example.org/geoserver/wms',
'options' => [
'layers' => 'weather:precipitation',
'format' => 'image/png',
'transparent' => true,
'attribution' => 'Weather service',
],
],
];
With those definitions in place, use the layers like any built-in one. "Historic 1904" becomes a base layer and "Weather" a toggleable overlay:
{{#display_map:Berlin |layers=Historic 1904 |zoom=12 }}
{{#display_map:Hamburg |overlaylayers=Weather |zoom=8 }}
Because attribution is rendered as HTML, only set it to content you trust.