73 lines
1.9 KiB
Markdown
73 lines
1.9 KiB
Markdown
# XPro Map Visualizer
|
|
|
|
Tiny static WMS viewer for the GeoServer endpoint at `https://xpro-viz.jfig.net/geoserver/xpro/wms`.
|
|
|
|
## Run locally
|
|
|
|
Start the included Node server:
|
|
|
|
```bash
|
|
npm install
|
|
npm start
|
|
```
|
|
|
|
Then open `http://localhost:4173`.
|
|
|
|
## Run with Docker
|
|
|
|
Using Docker Compose:
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
# Edit .env and set GEOSERVER_PASSWORD.
|
|
docker compose up --build
|
|
```
|
|
|
|
Then open `http://localhost:4173`.
|
|
|
|
Build the image:
|
|
|
|
```bash
|
|
docker build -t xprov-map-visualizer .
|
|
```
|
|
|
|
Run the container:
|
|
|
|
```bash
|
|
docker run --rm -p 4173:4173 xprov-map-visualizer
|
|
```
|
|
|
|
Then open `http://localhost:4173`.
|
|
|
|
The browser never receives the GeoServer password. Configure it in `.env` for
|
|
the backend proxy:
|
|
|
|
```bash
|
|
GEOSERVER_USERNAME=admin
|
|
GEOSERVER_PASSWORD=change-me
|
|
```
|
|
|
|
To change the default WMS endpoint or allow additional WMS endpoints through
|
|
the proxy, edit `.env`:
|
|
|
|
```bash
|
|
WMS_ENDPOINT=https://xpro-viz.jfig.net/geoserver/xpro/wms
|
|
ALLOWED_WMS_ENDPOINTS=https://xpro-viz.jfig.net/geoserver/xpro/wms,https://example.com/geoserver/wms
|
|
```
|
|
|
|
## Notes
|
|
|
|
- The app does not store the password in the repo, local storage, or the browser.
|
|
- The included server proxies WMS requests so the browser does not run into cross-origin auth issues.
|
|
- The proxy only allows configured WMS endpoints. By default it allows the XPro GeoServer endpoint.
|
|
- It fetches WMS capabilities with backend HTTP Basic Auth and loads all discovered layers on top of OpenStreetMap.
|
|
- The currently published layers discovered during setup were `parcelas` and `predios`.
|
|
|
|
## Sharing a map view
|
|
|
|
The URL updates as the map is moved, zoomed, rotated, or its visible layers or
|
|
base map are changed. An open parcel or building information dialog is included
|
|
too. Copy the URL to share that exact state; opening it restores the same map
|
|
view and selected feature. Invalid or incomplete map parameters fall back to
|
|
the normal default view.
|