am2222 / mapbox-pmtiles

A custom source to add PmTiles support to mapbox gl js. Supports both raster and vector pmtiles
https://am2222.github.io/mapbox-pmtiles/
12 stars 1 forks source link

setFeatureState with pmtiles #18

Closed marcosci closed 3 months ago

marcosci commented 3 months ago

Hey Majid!

Me again. Do you have any idea how to use mapbox.setFeatureState with pmtiles? I am trying to create a hover effect for polygons and I get the following error:

Error: The sourceLayer parameter must be provided for vector source types.

Cheers Marco

marcosci commented 3 months ago

Ah, I figured out the source of this. Somehow generateId or promoteId have no effect on pmtiles sources. Is that something that can be fixed?

I updated our stackblitz:

https://stackblitz.com/~/github.com/marcosci/pmtiles_debug?file=src/routes/%2Bpage.svelte&view=editor

If you look at the console you can see that the feature id is still undefined.

am2222 commented 3 months ago

Hi @marcosci let me debug it a bit! I suspect it should be related to the promoteId declaration

am2222 commented 3 months ago

@marcosci the issue should be fixed in the latest version!