Post

Replies

Boosts

Views

Activity

MapKit Rendering MKPolygon from geoJson stopped working
I have an app that has a large geoJson file that gets loaded and parsed. The code works in an older build in the AppStore, Xcode 12, but the polygons no longer renders in Xcode 13.2. I isolated the code to a simple one page project and in there the polygon will render sometimes but it is very flakey, extremely slow and sometimes only partially renders. It also seems to cause the map to lock up. I have tested this on the simulator and a real device with the same results. Anyone having the same issue? Is there a limit the number of point the polygon can have? The geoJson file has over 100,00 points. Here is the code in simplified form: let overlays = loadGeoJson() mapView.addOverlays(overlays) func loadGeoJson() -> [MKOverlay] {         var overlays: [MKOverlay] = []         var data: Data = Data()                  if let path = Bundle.main.path(forResource: fileName, ofType: nil) {             do {                data = try Data(contentsOf: URL(fileURLWithPath: path), options: NSData.ReadingOptions.mappedIfSafe)             } catch {                  return overlays             }                                       let decoder = MKGeoJSONDecoder()             do {                 let objects = try decoder.decode(data)                 for object in objects {                     if let feature = object as? MKGeoJSONFeature {                         if let polygon = feature.geometry.first as? MKPolygon {                                 polygon.title = "Title of Polygon"                                 overlays.append(polygon)                         }                     }                 }             } catch (let error) {                 return overlays             }         }         return overlays     } extension MapViewController: MKMapViewDelegate {     func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {         if let polygon = overlay as? MKPolygon {             let renderer = MKPolygonRenderer(polygon: polygon)             renderer.fillColor = .red             renderer.strokeColor = .black             renderer.lineWidth = 1             renderer.alpha = 1.0             return renderer         }         else if let multiPolygon = overlay as? MKMultiPolygon {             let renderer = MKMultiPolygonRenderer(multiPolygon: multiPolygon)             renderer.fillColor = .red             renderer.strokeColor = .black             renderer.lineWidth = 1             renderer.alpha = 1.0             return renderer         }         return MKOverlayRenderer()     } }
1
0
1.2k
Dec ’21
Metadata rejection
Why does app keep getting rejected every time a new build is submitted for review? All the sections for metadata have been filled out and all the questions answered about data privacy. What are we missing? These are the questions the reviewer always asks: • Does your app include third-party analytics? If so, please provide details about what data is collected for this purpose.  • Does your app include third-party advertising? If so, please provide a link to the ad network's publicly-documented practices and policies for kids apps.  • Will the data be shared with any third parties? If so, for what purposes and where will this information be stored? • Is your app collecting any user or device data for purposes beyond third-party analytics or third-party advertising? If so, please provide a complete and clear explanation of all planned uses of this data.
1
0
483
Oct ’21