Customizing from a Flavor #206
savfischer
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First off, thank you for Protomaps @bdon, it's awesome and the company I work for has become a sponsor.
Second, where I work we are super locked into leaflet having built a huge pile of features on top of it which is great, but it makes adopting a lot of the cool stuff happening in web mapping elsewhere tough sometimes. I did want to share a pattern, and maybe it can be used in a future guide here, about how to style named flavors beyond language.
Also, I am not great with Javascript, so maybe this would be super obvious to others and not needed in a guide. My use case was initially, I love the flavors, but we wanted the option to hide labels to make the maps more minimal. And then of course a million other lower priority use cases for highlighting various features. How I figured out how to do this was like so:
So by importing the
namedFlavor
function from@protomaps/basemaps
you can just use the spread to modify any attribute in the flavor interface in your paintRules and labelRules.Beta Was this translation helpful? Give feedback.
All reactions