Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-11-07 18:17:51 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
af3396c4910d25b5a01d340a073121ae67bf7320
af3396c4
1 parent
ed1fd26a
fix open maps
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
af3396c
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
View file @
af3396c
...
...
@@ -237,19 +237,26 @@ import MapKit
// return
// }
guard
let
googleMapsUrl
=
URL
(
string
:
"https://www.google.co.in/maps/dir/?saddr=&daddr=
\(
lat
)
,
\(
lon
)
&directionsmode=driving"
),
let
appleMapsUrl
=
URL
(
string
:
"http://maps.apple.com/?daddr=
\(
lat
)
,
\(
lon
)
"
)
else
{
// guard let googleMapsUrl = URL(string: "https://www.google.co.in/maps/dir/?saddr=&daddr=\(lat),\(lon)&directionsmode=driving"),
// let appleMapsUrl = URL(string: "http://maps.apple.com/?daddr=\(lat),\(lon)") else {
// print("Error creating URLs")
// return
// }
//
// // check if link can be opened with google maps.
// guard UIApplication.shared.canOpenURL(googleMapsUrl) else {
// UIApplication.shared.open(appleMapsUrl, options: [:], completionHandler: nil)
// return
// }
//
// UIApplication.shared.open(googleMapsUrl, options: [:], completionHandler: nil)
guard
let
appleMapsUrl
=
URL
(
string
:
"http://maps.apple.com/?daddr=
\(
lat
)
,
\(
lon
)
"
)
else
{
print
(
"Error creating URLs"
)
return
}
// check if link can be opened with google maps.
guard
UIApplication
.
shared
.
canOpenURL
(
googleMapsUrl
)
else
{
UIApplication
.
shared
.
open
(
appleMapsUrl
,
options
:
[:],
completionHandler
:
nil
)
return
}
UIApplication
.
shared
.
open
(
googleMapsUrl
,
options
:
[:],
completionHandler
:
nil
)
UIApplication
.
shared
.
open
(
appleMapsUrl
,
options
:
[:],
completionHandler
:
nil
)
}
...
...
Please
register
or
login
to post a comment