OpenInGoogleMapsController is a class that makes it easy to build links to open a map (or display Street View or directions) directly in Google Maps for iOS. Rather than creating URLs by hand, you can create map requests using Objective-C classes and types, so you can take advantage of all the type-checking and code hinting you've come to expect from Xcode.
My favorite feature about this utility is that it supports a number of fallback strategies. If, for instance, you want to open up your map request in Google Maps, but then fallback to Apple Maps if the user doesn't have Google Maps installed, our library can do that for you. On the other hand, if it's important that your map location uses Google's data set, you can open up the map request in Google Maps in Safari or Chrome as a fallback strategy. And, of course, it fully supports the x-callback-url standard, so you can make sure Google Maps (or Google Chrome) has a button that points back to your app.
Blogger
GitHub
Google Maps URL Scheme
A URL scheme allows you to launch a native iOS application from another iOS app or a web application. You can set options in the URL that will be passed to the launched application. The Google Maps app for iOS supports the following URL schemes:
comgooglemaps:// and comgooglemaps-x-callback:// - These schemes allow you to launch the Google Maps app for iOS and perform one of several actions:
Display a map at a specified location and zoom level.
Search for locations or places, and display them on a map.
Request directions from one location to another. Directions can be returned for four modes of transportation: driving, walking, bicycling and public transit.
Add navigation to your app.
Issue a callback when the app has completed, using comgooglemaps-x-callback://. Callbacks are often used to return a user to the app that originally opened Google Maps for iOS.
comgooglemapsurl:// - This scheme allows you to launch the Google Maps app for iOS using a URL derived from the desktop Google Maps website. This means that you can give your users a native mobile experience rather than simply loading the Google Maps website.
The original URL can be for maps.google.com, or for google.com/maps, or using any valid top-level country domain instead of com.
You can issue a callback using the x-source and x-success parameters with the comgooglemapsurl:// URL scheme.
Google
My favorite feature about this utility is that it supports a number of fallback strategies. If, for instance, you want to open up your map request in Google Maps, but then fallback to Apple Maps if the user doesn't have Google Maps installed, our library can do that for you. On the other hand, if it's important that your map location uses Google's data set, you can open up the map request in Google Maps in Safari or Chrome as a fallback strategy. And, of course, it fully supports the x-callback-url standard, so you can make sure Google Maps (or Google Chrome) has a button that points back to your app.
Blogger
GitHub
Google Maps URL Scheme
A URL scheme allows you to launch a native iOS application from another iOS app or a web application. You can set options in the URL that will be passed to the launched application. The Google Maps app for iOS supports the following URL schemes:
comgooglemaps:// and comgooglemaps-x-callback:// - These schemes allow you to launch the Google Maps app for iOS and perform one of several actions:
Display a map at a specified location and zoom level.
Search for locations or places, and display them on a map.
Request directions from one location to another. Directions can be returned for four modes of transportation: driving, walking, bicycling and public transit.
Add navigation to your app.
Issue a callback when the app has completed, using comgooglemaps-x-callback://. Callbacks are often used to return a user to the app that originally opened Google Maps for iOS.
comgooglemapsurl:// - This scheme allows you to launch the Google Maps app for iOS using a URL derived from the desktop Google Maps website. This means that you can give your users a native mobile experience rather than simply loading the Google Maps website.
The original URL can be for maps.google.com, or for google.com/maps, or using any valid top-level country domain instead of com.
You can issue a callback using the x-source and x-success parameters with the comgooglemapsurl:// URL scheme.
Comments
Post a Comment