Skip to content
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

L.maplibreGL options is missing style #40

Open
zdila opened this issue Nov 27, 2022 · 6 comments
Open

L.maplibreGL options is missing style #40

zdila opened this issue Nov 27, 2022 · 6 comments

Comments

@zdila
Copy link

zdila commented Nov 27, 2022

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>'
})
@lseelenbinder
Copy link
Member

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?

@zdila
Copy link
Author

zdila commented Nov 28, 2022

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

@ma7moudat
Copy link
Contributor

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

@simpleman383
Copy link

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

What was wrong with the aliases? (#43)
It seems to work perfectly...

andreandersson added a commit to andreandersson/maplibre-gl-leaflet that referenced this issue May 21, 2024
In some cases the types for Map and MapOptions might be
selected from leaflet instead of maplibre-gl. This solves it by
mapping the name of those types to something else so they
can't be overriden by leaflet.

Solves maplibre#40
@andreandersson
Copy link
Contributor

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

lseelenbinder pushed a commit that referenced this issue Jun 6, 2024
In some cases the types for Map and MapOptions might be
selected from leaflet instead of maplibre-gl. This solves it by
mapping the name of those types to something else so they
can't be overriden by leaflet.

Solves #40
@andreandersson
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants