-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some of Popup methods don't work because of this._container being undefined #9429
Comments
This was caused by those methods trying to access the popup's container element before it's created. I added checks so that the errors won't throw if the container is |
Thank you for quick response :) |
No problem! This will be in release 1.9.0 which will be published today or tomorrow |
Would it be possible to have the container created in the constructor so that these methods do something before If my suggestion is not possible, perhaps instead of throwing error you could use a warning message. |
Some of Popup class methods doesn't work as expected:
That's how I'm initializing popup:
let popup = new mapboxgl.Popup().setText("Hello World");
And this is a code that fails:
popup.addClassName('my-class');
but it works when in the first place I add a popup to map using 'addTo()' and set coordinates using 'setLngLat()' method. In any other case methods mentioned in the list above throw this error:
mapbox GL JS version: https://api.mapbox.com/mapbox-gl-js/v1.8.1/mapbox-gl.js
It happens on every browser.
The text was updated successfully, but these errors were encountered: