maplibre / maplibre-gl-js

MapLibre GL JS - Interactive vector tile maps in the browser
https://maplibre.org/maplibre-gl-js/docs/
Other
6.42k stars 691 forks source link

type of `_controlPositions` property of the Map class #4649

Open JabSYsEmb opened 1 month ago

JabSYsEmb commented 1 month ago

I just noticed that the vscode intelljsense does not autocomplate for _controlPositions of Map class and found out it is due to that it is defined as Record<string, HTMLElement>, is that intentionally? Or typed incorrectly since _controlPositions cannot be positioned other than what the ControlPosition type is

https://github.com/maplibre/maplibre-gl-js/blob/160b8f9c3feb0c44c7ab233d4cedaac569236e0b/src/ui/map.ts#L448

I fix the type locally and get the nitelljsense working fine as in the following screenshot:

image

HarelM commented 1 month ago

Probably an incorrect type, feel free to open a PR.