Skip to content

Map undefined in L.PopUp _updatePosition method when popup closed while viewport change #1094

@fnicollet

Description

@fnicollet

Hi,
I just ran into an issue in my application. It was in IE10 but i don't believe that's related.

I can't really reproduce this issue with a clear example, sorry. I had a pop-up opened and changed the viewport bounds. On viewport change, i also update the markers and in that case, it cleared the markers, including the one that had a pop-up attached.
I think the event handlers just got in a bad order

There is a test on "this._map" already in L.PopUp as in "_update". To prevent the bug from happening, the same test should be added to _updatePosition:

_updatePosition: function () {
    if (!this._map) { return; }
    var pos = this._map.latLngToLayerPoint(this._latlng),

...

Just while the pop-up is being closed, I think that's just bad timing :)

Fabien

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions