Why URLs?
Maps can be important to help your users get things done, but we know sometimes maps don't need to be a core part of your app or site. Sometimes you just need the ability to complete your users’ journey—including pointing them to a specific location. Maybe they're ready to buy from you and need to find your nearest store, or they want to set up a meeting place with other users. All of these can be done easily in Google Maps already.What you can do is use Google Maps URLs to link into Google Maps and trigger the functionality you or your users need automatically. Google Maps URLs are not new. You've probably noticed that copying our URLs out of a browser works—on some platforms. While we have Android Intents and an iOS URL Scheme, they only work on their native platforms. Not only is that more work for developers, it means any multi-user functionality is limited to users on that same platform.
Cross platform
So to start, we needed a universal URL scheme we could support cross-platform—Android, iOS, and web. A messaging app user should be able to share a location to meet up with their friend without worrying about whether the message recipient is on Android or iOS. And for something as easy as that, developers shouldn't have to reimplement the same feature with two different libraries either.So when a Google Maps URL is opened, it will be handled by the Google Maps app installed on the user's device, whatever device that is. If Google Maps for Android or iOS is available, that's where the user will be taken. Otherwise, Google Maps will open in a browser.
Easy to use
Getting started is simple—just replace some values in the URL based on what you're trying to accomplish. That means we made it easy to construct URLs programmatically. Here are a few examples to get you started:Say someone has finished booking a place to stay and need figure out how to get there or see what restaurants are nearby:
https://www.google.com/maps/search/?api=1&query=sushi+near+94043
google.com/maps/search/?api=1&query=shoreline+amphitheatre
Or if a user has set up their fitness app and want to try out a new route on their bike:
www.google.com/maps/dir/?api=1&destination=stevens+creek+trail&travelmode=bicycling&dir_action=navigate
And we can also open StreetView directly with a focus of our choice to give a real sense of what a place is like:
www.google.com/maps/@?api=1&map_action=pano&viewpoint=36.0665,-112.0906&heading=85&pitch=10&fov=75
Need more functionality?
Google Maps URLs are great to help your users accomplish some tasks in Google Maps. However, when you need more flexibility, customization, or control, we recommend integrating Google Maps into your app or site instead. This is where our more powerful Google Maps APIs come into play. With our feature-rich range of APIs, you can access full functionality and can control your camera, draw shapes on the map, or style your maps to match your apps, brand, or just for better UI. And if you want to go beyond the map we have metadata on Places, images, and much more.Learn more
When you're happy to delegate the heavy lifting and make use of the Google Maps app for your needs, Maps URLs are for you. Check out our new documentation.Thank you for using Google Maps URLs and the Google Maps APIs! Be sure to share your feedback or any issues in the issue tracker.
Posted by Joel Kalmanowicz, Product Manager, Google Maps APIs |