Currently, I want to launch a map app with a link to display the location on my smartphone.

The map app can be an iphone, android, google map, or a standard map.
So, if you don't have google map on your iphone, you can use the standard map app.


Click above to see Tokyo Tower in the map app.

However, if you click on the above link on iphone's chrome, it will not start even though the map application is entered, it will behave like a separate page will start up for a moment but it will disappear, just the original page will be displayed as it is was.

Map app has been launched properly on iphone safari.

If i know the cause or how to launch a map app with a link other than the above method, please teach.

  • Answer # 1

    This time, priority was given to launching the app, but it seems that it doesn't respond when _blank is set for iphone chome.
    When you remove it, "Do you want to start the app?" Is displayed, but now it starts with the map app in the smartphone.

  • Answer # 2

    Start by understanding how it works.
    When launching other apps from a browser, the mobile device uses aURL scheme,
    Launch other apps.
    For example, if you putmessage: //in the url, you can start the mailer set as default.
    That way, launching other apps by accessing the URL,
    CalledURL scheme.

    However, if you open it with a map app of a gourmet site such as Gurunavi below, I think that the URL to the normal map is listed.
    (In the case of Gurunavi, URL is accessed by onclick)

    Completely Private Izakaya TOTORIKO -Totoriko- Shinjuku East Exit Map/Access-GourNavi

    The pages accessed by looking at the map app are as follows.

    http://maps.google.com/maps?q=35.694493%2C139.701975%28%22 Completely private Izakaya TOTORIKO ~ Totoriko ~ Shinjuku East Exit

    I think that Google Map has started when I accessed it on a device that contains the Google Map app.

    This is when Google Map is accessed in the URL format as shown above.
    First of all, if you access the URL scheme of Google Map, and there is no app (so that the active app does not switch), the normal Google Map map page will be displayed over time.
    The reason for the above specifications is that it cannot be determined from HTML what application is included.

    But why does it not start when the app is in it?
    In iOS, because it is pure Safari, it is distinguished as a URL scheme, so
    I think that it is because it is not processed normally in Chrome.
    Android thinks that the URL scheme is handled correctly because Chrome is the default browser.

    Now, it is a way to start the map app on both Android and iOS, but this is the worst,You will need to switch URLs by OS and browser with JavaScript.
    This URL is for iOS and Safari, and this URL is for Android and Chrome.
    (Probably, the reason why the link to the map of Gurunavi is not written in the href is to make the above processing branch)
    What should I do with JavaScript? This is because it will be excluded from this case.
    Let's check by yourself first.