Skip to content
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

More flexible styling #3

Open
joto opened this issue Oct 18, 2018 · 3 comments
Open

More flexible styling #3

joto opened this issue Oct 18, 2018 · 3 comments

Comments

@joto
Copy link
Collaborator

joto commented Oct 18, 2018

Currently all layers use the same hardcoded styling with red dots/lines. It would be nice if layers could (within reason) set or, at least, "suggest" some styling. This would allow more natural styling (blue lines for waterways in some layer or similar) and it is needed when we want to show multiple layers at once.

We have also to consider the "hilight style" used when a feature is selected.

@hbruch
Copy link
Contributor

hbruch commented Jan 3, 2019

Are you already working on this? The examples layers seem to include some style infos.

@joto
Copy link
Collaborator Author

joto commented Jan 3, 2019

Those were just dummies I wrote down when thinking about this. I don't have a clear idea how to approach this yet. I want something that has good defaults so it works in 90% of the cases out of the box and then maybe a few options (like color) for the next 9% and the 1% left over we just can't do and you have to write a special tool for that.

Also this is very much tied to the question of how to show multiple layers at the same time. It is something I would like to have but I do see the problems involved, mostly the complexity in the UI and the rendering. If you have a finite set of layers, you can style them all in a way that they will fit together, but with an open ended set of layers, we might need a different approach (like giving random colors to layers when they are switched on, possibly allowing users to change them).

Currently I see these cases:

  • Sometimes we want to show two different things in a single layer, all objects of type foo as a kind of background in grey and all broken objects of type foo in red. Or something like it.
  • We might have a group of layers that are created together and are supposed to work together. You usually want to see all of them, but can enable and disable any of them. This is more like the how OSMI works.
  • You have a bunch of layers from many sources and want to randomly mix and match.

Ideas welcome!

@pathmapper
Copy link

for the next 9% and the 1% left over

What about an optional style_url for the layer JSON file which points to a MB Style Object?

This could be used with ol-mapbox-style for advanced styling (and replaces the defaults).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants