How to launch Google Maps on iPhone via web link?

前端 未结 4 808
攒了一身酷
攒了一身酷 2021-01-30 05:20

I am building a site that will have address links as well as image of a map - both of which have a link to Google Maps.

The problem is that when I click on these links u

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-30 05:59

    Take a look at this.

    It works on every device (for ios / android, it will launch google maps app else browser).

    For other devices, it will launch browser.

    Simple use case would be:

    1. Construct universal map URI (with encoded params)
    2. Use this URL like -

      window.open(mapUrl, '_system');

    More info for window.open here

    My use case required to open existing in app map navigation into some another dedicated maps app (preferably google maps app) for ios and android devices.

    I use ionic v1 + cordova for building native apps. Not sure if this is perfect for your use case but hope this helps.

提交回复
热议问题