diff --git a/android/src/main/kotlin/com/alexmiller/map_launcher/MapLauncherPlugin.kt b/android/src/main/kotlin/com/alexmiller/map_launcher/MapLauncherPlugin.kt index 6eb3b5d..2cda0ba 100644 --- a/android/src/main/kotlin/com/alexmiller/map_launcher/MapLauncherPlugin.kt +++ b/android/src/main/kotlin/com/alexmiller/map_launcher/MapLauncherPlugin.kt @@ -10,7 +10,7 @@ import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result -private enum class MapType { google, googleGo, amap, baidu, waze, yandexNavi, yandexMaps, citymapper, mapswithme, osmand, osmandplus, doubleGis, tencent, here, petal, tomtomgo, copilot, sygicTruck, tomtomgofleet, flitsmeister, truckmeister, naver, kakao, tmap } +private enum class MapType { google, googleGo, amap, baidu, waze, yandexNavi, yandexMaps, citymapper, mapswithme, osmand, osmandplus, doubleGis, tencent, here, petal, tomtomgo, copilot, sygicTruck, tomtomgofleet, flitsmeister, truckmeister, naver, kakao, tmap, mapyCz } private class MapModel(val mapType: MapType, val mapName: String, val packageName: String, val urlPrefix: String) { fun toMap(): Map { @@ -62,7 +62,8 @@ class MapLauncherPlugin : FlutterPlugin, MethodCallHandler { MapModel(MapType.truckmeister, "Truckmeister", "nl.flitsmeister.flux", "truckmeister://"), MapModel(MapType.naver, "Naver Map", "com.nhn.android.nmap", "nmap://"), MapModel(MapType.kakao, "Kakao Maps", "net.daum.android.map", "kakaomap://"), - MapModel(MapType.tmap, "TMap", "com.skt.tmap.ku", "tmap://") + MapModel(MapType.tmap, "TMap", "com.skt.tmap.ku", "tmap://"), + MapModel(MapType.mapyCz, "Mapy CZ", "cz.seznam.mapy", "https://") ) private fun getInstalledMaps(): List { diff --git a/assets/icons/mapyCz.svg b/assets/icons/mapyCz.svg new file mode 100644 index 0000000..3b868fd --- /dev/null +++ b/assets/icons/mapyCz.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ios/Classes/SwiftMapLauncherPlugin.swift b/ios/Classes/SwiftMapLauncherPlugin.swift index bec7402..356d1f4 100644 --- a/ios/Classes/SwiftMapLauncherPlugin.swift +++ b/ios/Classes/SwiftMapLauncherPlugin.swift @@ -24,6 +24,7 @@ private enum MapType: String { case naver case kakao case tmap + case mapyCz func type() -> String { return self.rawValue @@ -70,7 +71,8 @@ private let maps: [Map] = [ Map(mapName: "CoPilot", mapType: MapType.copilot, urlPrefix: "copilot://"), Map(mapName: "Naver Map", mapType: MapType.naver, urlPrefix: "nmap://"), Map(mapName: "Kakao Maps", mapType: MapType.kakao, urlPrefix: "kakaomap://"), - Map(mapName: "TMap", mapType: MapType.tmap, urlPrefix: "tmap://") + Map(mapName: "TMap", mapType: MapType.tmap, urlPrefix: "tmap://"), + Map(mapName: "Mapy CZ", mapType: MapType.mapyCz, urlPrefix: "szn-mapy://") ] private func getMapByRawMapType(type: String) -> Map? { diff --git a/lib/src/directions_url.dart b/lib/src/directions_url.dart index 6457b75..7b2ca39 100644 --- a/lib/src/directions_url.dart +++ b/lib/src/directions_url.dart @@ -350,5 +350,14 @@ String getMapDirectionsUrl({ ...(extraParams ?? {}), }, ); + + case MapType.mapyCz: + return Utils.buildUrl( + url: 'https://mapy.cz/zakladni', + queryParams: { + 'id': '${destination.longitude},${destination.latitude}', + 'source': 'coor', + }, + ); } } diff --git a/lib/src/marker_url.dart b/lib/src/marker_url.dart index 4fe6121..1430ca6 100644 --- a/lib/src/marker_url.dart +++ b/lib/src/marker_url.dart @@ -326,5 +326,15 @@ String getMapMarkerUrl({ ...(extraParams ?? {}), }, ); + + case MapType.mapyCz: + return Utils.buildUrl( + url: 'https://mapy.cz/zakladni', + queryParams: { + 'id': '${coords.longitude},${coords.latitude}', + 'z': '$zoomLevel', + 'source': 'coor', + }, + ); } } diff --git a/lib/src/models.dart b/lib/src/models.dart index 32a311a..96817e7 100644 --- a/lib/src/models.dart +++ b/lib/src/models.dart @@ -83,6 +83,9 @@ enum MapType { // TMAP tmap, + + /// MapyCZ + mapyCz, } /// Defines the supported modes of transportation for [showDirections]