digitalfabrik / entitlementcard

App for 'Digitale Berechtigungskarten', generally benefit card for volunteers or socially vulnerable groups in Germany. App for Android & iOS + Backend + Administration Web Portal – 100% Open Source.
MIT License
35 stars 3 forks source link

Set Map Layers dynamically #750

Open maxammann opened 1 year ago

maxammann commented 1 year ago

Is your feature request related to a problem? Please describe. The clusters on the map are right now bavaria blue. We might want to set the particular theme color. Currently the layers are hardcoded in the styles.json and should set dynamically to set the cluster color depending on the projects build configuration (theme color)

Describe the solution you'd like

Describe alternatives you've considered None

Additional context Current hardcoded layer solution styles.json (https://github.com/digitalfabrik/ehrenamtskarte-maplibre-style/blob/22cc66f0a9a361372496fe2f2d29d4fb0ee70fdf/style.json#L1597) Here are some infos how to do it https://github.com/maplibre/flutter-maplibre-gl/blob/6eb27181f2ecfc34a883c74ef681e61f8e3f2fb3/example/lib/layer.dart#L228 This would also enable to customize the cluster colors per project. Additionally we could just pass the categoryId or favoriteIcon as icon-image as we do for integreat

sarahsporck commented 1 year ago

Is there currently a way to pass arguments to the map styles from within the app? Or would this be done by using env variables?

maxammann commented 1 year ago

Hm, I think there are already different styles for the map. One for entitlementcard and one for ehrenamtskarte. If not we can do that I think.

They get deployed and we just have to change the url in the build config.

sarahsporck commented 1 year ago

so we'd need a repo for the nuernberg map-libre-styles? Not sure how to handle this with the git submodules here ^^ I was rather thinking about passing a style to the map (or selecting one) as this one is just about changing the color of the clusters.

f1sh1918 commented 10 months ago

hm not sure how this works here in flutter but you maybe could also provide these cluster layers in the app instead of the style.json as we do in integreat @sarahsporck . That would it make easy to pass the theme colors we want. I think to have fore each new whitelabel project a separate map-libre style repo looks very complicated to me

sarahsporck commented 10 months ago

I agree with you.And this should be fairly easy by just adding some functioanality to the MapStyleHandler.

f1sh1918 commented 5 months ago

@sarahsporck i just checked out how to accomplish this and updated the issue with further information and moved it to "NextUp"