Do not share options between Draw.Feature instances #219

Merged
merged 1 commit into from Nov 19, 2013

Conversation

Projects
None yet
3 participants
@yohanboniface
Owner

yohanboniface commented Nov 17, 2013

Extending this.options in place makes the object shared between every instances of L.Draw.Feature.

This change prevents this behaviour.

I don't think this was intentional, and in my understanding of Leaflet conventions, statics are made for being shared, not options.

My use case is to add a measure tool on uMap using Leaflet.draw, while I also use the plugin for classic drawing on the map.

Thanks!

Yohan

@mourner

This comment has been minimized.

Show comment Hide comment
@mourner

mourner Nov 18, 2013

Owner

👍 from me

Owner

mourner commented Nov 18, 2013

👍 from me

@jacobtoye

This comment has been minimized.

Show comment Hide comment
@jacobtoye

jacobtoye Nov 19, 2013

Owner

Nice catch @yohanboniface!

Owner

jacobtoye commented Nov 19, 2013

Nice catch @yohanboniface!

jacobtoye added a commit that referenced this pull request Nov 19, 2013

Merge pull request #219 from yohanboniface/setoptions
Do not share options between Draw.Feature instances

@jacobtoye jacobtoye merged commit 590f096 into Leaflet:master Nov 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment