Skip to content

Conversation

ericmmartinez
Copy link
Contributor

Previous code resulted in errors.

First, by setting this.options.position before removing the control from the map, the map was looking in the wrong control container for the control to be removed.

Second, during the call to removeControl, this._map is unset so the subsequent call to addControl would always fail since this._map is undefined.

The proposed may not be perfect but it at least works.

mourner added a commit that referenced this pull request May 3, 2012
Patch for L.Control#setPosition
@mourner mourner merged commit 0bd0c1a into Leaflet:master May 3, 2012
@mourner
Copy link
Member

mourner commented May 3, 2012

Thanks!

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.

3 participants