ReactMapGl symbol Layer

77 views Asked by At

I'm currently facing an issue with the Layer component of ReactMapGl.

I'm trying to add a Source of type GeoJSON that have a lot of features of type Point (circa 16k) and then displaying them with the Layer component of type symbol with an image that i previously add to the map as following:

 import tabac_shop from 'assets/tabac_shop.png'

 ...

  useEffect(() => {
    mapRef.current?.on('load', () => {
      mapRef.current?.loadImage(tabac_shop, (error, img) => {
        img && mapRef.current?.addImage('tabac', img)
      })
    })
  }, [mapRef])


 ...


  <Source data={poi} type="geojson" id="poiData">
    <Layer
      source={'poiData'}
      type="symbol"
      layout={{
        'icon-image': ['get', 'icon'],
      }}
      />
  </Source>


The issue is that none of the features are displayed on the map neither there are errors in the console

Can someone point me in the right direction?

Thanks!

0

There are 0 answers