Mapbox-gl-js: Popup breaks in v1.1.1

Created on 23 Jul 2019  Â·  2Comments  Â·  Source: mapbox/mapbox-gl-js

Hi,
Migrating my code to mapbox-gl v1.1.1 have broken something with the Popup. I use dynamic calls to setLngLat to make it show up after it is first created and added to the map. When I make such a call prior to any move (pan/zoom) on the map, an error occurs and the popup do not show up.

mapbox-gl-js version: 1.1.1

browser: all

Steps to Trigger Behavior

  1. Create a map and add a popup to it
  2. Dynamically display the popup by calling setLngLat later on

Link to Demonstration

https://codepen.io/anon/pen/jgWQYz

In this example we create a map, add a popup to it, then bind mouse over on the map to trigger the positioning of the popup. It is just a dummy way to show the popup for the purpose of this demo. Any other way to dynamically call setLngLat seems to give similar results.

Expected Behavior

The popup should show up.

Actual Behavior

Prior to any move (pan/zoom) on the map, the popup won't show up and the following error will be reported: TypeError: undefined is not an object (evaluating 'this._container.classList')

bug

All 2 comments

The regression likely got introduced in #7786 — @peterqliu want to take a look?

🚢

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamdenny picture iamdenny  Â·  3Comments

stevage picture stevage  Â·  3Comments

foundryspatial-duncan picture foundryspatial-duncan  Â·  3Comments

Scarysize picture Scarysize  Â·  3Comments

PBrockmann picture PBrockmann  Â·  3Comments