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

map.querySourceFeatures on GeoJSON source throws TypeError if sourceLayer is missing #4783

Closed
noenandre opened this issue Jun 3, 2017 · 0 comments · Fixed by #4803
Closed

Comments

@noenandre
Copy link

mapbox-gl-js version: 0.37

According to the documentation parameters.sourceLayer is required on a vector tile source, an ignored on a geojson source.

However if you omits the sourceLayer parameter on a geojson source map.querySourceFeatures throws:
Uncaught TypeError: Cannot read property 'sourceLayer' of undefined

If i add a empty sourceLayer parameter like this:
map.querySourceFeatures("geojson_source_id", {sourceLayer: ''});
everything works as expected.

Se example here https://jsbin.com/jujuyiciro/1/edit?html,output

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

Successfully merging a pull request may close this issue.

2 participants