From b009f7bc923782db2d3a6dd836dab4a762d4f78c Mon Sep 17 00:00:00 2001 From: Danny Koppenhagen Date: Thu, 14 Sep 2023 21:34:23 +0200 Subject: [PATCH] feat(ol-source-tile-debug): provide new component for TileDebug closes #250 # Conflicts: # vite.config.ts --- docs/.vitepress/config.ts | 4 ++ .../sources/tiledebug/index.md | 72 +++++++++++++++++++ docs/public/sitemap.xml | 5 ++ src/components/sources/OlSourceTileDebug.vue | 62 ++++++++++++++++ src/components/sources/index.ts | 3 + src/demos/ProjectionRegisterDemo.vue | 3 + src/demos/TileDebugDemo.vue | 18 +++++ vite.config.ts | 1 + 8 files changed, 168 insertions(+) create mode 100644 docs/componentsguide/sources/tiledebug/index.md create mode 100644 src/components/sources/OlSourceTileDebug.vue create mode 100644 src/demos/TileDebugDemo.vue diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 7b37f7b0..a33903ed 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -145,6 +145,10 @@ export default defineConfig({ text: "ol-source-tile-arcgis-rest", link: "/componentsguide/sources/arcgisrest/", }, + { + text: "ol-source-tile-debug", + link: "/componentsguide/sources/tiledebug/", + }, { text: "ol-source-tile-json", link: "/componentsguide/sources/tilejson/", diff --git a/docs/componentsguide/sources/tiledebug/index.md b/docs/componentsguide/sources/tiledebug/index.md new file mode 100644 index 00000000..c1f4684c --- /dev/null +++ b/docs/componentsguide/sources/tiledebug/index.md @@ -0,0 +1,72 @@ +# ol-source-tile-debug + +A pseudo tile source, which does not fetch tiles from a server, but renders a grid outline for the tile grid/projection along with the coordinates for each tile. +See examples/canvas-tiles for an example. + + + + + +
+ +
+ +## Usage + +::: code-group + +<<< ../../../../src/demos/TileDebugDemo.vue + +::: + +## Properties + +### Props from OpenLayers + +Properties are passed-trough from OpenLayers directly. +Their types and default values can be checked-out [in the official OpenLayers docs](https://openlayers.org/en/latest/apidoc/module-ol_source_TileDebug-TileDebug.html). +Only some properties deviate caused by reserved keywords from Vue / HTML. +This deviating props are described in the section below. + +### Deviating Properties + +None. + +## Events + +You have access to all Events from the underlying source. +Check out [the official OpenLayers docs](https://openlayers.org/en/latest/apidoc/module-ol_source_TileDebug-TileDebug.html) to see the available events tht will be fired. + +```html + +``` + +## Methods + +You have access to all Methods from the underlying source. +Check out [the official OpenLayers docs](https://openlayers.org/en/latest/apidoc/module-ol_source_TileDebug-TileDebug.html) to see the available methods. + +To access the source, you can use a `ref()` as shown below: + +```vue + + + +``` diff --git a/docs/public/sitemap.xml b/docs/public/sitemap.xml index 24b5836b..d8864cc1 100644 --- a/docs/public/sitemap.xml +++ b/docs/public/sitemap.xml @@ -97,6 +97,11 @@ 2023-06-22T22:30:00+00:00 0.80 + + https://vue3openlayers.netlify.app/componentsguide/sources/tiledebug/ + 2023-04-07T20:30:00+00:00 + 0.80 + https://vue3openlayers.netlify.app/componentsguide/sources/tilejson/ 2023-03-23T09:30:00+00:00 diff --git a/src/components/sources/OlSourceTileDebug.vue b/src/components/sources/OlSourceTileDebug.vue new file mode 100644 index 00000000..850f0e85 --- /dev/null +++ b/src/components/sources/OlSourceTileDebug.vue @@ -0,0 +1,62 @@ + + + diff --git a/src/components/sources/index.ts b/src/components/sources/index.ts index e8ee58ee..f8b266c0 100644 --- a/src/components/sources/index.ts +++ b/src/components/sources/index.ts @@ -7,6 +7,7 @@ import OlSourceOSM from "./OlSourceOSM.vue"; import OlSourceStadiaMaps from "./OlSourceStadiaMaps.vue"; import OlSourceTianDiTu from "./OlSourceTianDiTu.vue"; import OlSourceTileArcGISRest from "@/components/sources/OlSourceTileArcGISRest.vue"; +import OlSourceTileDebug from "./OlSourceTileDebug.vue"; import OlSourceTileJSON from "./OlSourceTileJSON.vue"; import OlSourceTileWMS from "./OlSourceTileWMS.vue"; import OlSourceVector from "./OlSourceVector.vue"; @@ -24,6 +25,7 @@ function install(app: App) { app.component("ol-source-stadia-maps", OlSourceStadiaMaps); app.component("ol-source-tianditu", OlSourceTianDiTu); app.component("ol-source-tile-arcgis-rest", OlSourceTileArcGISRest); + app.component("ol-source-tile-debug", OlSourceTileDebug); app.component("ol-source-tile-json", OlSourceTileJSON); app.component("ol-source-tile-wms", OlSourceTileWMS); app.component("ol-source-vector", OlSourceVector); @@ -45,6 +47,7 @@ export { OlSourceStadiaMaps, OlSourceTianDiTu, OlSourceTileArcGISRest, + OlSourceTileDebug, OlSourceTileJSON, OlSourceTileWMS, OlSourceVector, diff --git a/src/demos/ProjectionRegisterDemo.vue b/src/demos/ProjectionRegisterDemo.vue index 24d78ff8..62e7cf91 100644 --- a/src/demos/ProjectionRegisterDemo.vue +++ b/src/demos/ProjectionRegisterDemo.vue @@ -20,6 +20,9 @@ + + + diff --git a/src/demos/TileDebugDemo.vue b/src/demos/TileDebugDemo.vue new file mode 100644 index 00000000..6db8fd03 --- /dev/null +++ b/src/demos/TileDebugDemo.vue @@ -0,0 +1,18 @@ + + + diff --git a/vite.config.ts b/vite.config.ts index aa6e75b7..4f323b5e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -85,6 +85,7 @@ export default defineConfig({ "ol/source/ImageWMS": "ImageWMS", "ol/source/OSM": "OSM", "ol/source/StadiaMaps": "StadiaMaps", + "ol/source/TileDebug": "TileDebug", "ol/source/WMTS": "WMTSSource", "ol/tilegrid/WMTS": "TileGridWMTS", "ol/source/TileArcGISRest": "TileArcGISRest",