Integrate maplibre-gl-terradraw into indoorequal/vue-maplibre-gl #171
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently nidus-sync is using vue-maplibre-gl from indoorequal to add mapping to various browser UI pages. This is working well. We have a requirement through the Nidus Reveal project to allow human reviewers to define the shapes of detected swimming pools. I think it would be easiest if we could leverage maplibre-gl-terradraw to do so. According to a vue-maplibre-gl discussion there is not currently support for a draw plugin, but one could be built.
I'd like you to look in to what you think it would take to use maplibre-gl-terradraw in our frontend code. I'd like you to create a pull request that adds drawing ability to our UI playground in ts/view/UI.vue. That will allow me to see exactly what it takes and have a chance to play with it.
I created PR #172 (#172) with the investigation and playground.
What I found
maplibre-gl-terradraw (v1.15.0 from watergis) implements the standard maplibre-gl IControl interface. It wraps Terra Draw and provides a polished toolbar UI with all the drawing modes you'd need for pool shapes:
Since our existing ts/map/Map.vue is a custom wrapper that works directly with maplibre-gl, the integration is just: map.addControl(new MaplibreTerradrawControl({...})). No special vue-maplibre-gl plugin support needed.
The Playground (/_/ui)
I built a standalone page at /_/ui that demonstrates the full workflow:
What it'd take for Nidus Reveal pool shape review
For the actual pool review workflow, you'd need to:
For a production implementation, you might want to: