-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix bug causing queryRenderedFeatures to crash on polygon features that have an id
field.
#4494
Comments
@gmaclennan I'm seeing "Uncaught ReferenceError: dataIndex is not defined" when loading that JSFiddle, which seems to be preventing it from getting to the subsequent error. Can you take a look? |
@jfirebaugh thanks for following up, my apologies, I forgot to save changes as I was removing unrelated code. try here: https://jsfiddle.net/p78o8exf/3/ |
Here is the data source: https://github.com/digidem/alianza-ceibo-maps/blob/gh-pages/data.json |
One more piece of information: I tried filtering the geojson to only show features with |
Maybe the array properties? https://www.mapbox.com/vector-tiles/specification/#how-to-encode-attributes-that-arent-strings-or-numbers |
Can you reduce the test case further, e.g. remove everything that's not essential to triggering the bug from the GeoJSON? |
Ok, more pairing down done now, and I found the cause of the bug: |
@gmaclennan thanks for isolating it! Looks like the problem is that the This is being tracked at #2716, although the test case here demonstrates that (polygon) layers manifest the bug more severely -- crashing rather than simply stripping out the id. Closing in favor of 2716 |
Unimplemented type
error with GeoJSON source from >v0.32.1id
field.
Reopening here to track the crashing bug, which @gmaclennan rightly pointed out is distinct from #2716, which is an enhancement. |
mapbox-gl-js version: v0.34.0
Steps to Trigger Behavior
map.queryRenderedFeatures()
onmousemove
Expected Behavior
map.queryRenderedFeatures()
should return an array of features under the mouse pointerActual Behavior
Uncaught Error: Unimplemented type: 7
I have created a JSFiddle of the failing code: https://jsfiddle.net/p78o8exf/6/
This code works fine with v0.32.1 but since v0.33 it is broken. This is valid GeoJSON (checked with
@mapbox/geojsonhint
).The text was updated successfully, but these errors were encountered: