From 78dc2c68477c643d0d5d714e9791c3b9361d0b45 Mon Sep 17 00:00:00 2001 From: Danny Koppenhagen Date: Sun, 24 Sep 2023 20:27:07 +0200 Subject: [PATCH] feat(ol-source-geo-tiff): add new source for GeoTIFF --- docs/.vitepress/config.ts | 4 ++ docs/componentsguide/sources/geotiff/index.md | 68 +++++++++++++++++++ src/components/sources/OlSourceGeoTIFF.vue | 56 +++++++++++++++ src/components/sources/index.ts | 3 + src/demos/GeoTIFFDemo.vue | 45 ++++++++++++ 5 files changed, 176 insertions(+) create mode 100644 docs/componentsguide/sources/geotiff/index.md create mode 100644 src/components/sources/OlSourceGeoTIFF.vue create mode 100644 src/demos/GeoTIFFDemo.vue diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index f577805d..793d0ec9 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -125,6 +125,10 @@ export default defineConfig({ text: "ol-source-cluster", link: "/componentsguide/sources/cluster/", }, + { + text: "ol-source-geo-tiff", + link: "/componentsguide/sources/geotiff/", + }, { text: "ol-source-image-static", link: "/componentsguide/sources/imagestatic/", diff --git a/docs/componentsguide/sources/geotiff/index.md b/docs/componentsguide/sources/geotiff/index.md new file mode 100644 index 00000000..b893cf0c --- /dev/null +++ b/docs/componentsguide/sources/geotiff/index.md @@ -0,0 +1,68 @@ +# ol-source-geo-tiff + +Source for GeoTIFF tiles. + + + + + + + +## Usage + +::: code-group + +<<< ../../../../src/demos/GeoTIFFDemo.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_GeoTIFF.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_GeoTIFF.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_GeoTIFF.html) to see the available methods. + +To access the source, you can use a `ref()` as shown below: + +```vue + + + +``` diff --git a/src/components/sources/OlSourceGeoTIFF.vue b/src/components/sources/OlSourceGeoTIFF.vue new file mode 100644 index 00000000..b6280a37 --- /dev/null +++ b/src/components/sources/OlSourceGeoTIFF.vue @@ -0,0 +1,56 @@ + + + diff --git a/src/components/sources/index.ts b/src/components/sources/index.ts index f8b266c0..02b3d533 100644 --- a/src/components/sources/index.ts +++ b/src/components/sources/index.ts @@ -8,6 +8,7 @@ import OlSourceStadiaMaps from "./OlSourceStadiaMaps.vue"; import OlSourceTianDiTu from "./OlSourceTianDiTu.vue"; import OlSourceTileArcGISRest from "@/components/sources/OlSourceTileArcGISRest.vue"; import OlSourceTileDebug from "./OlSourceTileDebug.vue"; +import OlSourceGeoTIFF from "./OlSourceGeoTIFF.vue"; import OlSourceTileJSON from "./OlSourceTileJSON.vue"; import OlSourceTileWMS from "./OlSourceTileWMS.vue"; import OlSourceVector from "./OlSourceVector.vue"; @@ -26,6 +27,7 @@ function install(app: App) { 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-geo-tiff", OlSourceGeoTIFF); app.component("ol-source-tile-json", OlSourceTileJSON); app.component("ol-source-tile-wms", OlSourceTileWMS); app.component("ol-source-vector", OlSourceVector); @@ -48,6 +50,7 @@ export { OlSourceTianDiTu, OlSourceTileArcGISRest, OlSourceTileDebug, + OlSourceGeoTIFF, OlSourceTileJSON, OlSourceTileWMS, OlSourceVector, diff --git a/src/demos/GeoTIFFDemo.vue b/src/demos/GeoTIFFDemo.vue new file mode 100644 index 00000000..d7758836 --- /dev/null +++ b/src/demos/GeoTIFFDemo.vue @@ -0,0 +1,45 @@ + + +