astrosat / windgl

A WebGL wind particle simulation as a Mapbox custom layer
https://astrosat.github.io/windgl/
ISC License
170 stars 45 forks source link

Layer not visible on Map #23

Open pandeyshashank opened 4 years ago

pandeyshashank commented 4 years ago

Added the sampleFill and particles layer on map. But it's not showing on the map. However I am able to get the layer with map.getLayer but not on map.

Screen Shot 2019-09-17 at 1 29 27 PM
pandeyshashank commented 4 years ago

used the same data that is used in the demo

owl1n commented 4 years ago

Did u fix it?

scottbasgaard commented 4 years ago

Same issue:

const onMapLoad = (e) => {
    const { target: map } = e;

    map.addLayer(particles({
      id: 'particles',
      source: windSource,
    }));
  };

  return (
    <div className="map-container">
      <DeckGL
        ref={deckRef}
        layers={renderLayers()}
        effects={[lightingEffect]}
        initialViewState={viewport}
        controller
        onWebGLInitialized={onWebGLInitialized}
      >
        {_glState && (
          <StaticMap
            onLoad={e => onMapLoad}
            mapStyle={MAPBOX_STYLE}
            mapboxApiAccessToken={MAPBOX_TOKEN}
          />
        )}
        <Icon menus updateMenus={updateMenus} />
      </DeckGL>
    </div>
  );