From 8ee4b1e38e4778b942f636f223d9bd8cde09bad2 Mon Sep 17 00:00:00 2001 From: Blayne Chard Date: Mon, 20 Nov 2023 15:37:19 +1300 Subject: [PATCH] docs: operator quick start config guide (#3010) #### Motivation Expand the quick start guide to include how to bundle configuration #### Modification - Applies prettier to all of /docs - adds quick start guide for bundling config #### Checklist _If not applicable, provide explanation of why._ - [ ] Tests updated - [ ] Docs updated - [ ] Issue linked in Title --- docs/examples/index.leaflet.xyz.3857.html | 65 ++- .../examples/index.maplibre.opacity.3857.html | 377 +++++++++--------- docs/examples/index.maplibre.vector.3857.html | 64 +-- docs/examples/leaflet.xyz.3857.md | 2 +- docs/examples/maplibre.opacity.3857.md | 2 +- docs/examples/maplibre.vector.3857.md | 2 +- docs/operator-guide/quick-start.md | 48 +++ 7 files changed, 304 insertions(+), 256 deletions(-) diff --git a/docs/examples/index.leaflet.xyz.3857.html b/docs/examples/index.leaflet.xyz.3857.html index b87dfeb84..a75642ac6 100644 --- a/docs/examples/index.leaflet.xyz.3857.html +++ b/docs/examples/index.leaflet.xyz.3857.html @@ -1,39 +1,38 @@ + + + Leaflet WGS84 Basemaps Demo + + + + - - - Leaflet WGS84 Basemaps Demo - - - - + +
+ - - - \ No newline at end of file + L.map('map').addLayer(tiles).setView(startPos, startZoom); + + + diff --git a/docs/examples/index.maplibre.opacity.3857.html b/docs/examples/index.maplibre.opacity.3857.html index a6f2b0c2c..155d959ae 100644 --- a/docs/examples/index.maplibre.opacity.3857.html +++ b/docs/examples/index.maplibre.opacity.3857.html @@ -1,214 +1,215 @@ - - + Adjust a layer's opacity - - + + - + - +
-
- - -
+
+ + +
- + // When one map moves, we turn off the movement listeners + // on all the maps, move it, then turn the listeners on again + function sync(master, clones) { + off(); + moveToMapPosition(master, clones); + on(); + } - \ No newline at end of file + on(); + return function () { + off(); + fns = []; + maps = []; + }; + } + + syncMaps(raster, vector); + + + diff --git a/docs/examples/index.maplibre.vector.3857.html b/docs/examples/index.maplibre.vector.3857.html index 4d8f5dbf7..14f7c2c6a 100644 --- a/docs/examples/index.maplibre.vector.3857.html +++ b/docs/examples/index.maplibre.vector.3857.html @@ -1,45 +1,45 @@ - - + Maplibre WGS84 Topographic Vector Basemaps Demo - - + + - + - +
- - - \ No newline at end of file + + diff --git a/docs/examples/leaflet.xyz.3857.md b/docs/examples/leaflet.xyz.3857.md index c85f48921..2d4c09569 100644 --- a/docs/examples/leaflet.xyz.3857.md +++ b/docs/examples/leaflet.xyz.3857.md @@ -6,4 +6,4 @@ Use leaflet render raster map ```html --8<-- "examples/index.leaflet.xyz.3857.html" -``` \ No newline at end of file +``` diff --git a/docs/examples/maplibre.opacity.3857.md b/docs/examples/maplibre.opacity.3857.md index e88a9ca9e..463dfc3d9 100644 --- a/docs/examples/maplibre.opacity.3857.md +++ b/docs/examples/maplibre.opacity.3857.md @@ -6,4 +6,4 @@ Use Maplibre adjust opacity of the map ```html --8<-- "examples/index.maplibre.opacity.3857.html" -``` \ No newline at end of file +``` diff --git a/docs/examples/maplibre.vector.3857.md b/docs/examples/maplibre.vector.3857.md index e64a97448..f84eaa9f1 100644 --- a/docs/examples/maplibre.vector.3857.md +++ b/docs/examples/maplibre.vector.3857.md @@ -6,4 +6,4 @@ Use Maplibre to load vector tiles ```html --8<-- "examples/index.maplibre.vector.3857.html" -``` \ No newline at end of file +``` diff --git a/docs/operator-guide/quick-start.md b/docs/operator-guide/quick-start.md index 75bf7a88e..f98477bbd 100644 --- a/docs/operator-guide/quick-start.md +++ b/docs/operator-guide/quick-start.md @@ -104,3 +104,51 @@ It is not recommended to run `:latest` for any prolonged period of time, all of - `:vX.Y.Z` - Specific release tag which does not move eg `:v0.0.0` - `:vX.Y` - Moving tag for the latest major.minor release eg `:v7.0` - `:vX` - Moving tag for the latest major release eg `:v7` + +### Creating a configuration from the tiff files + +Using the [basemaps CLI](https://github.com/linz/basemaps/tree/master/packages/cli#usage----bundle) a configuration bundle can be generated. + +A [tileset](../configuration.md) needs to be created as the entry point for the configuration. + +Below is a configuration for the two example layers, where the rural imagery sets underneath the urban imagery, and the urban imagery is only turned on when the zoom is greater than z15. + +storing this JSON into `config/aerial.json` + +```json +{ + "type": "raster", + "id": "ts_basic", + "title": "Basic Imagery Basemap", + "layers": [ + { + // Source location for EPSG:2193 Imagery, has to be absolute + "2193": "/home/user/basemaps-quick-start/imagery/otago_2017-2019_0.3m/", + // url/slug friendly name of the imagery set + "name": "otago_2017-2019_0.3m", + "title": "Otago 0.3m Rural Aerial Photos (2017-2019)" // from collection.json#title + }, + { + "2193": "/home/user/basemaps-quick-start/imagery/queenstown-lakes_2022-2023_0.1m/", + "name": "queenstown-lakes_2022-2023_0.1m", + "title": "Queenstown Lakes 0.1m Urban Aerial Photos (2022-2023)", + // Limit the imagery to greater than z15 + "minZoom": 15 + } + ] +} +``` + +Then using the basemaps CLI a config can be bundled, assuming $PWD is the same folder that contains `imagery/` and `config/` + +```bash +docker run --rm -v $PWD:$PWD -it ghcr.io/linz/basemaps/cli:latest bundle --config $PWD/config/ --output $PWD/ +``` + +This generates a `config.json` which has all the information needed to start the server + +```bash +docker run --rm -v $PWD:$PWD -p 5000:5000 ghcr.io/linz/basemaps/server:latest --config $PWD/config.json +``` + +For more advanced usage of configuration files please take a look at [linz/basemaps-config](https://github.com/linz/basemaps-config)