-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Provide a useful default style #1669
Conversation
I agree this makes sense, and will lead to less confusion |
The following comment uses stroke styles as an example, but it equally applies to fill styles, text styles, and the various combinations of the presence or otherwise of each type of style. With no default stroke style, there are two states.
With a default stroke style, there are three states:
In an early prototype version, we used an |
Understood. That would be an issue if we were trying to provide default symbolizers. I was talking about providing a default style function. See my |
OK, that makes sense. But why you no use |
🤘 |
Clearly a subjective thing, but I think this is a suitable default style (this is the GeoJSON example without all the style cruft). I'm inclined to clean up our examples to be more single purpose. For example, the GeoJSON example would use the default style (and wouldn't use Comments? |
+1 from me. The GeoJSON example started as a test bed for all the different geometry types in GeoJSON, but as evolved into a base example where different geometry types are needed for demonstration/testing (e.g. the modify features example is based on it). So, there's a lot of cruft in there that can - as you say - be removed. |
+1 from me as well. |
I'd be interested to see what this looks like on a satellite type of base map but +1 from me as well |
👍 |
It looks pretty close to the existing vector layer example. We can continue tweaking this style - not critical to have it perfect right now, more important to have a place where the default is specified. In particular, I think we might want to have wider strokes for line geometries (and narrower for polygon), but this can be changed later. |
Provide a useful default style.
Currently, the
ol.feature.defaultFeatureStyleFunction
results in nothing being rendered. I think we'll end up with fewer confused users if we either require astyleFunction
to be provided, or provide a useful default.