ios - How to open google maps app with a dropped pin ? - Swift -
i have code open google maps app specific location , it's working need drop pin on location, possible ?
if (uiapplication.shared.canopenurl(url(string:"comgooglemaps://")!)) { uiapplication.shared.openurl(url(string: "comgooglemaps://?center=\(self.location.coordinate.latitude),\(self.location.coordinate.longitude)&zoom=14&views=traffic")!) } else { print("can't use comgooglemaps://"); }
how to ?
try this
if (uiapplication.shared.canopenurl(url(string:"comgooglemaps://")!)) { uiapplication.shared.openurl(url(string: "comgooglemaps://?center=\(self.location.coordinate.latitude),\(self.location.coordinate.longitude)&zoom=14&views=traffic&q=\(self.location.coordinate.latitude),\(self.location.coordinate.longitude)")!) } else { print("can't use comgooglemaps://"); } }
Comments
Post a Comment