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

Unknown interpolation type zoom #33

Open
FreeGIS opened this issue Nov 25, 2019 · 4 comments
Open

Unknown interpolation type zoom #33

FreeGIS opened this issue Nov 25, 2019 · 4 comments

Comments

@FreeGIS
Copy link

FreeGIS commented Nov 25, 2019

`import 'mapbox-gl/dist/mapbox-gl.css';
var mapboxgl = require('mapbox-gl');
import {sampleFill, particles, source} from '@astrosat/windgl';

mapboxgl.accessToken = 'xxxxxxxx';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/dark-v10'
});

map.on("load", () => {
const windSource = source("http://localhost:8080/windgl/wind/2019031012/tile.json");
map.addLayer(particles({
id: 'particles',
source: windSource, // best to share the same source between all layers
'particle-speed': ['interpolate', ['zoom'], 0, 0.5, 10, 0.8]
}));
});`

err:
windgl.umd.js:14097 Uncaught Error: Error: Unknown interpolation type zoom

@FreeGIS
Copy link
Author

FreeGIS commented Nov 25, 2019

I changed the code from
['interpolate', ['zoom'], 0, 0.5, 10, 0.8] to ['interpolate', ['linear'],['zoom'], 0, 0.5, 10, 0.8] ,the error was
disappeared,but no any results:
image

@owl1n
Copy link

owl1n commented Dec 21, 2019

Did u fix it?

@owl1n
Copy link

owl1n commented Dec 21, 2019

@gampleman can u help? How i can fix same error with no data on map?

@Robert-OP
Copy link

Hi @FreeGIS and @owl1n - I managed to run the code by using this:

mapbox.addLayer(
          particles({
            id: 'particles',
            source: windSource,
            'particle-color': [
              'interpolate',
              ['linear'],
              ['get', 'speed'],
              0.0,
              '#3288bd',
              10,
              '#66c2a5',
              20,
              '#abdda4',
              30,
              '#e6f598',
              40,
              '#fee08b',
              50,
              '#fdae61',
              60,
              '#f46d43',
              100.0,
              '#d53e4f',
            ],
            'particle-speed': [
              'interpolate',
              ['linear'],
              ['zoom'],
              0,
              0.5,
              10,
              0.8,
            ],
          })
        );

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

No branches or pull requests

3 participants