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

Drawn object not always correctly shown with share map #20

Open
johnnyblasta opened this issue Oct 2, 2020 · 2 comments · May be fixed by #42
Open

Drawn object not always correctly shown with share map #20

johnnyblasta opened this issue Oct 2, 2020 · 2 comments · May be fixed by #42

Comments

@johnnyblasta
Copy link
Contributor

When sharing a map with drawn objects that has style altered with new style tool the result isn't always set as original.
Observed errors includes but propbably not limited to wrong colors. Also observed is wrong point symbol.

Original drawn (In Chrome browser):
image

Share map (In Firefox browser):
image

@johnnyblasta
Copy link
Contributor Author

Did a test with a polygon and a linestring with different colors on the stroke and the share map didn't show same colors as the drawn map.
I checked the GeoJSON that was created for share map and saw that only the polygon had style properties the linestring had a null value in properties.
To be sure that all the features have the correct styling, the style properties must be set for all features otherwise you'll get this random behaviour.

@johnnyblasta
Copy link
Contributor Author

Did a test with a polygon and a linestring with different colors on the stroke and the share map didn't show same colors as the drawn map.
I checked the GeoJSON that was created for share map and saw that only the polygon had style properties the linestring had a null value in properties.
To be sure that all the features have the correct styling, the style properties must be set for all features otherwise you'll get this random behaviour.

Since the method uses ol.format.GeoJSON.writeFeatures is it a bug in OpenLayers or are it supposed to be that way?
Perhaps I'll do my own writeFeatures to get all the styling included.

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

Successfully merging a pull request may close this issue.

1 participant