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

Document pathOptions for GeoJSON #785

Merged
merged 1 commit into from
Nov 20, 2020
Merged

Document pathOptions for GeoJSON #785

merged 1 commit into from
Nov 20, 2020

Conversation

bb
Copy link
Contributor

@bb bb commented Nov 13, 2020

This adds documentation for the GeoJSON showing that it has pathOptions prop, same as Rectangle et al.

It's marked Mutable like for the other Components and changing it is actually delegated to the leaflet object, however it does not work as it needs resetStyle() to be called.

Setting a different color or weight via pathOptions on a <Rectangle.../> did neither work for me, so I wonder if it's a bug or if is intended but the documentation is misleading.

Edit: Nevermind the update issues. It's updating. I was setting only the sub-property not the whole pathOptions. My problem can be reproduced with the third case within in https://codesandbox.io/s/xenodochial-proskuriakova-pytgj?file=/src/Map.js:8695-8722 and is most likely intentional functionality.

@PaulLeCam PaulLeCam merged commit 6304149 into PaulLeCam:master Nov 20, 2020
@PaulLeCam
Copy link
Owner

Thanks for the PR!
Yes props are compared by reference so if you want to mutate fields in an object, you need to provide a new object.

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 this pull request may close these issues.

None yet

2 participants