-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[iOS] crash updating polyline source shape #10924
Comments
line 1370 from MFMapView is doing:
|
@boundsj We'd appreciate some help here as it is a bug that happens often on production (3% crash rate...), but we are not able to reproduce it manually. Thanks for any advice or clue! |
Hi @RomainQuidet - |
Hi, |
What information do you need? |
Hi @RomainQuidet - Do you add the source to the new style? If you do not, the workarounds that are suggested in #8882 may be helpful:
Otherwise, a minimal test case that reproduces this issue would be great! |
Hi, |
Hi @RomainQuidet - It looks like you may be seeing #8882. Would you be able to share the code that handles layers and sources either here or with our support team? |
Hi, We create polylines features, and store them in an array in order to reuse them in case of style change MGLPolylineFeature *polylineFeature = [MGLPolylineFeature polylineWithCoordinates:polyline.coordinates count:polyline.pointCount];
NSString *polylineId = [self polylineIdentifier:polyline];
polylineFeature.attributes = [NSDictionary dictionaryWithObject:polylineId forKey:kMappyPolylinesIdentifier];
[self.polylinesFeatures addObject:polylineFeature]; Then we add a layer to our style NSString *layerId = [NSString stringWithFormat:@"%@-%@", kMappyPolylineLayerPrefixIdentifier, polylineId];
MGLLineStyleLayer *layer = [[MGLLineStyleLayer alloc] initWithIdentifier:layerId source:polylinesSource];
[self.actualMapView.style addLayer:layer]; and we update the source shape MGLShapeCollectionFeature *shapesFeatures = [MGLShapeCollectionFeature shapeCollectionWithShapes:self.polylinesFeatures];
polylinesSource.shape = shapesFeatures; The crash occures when we update the source shape. |
Hey @RomainQuidet - Could you confirm where you are calling the code in the above comment? Also, are you recreating the source and layer in Another option may be to use the source identifier to access the source from the style directly (rather than storing it as a class property). You can do this by using |
We made a try and used the api |
Platform: iOS
Mapbox SDK version: 3.6
Steps to trigger behavior
Expected behavior
Polylines are displayed
Actual behavior
Crash.
Help needed to understand where it does come from.
Is it linked to issue #8882 ?
Incident Identifier: 10711CE0-17E6-49CB-8823-EE07E1419A25
CrashReporter Key: 0091987D-EA79-4CCB-ABD0-F93F29734434
Hardware Model: iPhone9,3
Process: Mappy [536]
Path: /var/containers/Bundle/Application/D304BB50-7DA6-4D06-AB56-046F35B7E1DA/Mappy.app/Mappy
Identifier: com.mappy.Mappy
Version: 6.1802.0 (6.1802.0.12)
Code Type: ARM-64
Parent Process: ??? [1]
Date/Time: 2018-01-11T19:22:43Z
Launch Time: 2018-01-11T19:18:05Z
OS Version: iPhone OS 11.2.2 (15C202)
Report Version: 104
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0x78
Crashed Thread: 0
Thread 0 Crashed:
0 Mappy 0x0000000105a8e848 mbgl::style::GeoJSONSource::Impl::setGeoJSON(mapbox::util::variant<mapbox::geometry::geometry, mapbox::geometry::feature, mapbox::geometry::feature_collection<double, std::__1::vector> > const&) + 20
1 Mappy 0x0000000105a8e584 mbgl::style::GeoJSONSource::setGeoJSON(mapbox::util::variant<mapbox::geometry::geometry, mapbox::geometry::feature, mapbox::geometry::feature_collection<double, std::__1::vector> > const&) + 20
2 Mappy 0x000000010589d56c MGLGeoJSONOptionsFromDictionary(NSDictionary<NSString*, objc_object*>*) + 3396
3 Mappy 0x0000000105852a38 -[MFMapView addPolylineLayersFrom:] (MFMapView.m:1370)
The text was updated successfully, but these errors were encountered: