                 name = toDirection.name
             }
             
-            url = NSString(format: "navigon://coordinate/%@/%f/%f", urlEncode(name as NSString), toDirection.location.coordinate.longitude, toDirection.location.coordinate.latitude) as String
+            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))
+                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))
+                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
+            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
+            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)
    }
    
    /**

                               toDirection.name) as String
            }
        case .google:
            url = NSString(format: "comgooglemaps://?saddr=%@&daddr=%@",
                           googleMapsString(fromDirections),
                           googleMapsString(toDirection)) as String
        case .yandex:
            url = NSString(format: "yandexnavi://build_route_on_map?lat_to=%f&lon_to=%f&lat_from=%f&lon_from=%f",
                           toDirection.location.coordinate.latitude,
                           toDirection.location.coordinate.longitude,
                           fromDirections.location.coordinate.latitude,
                           fromDirections.location.coordinate.longitude) as String
        case .citymapper:
            let params: NSMutableArray! = NSMutableArray(capacity: 10)
            if CLLocationCoordinate2DIsValid(fromDirections.location.coordinate) {
                params.add(NSString(format: "startcoord=%f,%f",
                                    fromDirections.location.coordinate.latitude,
                                    fromDirections.location.coordinate.longitude))
                if !fromDirections.name.isEmpty {
                    params.add(NSString(format: "startname=%@", urlEncode(fromDirections.name as NSString)))
                }
