Interactive interface for browsing global, full-resolution satellite imagery
Wv 2777 firms protected areas (#4755)
Patrick Mouldena7d85cf8d4d3
diff --git a/config/default/common/colormaps/wdpa/World_Database_on_Protected_Areas.xml b/config/default/common/colormaps/wdpa/World_Database_on_Protected_Areas.xmlindex 842409c79..65e792d7c 100644--- a/config/default/common/colormaps/wdpa/World_Database_on_Protected_Areas.xml+++ b/config/default/common/colormaps/wdpa/World_Database_on_Protected_Areas.xml@@ -6,7 +6,15 @@<ColorMapEntry rgb="34,154,0" transparent="false" ref="1" /></Entries><Legend type="classification">- <LegendEntry rgb="34,154,0" id="1" tooltip="Protected Area" label="Protected Area" showLabel="true" />+ <LegendEntry rgb="34,154,0" id="1" tooltip="Terrestrial Protected Area" label="Terrestrial Protected Area" showLabel="true" />+ </Legend>+ </ColorMap>+ <ColorMap title="Protected Area">+ <Entries>+ <ColorMapEntry rgb="0, 110, 255" transparent="false" ref="1" />+ </Entries>+ <Legend type="classification">+ <LegendEntry rgb="0, 110, 255" id="1" tooltip="Marine Protected Area" label="Marine Protected Area" showLabel="true" /></Legend></ColorMap></ColorMaps>diff --git a/config/default/common/config/wv.json/layers/wdpa/World_Database_on_Protected_Areas.json b/config/default/common/config/wv.json/layers/wdpa/World_Database_on_Protected_Areas.jsonindex 6f5291076..132361914 100644--- a/config/default/common/config/wv.json/layers/wdpa/World_Database_on_Protected_Areas.json+++ b/config/default/common/config/wv.json/layers/wdpa/World_Database_on_Protected_Areas.json@@ -3,24 +3,21 @@"World_Database_on_Protected_Areas": {"id": "World_Database_on_Protected_Areas","layer": "0,1",+ "layerName": "pa_global","title": "Protected Areas","subtitle": "UNEP-WCMC and IUCN","description": "wdpa/World_Database_on_Protected_Areas","group": "overlays","tags": "wdpa pa national park protected areas","format": "image/png",- "type": "wms",+ "type": "xyz",+ "disableSnapshot": true,"layergroup": "Reference","wrapX": true,+ "maxZoom": 12,"projections": {"geographic": {- "source": "WDPA:wms"- },- "arctic": {- "source": "WDPA:wms"- },- "antarctic": {- "source": "WDPA:wms"+ "source": "FIRMS:xyz"}},"palette": {diff --git a/config/default/release/config/wv.json/sources.json b/config/default/release/config/wv.json/sources.jsonindex 09134171b..c9c3337d0 100644--- a/config/default/release/config/wv.json/sources.json+++ b/config/default/release/config/wv.json/sources.json@@ -21,6 +21,9 @@"WDPA:wms": {"url": "https://gis.unep-wcmc.org/arcgis/services/wdpa/public/MapServer/WMSServer"},+ "FIRMS:xyz": {+ "url": "https://firms.modaps.eosdis.nasa.gov/layers"+ },"DDV": {"url": "https://kv9drwgv6l.execute-api.us-west-2.amazonaws.com/","matrixSets": {diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.jsindex 20162967f..bef2f0adb 100644--- a/web/js/map/layerbuilder.js+++ b/web/js/map/layerbuilder.js@@ -791,6 +791,44 @@ export default function mapLayerBuilder(config, cache, store) {return layer;};+ const createXYZLayer = (def, options, day, state) => {+ const { proj: { selected }, date } = state;+ const { maxExtent, crs } = selected;++ const source = config.sources[def.source];++ const tileUrlFunction = (tileCoord) => {+ const z = tileCoord[0] - 1;+ const x = tileCoord[1];+ const y = tileCoord[2];++ const urlParams = `${def.layerName}/${z}/${y}/${x}`;++ return `${source?.url}/${urlParams}.png`;+ };++ const xyzSourceOptions = {+ crossOrigin: 'anonymous',+ projection: get(crs),+ tileUrlFunction,+ maxZoom: def.maxZoom,+ };++ const xyzSource = new OlSourceXYZ(xyzSourceOptions);++ const requestDate = util.toISOStringSeconds(util.roundTimeOneMinute(date.selected)).slice(0, 10);+ const className = `${def.id} ${requestDate}`;++ const layer = new OlLayerTile({+ source: xyzSource,+ className,+ extent: maxExtent,+ });++ return layer;+ };++/*** Create a new OpenLayers Layer* @param {object} def@@ -853,6 +891,9 @@ export default function mapLayerBuilder(config, cache, store) {case 'ttiler':layer = await getLayer(createTtilerLayer, def, options, attributes, wrapLayer);break;+ case 'xyz':+ layer = getLayer(createXYZLayer, def, options, attributes, wrapLayer);+ break;default:throw new Error(`Unknown layer type: ${type}`);}