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

Feature ClosePath command fails if only command in stream #1276

Closed
nicomgd opened this issue Jun 15, 2015 · 1 comment
Closed

Feature ClosePath command fails if only command in stream #1276

nicomgd opened this issue Jun 15, 2015 · 1 comment

Comments

@nicomgd
Copy link

nicomgd commented Jun 15, 2015

I've been testing mapbox-gl-js with a custom dataset created using Mapbox Studio from a SHP file (world country boundaries, downloaded here in SHP).

While viewing the data, some tiles go missing and a console error appears :
Uncaught TypeError: Cannot read property 'push' of undefined.

The error happens with the current master build and with v0.7.0.

I've traced down the problem to VectorTileFeature.prototype.loadGeometry :

} else if (cmd === 7) {
    line.push(line[0].clone()); // closePolygon
}

This code expects line to be valid, but the data somehow has a feature which only contains a 7 command.

If I add a if (line) before line.push my data appears to be fine.

Is such data invalid ? or should mbgl-js be robust and handle this gracefully ?

@jfirebaugh
Copy link
Contributor

Previously: #1019.

The data is invalid, due to a bug in mapnik-vector-tile that has been fixed, but not made it into a Mapbox Studio release yet. I've published a workaround to the library that gl-js uses and will integrate it into gl-js shortly.

jfirebaugh added a commit that referenced this issue Aug 7, 2015
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

2 participants