         var url: String!
         switch(mapApp) {
         case .apple:
-            url = NSString(format: "http://maps.apple.com/?saddr=%@&daddr=%@&z=14", googleMapsString(fromDirections), googleMapsString(toDirection)) as String
+            url = NSString(format: "http://maps.apple.com/?saddr=%@&daddr=%@&z=14",
+                           googleMapsString(fromDirections),
+                           googleMapsString(toDirection)) as String
         case .here:
             if #available(iOS 9.0, *) {
                 url = NSString(format: "https://share.here.com/r/%f,%f,%@/%f,%f,%@",

                name = toDirection.name
            }
            
            url = NSString(format: "navigon://coordinate/%@/%f/%f", urlEncode(name as NSString), toDirection.location.coordinate.longitude, toDirection.location.coordinate.latitude) as String
        case .transit:
            let params = NSMutableArray(capacity: 2)
            if fromDirections != nil {
                params.add(NSString(format: "from=%f,%f", fromDirections.location.coordinate.latitude, fromDirections.location.coordinate.longitude))
            }
            if toDirection != nil {
                params.add(NSString(format: "to=%f,%f", toDirection.location.coordinate.latitude, toDirection.location.coordinate.longitude))
            }
            url = NSString(format: "transit://directions?%@", params.componentsJoined(by: "&")) as String
        case .waze:
            url = NSString(format: "waze://?ll=%f,%f&navigate=yes", toDirection.location.coordinate.latitude, toDirection.location.coordinate.longitude) as String
        case .moovit:
            url = NSString(format: "moovit://directions?dest_lat=%f&dest_lon=%f&dest_name%@=&orig_lat=%f&orig_lon=%f&orig_name=%@&auto_run=true&partner_id=%@", toDirection.location.coordinate.latitude, toDirection.location.coordinate.longitude, urlEncode(toDirection.name as NSString), fromDirections.location.coordinate.latitude, fromDirections.location.coordinate.longitude, urlEncode(fromDirections.name as NSString), Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as? String ?? "") as String
        }
        if #available(iOS 10.0, *) {
            application.open(URL(string: url)!, options: [:], completionHandler: nil)

        
        if !mapPoint.name.isEmpty {
            let encodedName = mapPoint.name.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed)
            return NSString(format: "%f,%f+(%@)",
                            mapPoint.location.coordinate.latitude,
                            mapPoint.location.coordinate.longitude,
                            encodedName!)
        }
        
        return NSString(format: "%f,%f",
                        mapPoint.location.coordinate.latitude,
                        mapPoint.location.coordinate.longitude)
    }
    
    /**
