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
Error when calling Path.setStyle before added to the map. Reopen #6516 #6662
Comments
Hi @NielsHolt |
Steps to reproduce
Expected behavior Current behavior Environment
Additional context
Replace with
Minimal example reproducing the issue Please create an example using https://leafletjs.com/edit.html or any other jsfiddle-like site.
|
@NielsHolt Please make a pull request with the proposed fix, it's easier to review & merge. |
Hi @IvanSanchez |
This is a copy of commit #19b0fb3cac7f6fbdae6c15a02dee9da824f1112b
The original description does not seem to be correct:
The described error only occurs with the following order:
No error occurs the other way around: when |
Unable to reproduce. |
* Fix issue #6662 and #6664 * Add unit test for Path weight set error * Simplify Polyline weight set test case * Alternative fix for setting weight after empty Polyline is added to the map * Add unit test for setting weight after empty Polygon is added to the map * Return when empty Polyline is being rendered * More general formulation for test * Minor refactoring to make tests more uniform Co-authored-by: fodor0205 <fodor0205@gmail.com> Co-authored-by: johndoe <johnd0e@mail.ua>
Hi
Update L.Polyline's _pxBounds when their stroke weight changes was changed in #6516
In version 1.5 Path.setStyle now calls this._updateBounds() if stroke is set in options
But it fails it setStyle is called before the path is added to the map
this._updateBounds using _rawPxBounds witch isn't set before _project is called
I think that the fix is to call this._project() instead of this._updateBounds() in setStyle
The text was updated successfully, but these errors were encountered: