You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maps SDK Version: 11.2.0 (same behavior with 11.1.0)
Observed behavior and steps to reproduce
Create a FillLayer using
// geoJSONSource
var geoJSONSourcePolygons = GeoJSONSource(id: "Airspace")
let path = Bundle.main.path(forResource: "polygons-xa", ofType: "geojson")
let urlGeoJSON = URL(fileURLWithPath: path!)
// Setting the `data` property with a url pointing to a GeoJSON document
geoJSONSourcePolygons.data = .string(urlGeoJSON.relativePath)
// Alternative#1
// Disable clustering for this source
geoJSONSourcePolygons.cluster = false // leads to no crash
// Alternative#2
// Enable clustering for this source
geoJSONSourcePolygons.cluster = true // leads to a crash
The used FillLayer:
var unclusteredLayer = FillLayer(id: "user-polygons-layer", source: geoJSONSourcePolygons.id)
The assigned data:
var featureCollection: FeatureCollection?
do {
let data = try Data(contentsOf: urlGeoJSON)
// Attempt to decode GeoJSON from file bundled with application
featureCollection = try JSONDecoder().decode(FeatureCollection.self, from: data)
} catch {
print("MapBox: GeoJson: failed to add features: (error.localizedDescription)")
}
[Warning, maps-core]: {}[ParseTile]: Missing closing point in polygon feature. The GeoJSON specification requires the first and last points of polygons to be identical. The missing last point was added based on the first one to avoid rendering errors.
The text was updated successfully, but these errors were encountered:
Environment
Observed behavior and steps to reproduce
Create a FillLayer using
Crash in mbgl::style::GeoJSONData::create(std::__1::variant<mapbox::geometry::geometry<double, std::__1::vector>, mapbox::feature::feature, mapbox::feature::feature_collection<double, std::__1::vector>> const&, mbgl::Immutablembgl::style::GeoJSONOptions const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>)
Expected behavior
No crash in Alternative#2
Notes / preliminary analysis
The used FillLayer:
var unclusteredLayer = FillLayer(id: "user-polygons-layer", source: geoJSONSourcePolygons.id)
The assigned data:
var featureCollection: FeatureCollection?
do {
let data = try Data(contentsOf: urlGeoJSON)
// Attempt to decode GeoJSON from file bundled with application
featureCollection = try JSONDecoder().decode(FeatureCollection.self, from: data)
} catch {
print("MapBox: GeoJson: failed to add features: (error.localizedDescription)")
}
Additional links and references
[Warning, maps-core]: {}[ParseTile]: Missing closing point in polygon feature. The GeoJSON specification requires the first and last points of polygons to be identical. The missing last point was added based on the first one to avoid rendering errors.
The text was updated successfully, but these errors were encountered: