From 859d0f9a8f4306d8a0dad53f638a78916684e824 Mon Sep 17 00:00:00 2001 From: andrewgryan Date: Wed, 30 Oct 2024 17:47:56 +0000 Subject: [PATCH 1/3] document TileLayer WMS with Storybook --- src/stories/TileLayerWMS.stories.js | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/stories/TileLayerWMS.stories.js diff --git a/src/stories/TileLayerWMS.stories.js b/src/stories/TileLayerWMS.stories.js new file mode 100644 index 0000000..7cfe865 --- /dev/null +++ b/src/stories/TileLayerWMS.stories.js @@ -0,0 +1,32 @@ +import "../index.js" + +export default { + title: "Example/TileLayerWMS", + tags: ['autodocs'], + render: ({ urlTemplate, layers, transparent }) => ``, + argTypes: { + layers: { type: "string", control: "select", options: [ + "TOPO-OSM-WMS", + "SRTM30-Colored-Hillshade", + "TOPO-WMS", + "OSM-Overlay-WMS", + "TOPO-WMS,OSM-Overlay-WMS", + "TOPO-WMS,SRTM30-Colored-Hillshade", + ]} + }, + args: { + urlTemplate: "http://ows.mundialis.de/services/service?", + layers: "SRTM30-Colored-Hillshade", + transparent: true + }, + decorators: [(story) => ` + + ${story()} + + `], +} + + +export const Default = { + args: {} +} From 8c687c72646c7bb7477db27415ee6a6740af2e54 Mon Sep 17 00:00:00 2001 From: andrewgryan Date: Wed, 30 Oct 2024 22:12:13 +0000 Subject: [PATCH 2/3] use British Geological Survey WMS --- src/stories/TileLayerWMS.stories.js | 96 +++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 18 deletions(-) diff --git a/src/stories/TileLayerWMS.stories.js b/src/stories/TileLayerWMS.stories.js index 7cfe865..d79e07e 100644 --- a/src/stories/TileLayerWMS.stories.js +++ b/src/stories/TileLayerWMS.stories.js @@ -1,32 +1,92 @@ -import "../index.js" +import "../index.js"; export default { title: "Example/TileLayerWMS", - tags: ['autodocs'], - render: ({ urlTemplate, layers, transparent }) => ``, + tags: ["autodocs"], + render: ({ urlTemplate, layers, transparent, styles }) => { + if (styles) { + return ``; + } else { + return ``; + } + }, argTypes: { - layers: { type: "string", control: "select", options: [ - "TOPO-OSM-WMS", - "SRTM30-Colored-Hillshade", - "TOPO-WMS", - "OSM-Overlay-WMS", - "TOPO-WMS,OSM-Overlay-WMS", - "TOPO-WMS,SRTM30-Colored-Hillshade", - ]} + layers: { + type: "string", + control: "select", + options: [ + "TOPO-OSM-WMS", + "SRTM30-Colored-Hillshade", + "TOPO-WMS", + "OSM-Overlay-WMS", + "TOPO-WMS,OSM-Overlay-WMS", + "TOPO-WMS,SRTM30-Colored-Hillshade", + ], + }, }, args: { urlTemplate: "http://ows.mundialis.de/services/service?", layers: "SRTM30-Colored-Hillshade", - transparent: true + transparent: true, }, - decorators: [(story) => ` + decorators: [ + (story) => ` ${story()} - `], -} - + `, + ], +}; export const Default = { - args: {} -} + args: {}, +}; + +export const BritishGeologicalSurvey = { + argTypes: { + layers: { + type: "string", + control: "select", + options: [ + "BGS250k.Bedrock", + "BGS250k.LinearBedrock", + "BGS250k.SBS", + "BGS250k.HardSubstrate", + ], + }, + urlTemplate: { + type: "string", + }, + }, + args: { + urlTemplate: + "https://map.bgs.ac.uk/arcgis/services/Offshore/Products_WMS/MapServer/WmsServer", + layers: "BGS250k.Bedrock", + transparent: true, + }, +}; + +export const BritishGeologicalSurveyHeatPump = { + argTypes: { + layers: { + type: "string", + control: "select", + options: ["GSHP.viability.screening.layer"], + }, + urlTemplate: { + type: "string", + }, + }, + args: { + urlTemplate: + "https://map.bgs.ac.uk/arcgis/services/GSHP/GSHP_WMS/MapServer/WmsServer", + layers: "GSHP.viability.screening.layer", + transparent: true, + }, + render: ({ urlTemplate, layers, transparent }) => { + return ` + + + `; + }, +}; From c97d9391246fb1a6b9971e06d18ed7d4b1290f75 Mon Sep 17 00:00:00 2001 From: andrewgryan Date: Wed, 30 Oct 2024 22:14:57 +0000 Subject: [PATCH 3/3] heat pump survey overlayed --- src/stories/TileLayerWMS.stories.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stories/TileLayerWMS.stories.js b/src/stories/TileLayerWMS.stories.js index d79e07e..151c9b6 100644 --- a/src/stories/TileLayerWMS.stories.js +++ b/src/stories/TileLayerWMS.stories.js @@ -85,8 +85,11 @@ export const BritishGeologicalSurveyHeatPump = { }, render: ({ urlTemplate, layers, transparent }) => { return ` - + `; }, };