@@ -75,7 +75,7 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
7575 mapView = AGSMapView . init ( frame: frame)
7676
7777 super. init ( )
78-
78+
7979 if let isAttributionTextVisible = mapOptions. isAttributionTextVisible {
8080 mapView. isAttributionTextVisible = isAttributionTextVisible
8181 }
@@ -180,12 +180,12 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
180180 result ( FlutterError ( code: " missing_data " , message: " Invalid arguments " , details: nil ) )
181181 return
182182 }
183-
183+
184184 guard let lodFactor = args [ " lodFactor " ] as? Int else {
185185 result ( FlutterError ( code: " missing_data " , message: " lodFactor not provided " , details: nil ) )
186186 return
187187 }
188-
188+
189189 let currentZoomLevel = convertScaleToZoomLevel ( mapView. mapScale)
190190 let totalZoomLevel = currentZoomLevel + lodFactor
191191 if ( totalZoomLevel > convertScaleToZoomLevel ( map. maxScale) ) {
@@ -207,12 +207,12 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
207207 result ( FlutterError ( code: " missing_data " , message: " Invalid arguments " , details: nil ) )
208208 return
209209 }
210-
210+
211211 guard let lodFactor = args [ " lodFactor " ] as? Int else {
212212 result ( FlutterError ( code: " missing_data " , message: " lodFactor not provided " , details: nil ) )
213213 return
214214 }
215-
215+
216216 let currentZoomLevel = convertScaleToZoomLevel ( mapView. mapScale)
217217 let totalZoomLevel = currentZoomLevel - lodFactor
218218 if ( totalZoomLevel < convertScaleToZoomLevel ( map. minScale) ) {
@@ -223,13 +223,13 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
223223 result ( success)
224224 }
225225 }
226-
226+
227227 private func onRotate( _ call: FlutterMethodCall , _ result: @escaping FlutterResult ) {
228228 guard let angleDouble = call. arguments as? Double else {
229229 result ( FlutterError ( code: " missing_data " , message: " Invalid arguments " , details: nil ) )
230230 return
231231 }
232-
232+
233233 mapView. setViewpointRotation ( angleDouble) { success in
234234 result ( success)
235235 }
@@ -240,7 +240,7 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
240240 result ( FlutterError ( code: " missing_data " , message: " Invalid arguments " , details: nil ) )
241241 return
242242 }
243-
243+
244244 do {
245245 let padding : ViewPadding = try JsonUtil . objectOfJson ( args)
246246
@@ -269,7 +269,7 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
269269 let animationOptions : AnimationOptions ? = animationDict == nil ? nil : try JsonUtil . objectOfJson ( animationDict!)
270270
271271 let scale : Double
272-
272+
273273 if let zoomLevel = zoomLevel {
274274 scale = convertZoomLevelToMapScale ( zoomLevel)
275275 } else {
@@ -322,26 +322,26 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
322322 return
323323 }
324324
325-
325+
326326 let existingIds = defaultGraphicsOverlay. graphics. compactMap { object in
327327 let graphic = object as! AGSGraphic
328328 return graphic. attributes [ " id " ] as? String
329329 }
330-
330+
331331 let hasExistingGraphics = newGraphics. contains ( where: { object in
332332 let graphic = object
333333 guard let id = graphic. attributes [ " id " ] as? String else {
334334 return false
335335 }
336-
336+
337337 return existingIds. contains ( id)
338338 } )
339-
339+
340340 if ( hasExistingGraphics) {
341341 result ( false )
342342 return
343343 }
344-
344+
345345 // addObjects causes an internal exceptions this is why we add
346346 // them in this for loop instead.
347347 // ArcGis is the best <3.
@@ -356,7 +356,7 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
356356 result ( FlutterError ( code: " missing_data " , message: " graphicId not provided " , details: nil ) )
357357 return
358358 }
359-
359+
360360 let newGraphics = defaultGraphicsOverlay. graphics. filter ( { element in
361361 let graphic = element as! AGSGraphic
362362 let id = graphic. attributes [ " id " ] as? String
@@ -365,7 +365,7 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
365365
366366 defaultGraphicsOverlay. graphics. removeAllObjects ( )
367367 defaultGraphicsOverlay. graphics. addObjects ( from: newGraphics)
368-
368+
369369 result ( true )
370370 }
371371
@@ -374,9 +374,9 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
374374 result ( FlutterError ( code: " missing_data " , message: " baseMapString not provided " , details: nil ) )
375375 return
376376 }
377-
377+
378378 map. basemap = AGSBasemap ( style: parseBaseMapStyle ( baseMapString) )
379-
379+
380380 result ( true )
381381 }
382382
@@ -394,12 +394,12 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
394394 result ( FlutterError ( code: " missing_data " , message: " Invalid arguments " , details: nil ) )
395395 return
396396 }
397-
397+
398398 guard let enabled = args [ " enabled " ] as? Bool else {
399399 result ( FlutterError ( code: " missing_data " , message: " enabled arguments " , details: nil ) )
400400 return
401401 }
402-
402+
403403 setMapInteractive ( enabled)
404404 result ( true )
405405 }
@@ -514,7 +514,7 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
514514 mapView. locationDisplay. autoPanMode = autoPanMode
515515 result ( true )
516516 }
517-
517+
518518 private func onGetAutoPanMode( _ call: FlutterMethodCall , _ result: @escaping FlutterResult ) {
519519 // autoPanMode.rawValue is any of [0; 3]:
520520 // https://developers.arcgis.com/ios/api-reference/_a_g_s_location_display_8h.html
@@ -524,17 +524,17 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
524524 }
525525 return result ( stringName)
526526 }
527-
527+
528528 private func onSetWanderExtentFactor( _ call: FlutterMethodCall , _ result: @escaping FlutterResult ) {
529529 guard let factor = call. arguments as? Double else {
530530 result ( FlutterError ( code: " missing_data " , message: " Invalid argument, expected an WanderExtentFactor as Double. " , details: nil ) )
531531 return
532532 }
533-
533+
534534 mapView. locationDisplay. wanderExtentFactor = Float ( factor)
535535 result ( true )
536536 }
537-
537+
538538 private func onGetWanderExtentFactor( _ call: FlutterMethodCall , _ result: @escaping FlutterResult ) {
539539 return result ( mapView. locationDisplay. wanderExtentFactor)
540540 }
@@ -561,13 +561,13 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
561561 result ( FlutterError ( code: " invalid_data " , message: " Unknown data source type \( String ( describing: type) ) " , details: nil ) )
562562 }
563563 }
564-
564+
565565 private func onUpdateIsAttributionTextVisible( _ call: FlutterMethodCall , _ result: @escaping FlutterResult ) {
566566 guard let isVisible = call. arguments as? Bool else {
567567 result ( FlutterError ( code: " missing_data " , message: " Invalid arguments " , details: nil ) )
568568 return
569569 }
570-
570+
571571 mapView. isAttributionTextVisible = isVisible
572572 result ( true )
573573 }
0 commit comments