maplibre-gl-leaflet icon indicating copy to clipboard operation
maplibre-gl-leaflet copied to clipboard

L.maplibreGL options is missing `style`

Open zdila opened this issue 2 years ago • 6 comments
trafficstars

After updating from 0.0.17 to 0.0.18 the example in README won't compile with typescript because style property is missing in the type.

L.maplibreGL({
	style: 'https://api.maptiler.com/maps/topo/style.json?key=<YOUR_MAPTILER_API_KEY>'
})

zdila avatar Nov 27 '22 09:11 zdila

Thanks for reporting, @zdila. I'm a bit confused why, since the style property exists in the upstream type being used. Can you share what your maplibre-gl-js version is?

lseelenbinder avatar Nov 28 '22 00:11 lseelenbinder

Version of maplibre-gl I use is 2.4.0, Leaflet 1.9.3, TypeScript 4.7.4

For some reason typescript uses Map and MapOptions from @types/leaflet/index.d.ts and not from maplibre-gl/dist/maplibre-gl.d.ts.

image

zdila avatar Nov 28 '22 09:11 zdila

I have this problem as well. I suppressed it with // @ts-ignore for the time being, but it should resolved.

ma7moudat avatar Nov 28 '22 11:11 ma7moudat

Hey guys! Any updates? The problem still persists and it's quite annoying 😅

What was wrong with the aliases? (https://github.com/maplibre/maplibre-gl-leaflet/pull/43) It seems to work perfectly...

simpleman383 avatar Nov 23 '23 12:11 simpleman383

I made the smallest possible fix for this issue in the open PR. Please review :)

andreandersson avatar May 29 '24 09:05 andreandersson

I can confirm that this has been resolved in 0.0.21 for us.

andreandersson avatar Jun 10 '24 05:06 andreandersson