mapbox-gl-js
mapbox-gl-js copied to clipboard
Regression in Popup:normalizeOffset()
While migrating from Mapbox v1 to v3 I stumbled over this regression that throws a reference error in the following line:
https://github.com/mapbox/mapbox-gl-js/blob/87938fb284bf9f2c4b1bbbc7baaad074438ae014/src/ui/popup.ts#L723
The regression was introduced in https://github.com/mapbox/mapbox-gl-js/commit/69a888cf303c6b683a7c920eac64e6d4862b9871 by removing this line and setting the default directly in the function parameter:
if (!offset) offset = (new Point(0, 0));
When calling the function with offset = null it throws, where it used to gracefully return the default offset.
Thanks for reporting