Skip to content

About

Changes Google Maps links to the "maps:" format on iOS devices

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

iOSifyMaps.js

JavaScript script that changes Google Maps formatted links to iOS formatted links only on iOS devices.

What it does

  • Checks for an iOS Device via User Agent String (checks for iPhone, iPod and iPad)
  • Get's all anchor tags
  • Get's href of each anchor
  • Changes url from "maps.google.com" to "maps.apple.com"

How to Implements

  1. Place <script type="text/javascript" src="iOSifyMaps.js"></script> tag referring to js file right BEFORE </body> tag
  2. Use the following JavaScript after including this JS file: <script>document.getElementsByTagName('a').iOSifyMaps();</script>
  3. For more efficient JS, add an id to the targeted element and use getElementByID: <script>document.getElementByID('mapsLink').iOSifyMaps();</script>
  4. This can also be used with jQuery: <script>$('a[href*="maps.google.com"]').iOSifyMaps();</script>

About

Changes Google Maps links to the "maps:" format on iOS devices

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages