3

In Android one can use an URI to call GoogleMaps as follows

https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY

As given in this answer.

This query opens the GoogleMaps on Android devices and the place info is shown as in the below screenshot:

enter image description here

I'm looking for a similar result for IOS with GoogleMaps. I have searched in GoogleMaps SDK documentation and also over the internet but couldn't find an answer.

Can we achieve this for IOS with GoogleMaps?

Yunus Karakaya
  • 511
  • 3
  • 14

1 Answers1

5

Yes you can open Google Maps from your iOS App. There is a documentation available for opening Google Maps Via iOS App.

An example would be:

UIApplication.shared.openURL(URL(string:"https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY")!)

For this to work, there should be Google Maps App installed on the device. Though if you have the Placeid and Google SDK installed on your APP then you must have it's Latitude and Longitude. You can open default Maps to do this task for you. This SO Post is a great place to start!

Sahil
  • 9,403
  • 4
  • 39
  • 82
  • This is not working. Also, I want the place is selected as in the picture. If we remove the placeID from android query it will not show as in the picture. – Yunus Karakaya Jul 01 '19 at 17:47
  • @YunusKarakaya try opening this https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY – Sahil Jul 01 '19 at 17:56
  • your comment is what I'm looking for . Please update your answer – Yunus Karakaya Jul 01 '19 at 18:08