-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for viewing local geojson layers #524
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the delay in reviewing this, just a couple of suggestions.
As usual some future features not needed for this PR (mostly just thoughts):
- May be nice to integrate with tooltips and present a table of the properties for a feature, or perhaps selection and provides a table of the properties for the selected features. There could be metadata associated with their geometry that help distinguish items.
map.value?.removeLayer(`local-layer-${id}:fill`); | ||
map.value?.removeLayer(`local-layer-${id}:outline`); | ||
map.value?.removeSource(`local-source-${id}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was something done before my time with the project, but toggling different modelRuns basically rebuilds the entire data passed to the model. That means that switching tabs to the model runs and turning on any model run will make the local geoJSON features disappear. It may be necessary to add some data to the the sources in the main style function:
https://github.com/ResonantGeoData/RD-WATCH/blob/main/vue/src/mapstyle/index.ts#L34
Not the way I would do stuff if starting from the beginning (I'd rather use maplibre's addSource/addLayer) but you probably need to add an additional function here to make sure the localGeoJSONs don't get disabled when running.
:key="layer.id" | ||
:title="`Layer ${layer.id}`" | ||
> | ||
<template #append> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides focusing and deleting it may be nice to toggle layer visibility on/off.
<v-list-item | ||
v-for="layer in localLayers" | ||
:key="layer.id" | ||
:title="`Layer ${layer.id}`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine for a Layer to begin with a Static Id like this when initialized, it may be nice to have an edit field that way a user can upload multiple layers and give them some reasonable name. Just an edit button and allowing the user to rename locally for organizational purposes.
Users can now visualize local geojson files in RD-WATCH.
Screen.Recording.2024-10-22.at.3.19.43.PM.webm
Nice-to-haves and other considerations:
Other changes:
map.fitBounds()
instead of a state variable