Click to navigate on mobile devices

- 1 answer

Ad

I'm adjusting a website with twitter bootstrap display for mobile devices, I'm trying to add a button like this one, so that when a user would click on it, it would open up "google maps" or "Apple maps" with the address respectfully.

enter image description here

How can I go about achieving this?

I'm currently using google maps html embed snippet, like this.

<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d405691.57240383344!2d-122.3212843181106!3d37.40247298383319!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x808fb68ad0cfc739%3A0x7eb356b66bd4b50e!2sSilicon+Valley%2C+CA%2C+USA!5e0!3m2!1sen!2sca!4v1450487299459" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>

however end user need to copy and paste the address on his phone, and its time consuming.

Any ideas?

Thanks

Ad

Answer

Ad

I have a new smart phone and simply using the content from the link "View Larger Map" the one provided by Google inside the Google iframe automatically calls a navigation request and I can then select Google Maps and then set as default to it always does this.

simply enclose inside

<a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="https://maps.google.com/maps?ll=51.641699,-2.676321&amp;z=15&amp;t=m&amp;hl=en&amp;gl=US&amp;mapclient=embed&amp;cid=7286262556213068272"></a>

I'm on Android 5.1, but I bet it works on IOS.

Give it a go, it worked for me :-)

Ad
source: stackoverflow.com
Ad