Home > database >  iOS - Google maps not showing all the waypoints added in browser. Working fine in google maps app an
iOS - Google maps not showing all the waypoints added in browser. Working fine in google maps app an

Time:05-12

I'm working with an app which needs to pass source, in between waypoints and destination in google maps.

I'm first checking whether google maps app can be opened or not. If yes, I open google maps app, else I open maps with browser.

Below is my code:

func openMaps() {
    if UIApplication.shared.canOpenURL(URL(string: "comgooglemaps://")!) {
        if let mapsAppURL = URL(string: "comgooglemaps://?saddr=56.6440626,-2.8889821&daddr=53.4796061,-2.2455046 to:54.88716525,-2.92375275 to:53.85386995,-2.2135095&directionsmode=driving") {
            UIApplication.shared.open(mapsAppURL, options: [:], completionHandler: nil)
        }
    } else {
        if let url =  URL(string: "https://www.google.co.in/maps/dir/56.6440626,-2.8889821/54.88716525,-2.92375275/53.85386995,-2.2135095/53.4796061,-2.2455046") {
            let safariCont = SFSafariViewController(url: url)
            self.present(safariCont, animated: true, completion: nil)
        }
    }
}

My problem is:

  • In the above code, there are 2 waypoints.
  • If I open google maps app, all the waypoints are visible.
  • If I open it in safari controller, all the waypoints are visible ONLY IN DESKTOP SITE AND NOT IN MOBILE SITE.

Below are the SS for the reference.

Actual issue while opening in browser. only first 3 coordinates are visible: enter image description here

Here is me trying to add an additional 3rd waypoint. Notice that the add stop button is no longer available.

enter image description here

I think this is a limitation of the Google maps in the mobile browser as according to documentation for the Google mobile maps app you should be able to add up to 9 additional waypoints

  • Related