Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix iOS with guard let
  • Loading branch information
m0nac0 committed Aug 14, 2020
commit 11b934475a8fe959713c1d6421ce755e5fcaad97
8 changes: 4 additions & 4 deletions ios/Classes/MapboxMapController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ class MapboxMapController: NSObject, FlutterPlatformView, MGLMapViewDelegate, Ma
result(reply)
case "map#toScreenLocation":
guard let arguments = methodCall.arguments as? [String: Any] else { return }
let latitude = arguments["latitude"] as? Double
let longitude = arguments["longitude"] as? Double
guard let latitude = arguments["latitude"] as? Double else { return }
guard let longitude = arguments["longitude"] as? Double else { return }
let latlng = CLLocationCoordinate2DMake(latitude, longitude)
let returnVal = mapView.convert(latlng, toPointTo: mapView)
var reply = [String: NSObject]()
Expand All @@ -177,8 +177,8 @@ class MapboxMapController: NSObject, FlutterPlatformView, MGLMapViewDelegate, Ma
result(reply)
case "map#toLatLng":
guard let arguments = methodCall.arguments as? [String: Any] else { return }
let x = arguments["x"] as? Double
let y = arguments["y"] as? Double
guard let x = arguments["x"] as? Double else { return }
guard let y = arguments["y"] as? Double else { return }
let screenPoint: CGPoint = CGPoint(x: y, y:y)
let coordinates: CLLocationCoordinate2D = mapView.convert(screenPoint, toCoordinateFrom: mapView)
var reply = [String: NSObject]()
Expand Down