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

[Openlayers3] JS error with Circle style #611

Open
VaclavC opened this issue Sep 10, 2017 · 1 comment
Open

[Openlayers3] JS error with Circle style #611

VaclavC opened this issue Sep 10, 2017 · 1 comment
Assignees

Comments

@VaclavC
Copy link
Contributor

VaclavC commented Sep 10, 2017

If I try to use Circle style for Feature display, I get

AssertionError: Assertion failed: obj geometry must be an ol.style.Style instance

in JS console. Perhaps styles should be written to JS code as ol.style.Style instance in all cases, regardless to their true type?

@cmiles74
Copy link
Contributor

The OpenLayers API is confusing on this point. The ol.style.Style object contains a set of five styles (geometry, fill, image, stroke, etc.) and each one of those is of a specific style type (ol.geom.Geometry, ol.style.Fill, ol.style.Image, etc.)

Looking at the code, I think that this could be modeled better. Right now we Circle extends Style and emits JS to match and that is clearly incorrect; it's more like Fill or Image in that it's a component of an ol.style.Style instance, in is not one itself. In the OL3 API, they use ol.geom.Geometry...

I'll try to think of a solution that makes the most sense. If we have Circle look like an ol.Style.Style instance, we'll be losing other attributes like fill, stroke, etc. and there won't be enough data to draw the style on screen.

@cmiles74 cmiles74 self-assigned this Sep 10, 2017
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

2 participants