Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR branches off of the 'initial-features' PR I also made here #9
I needed a way to change the options for new shapes that are drawn (specifically, I needed to change the colour). This is a first attempt at getting the 'draw' arg to be observed so that new shapeOptions can be applied, using the leaflet-draw method
setDrawingOptions
. Seems to work, I have only tested changing the colour though.I also included a commented out section in
_drawChanged()
which will also apply the new draw shapeOptions to existing objects that were previously drawn. There are some caveats to that code;draw.initial.shapeOptions
applied to it, this is probably not desiredupdateExistingShapes=true
?My leaflet skills aren't the best and I've only been using this addon for a day so please chime in if you know any improvements that can be made (or just go ahead and commit them!)