Posted:

Android Wear is great for quick glanceable information that lets you stay present and be connected. For example, wouldn’t it be great if Android Wear could show you a map of your run or allow you to pick a place on the map for you and your friend to meet? Now developers can support these use cases directly with location detection and the Google Maps API on Android Wear.

You can already use the paired phone to detect location, or use on-device location detection for wearables that have an onboard GPS. Now, with Google Play Services 7.3, developers can use Google Maps API directly on Android Wear. You can now offer your users a wearable-tailored Google Maps experience.

Getting Started - Showing a Map
If you are familiar with the Maps API on Android, you will feel right at home with the Maps API for Android Wear. Your Maps API key for your mobile app will work for your Wear app as well, provided your apps share the same package name. To display a map, you can follow the easy steps in our training guide or explore our sample. There are endless possibilities for maps on wearables, including finding the nearest coffee shop, getting the fastest route home from work, tracking your run, and more.

One new thing you will need to think about with Maps on Wear is the way that users exit your application. On Android Wear, users can usually exit an application if they swipe from left to right. If you don’t need to include an interactive map, this swipe-to-dismiss approach should work for your app too. However, if you want to allow the user to pan the map in any direction, the maps component will automatically disable the swipe-to-dismiss gesture and your application will need to handle how users will exit the application. The recommended approach is to implement the standard long-press-to-dismiss gesture. Using the Android Wear support library, this is quite simple.

To implement long-press-to-dismiss:
1. Add a the DismissOverlayView from the Wearable UI Support Library to the layout and initialise it in the onCreate method of the activity

<android.support.wearable.view.DismissOverlayView
     android:id="@+id/dismiss_overlay"
     android:layout_height="match_parent"
     android:layout_width="match_parent"/>

private DismissOverlayView mDismissOverlay;

@Override
public void onCreate(Bundle savedState) {
  ...
  mDismissOverlay =
    (DismissOverlayView) findViewById(R.id.dismiss_overlay);
  // Introduce this gesture to the user if necessary
  mDismissOverlay.setIntroText
    (R.string.basic_wear_long_press_intro);
  mDismissOverlay.showIntroIfNecessary();
  ...
}

2. Implement GoogleMap.OnMapLongClickListener for your activity and override the method. This will display the dismiss overlay with an option to exit your app:
@Override
public void onMapLongClick(LatLng latLng) {
  mDismissOverlay.show();
}
3. Assign the activity as the listener in onMapReady:
@Override
public void onMapReady(GoogleMap googleMap) {
  ...
  mMap.setOnMapLongClickListener(this);
  ...
}
Connecting People
In addition to displaying a map, another possible use for Maps on Android Wear is to pan a map to a specific location so that, for example, your friends can meet you at that specific location. In this case, you should add a marker and use GoogleMap.OnCameraChangeListener.
To add a marker to a map and listen into position changes:
1. Add an image in the center of the screen on top of the map. This indicates the selected location within the MapFragment element:
<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:src="@drawable/android_marker"/>
2. Implement GoogleMap.OnCameraChangeListener interface and override the following method:
@Override
public void onCameraChange(CameraPosition cameraPosition) {
  // Access the center of the camera through: 
  // cameraPosition.target.latitude and 
  // cameraPosition.target.longitude
}
3. Attach the listener to the Maps fragment:
@Override
public void onMapReady(GoogleMap googleMap) {
  ...
  mMap.setOnCameraChangeListener(this);
  ...
}
Living in the Real World
Android Wear is designed for users to stay connected while on the move. With the Google Maps API on Android Wear, developers can use the power of Google Maps to connect their users to what’s around them. Let’s keep our users moving... in the real world.

Posted by Hoi Lam, Developer Advocate at Google

Posted:
In March we launched the Places API for Android and opened up a public beta program for iOS. Today, we’re very excited to announce that the Google Places API for iOS is available to all developers!


Why Places?
When’s the last time someone asked you to meet them at -33.921053, 151.257996? Never? Exactly. People think of where they are in context: what shop they’re at or what park they’re in. The Places API enables your apps to speak your users’ language, based on Google’s database of 100 million places worldwide.


Who’s Using Places?
Excited to see the Google Places API for iOS in action?

"Google has incredibly high up time and the highest quality of data available. Because of Google, our users can rely on Places API when requesting a ride with nearly zero down time."   -- Lyft
Lyft will be coming out soon with a new version of their iOS app that uses Google Maps and Places APIs to know where you want to be picked up and dropped off.

Lyft is a welcoming, affordable ride within minutes. Simply request and go. Lyft launched in San Francisco in June 2012 and is now in more than 65 cities across the U.S.
                          


"Google Places API integrates smoothly into the PicsArt app, providing our users with all the benefits of quick and precise image geo-tagging experience."   -- PicsArt
In the next version of PicsArt, you’ll be able to simply use the place picker and the chosen location will be added to your post!

PicsArt is a full-featured photo editor app and the largest community of creatives and images, now reaching 65 million monthly active users.  

                               


Cross Platform
With this launch, all the great features of the Google Places API for Android are now also available on iOS:

  • Add a place picker: a drop-in UI widget that allows your users to specify a place (see the Picsart screenshot above)
  • Get the place where the device is currently located
  • Show detailed place information, including the place’s name, address, phone number, website, and more
  • Use autocomplete to save your users time and frustration typing out place names, by automatically completing them as they type (see the Lyft screenshot above)
  • Make your app stand out by adding new places that are relevant to your users and seeing the places appear in Google's Places database
  • Improve the map around you by reporting the presence of a device at a particular place.
Get Started
The Places API for iOS is available as part of the Google Maps SDK for iOS, now installable with Cocoapods! Have a go with


> pod try GoogleMaps


and play around with the “Maps SDK Demos” sample app. Then check out the developer documentation to add Places API to your iOS app.


Finally, a big thank you goes out to all the developers who helped battle-harden and test Places API for iOS during its beta run!

Posted by Jen Harrington, Product Manager, Google Maps APIs

Posted:

It’s been ten years since we launched Google Maps APIs to developers, and since then, developers have been creating amazing apps and online experiences. To celebrate how maps and location are an integral piece of app development, we’re hitting the road—literally, on a cross-country trip called Code the Road.


Code the Road is a road trip across the U.S. to highlight what developers have made possible with the Google Maps APIs. We’re driving our customized 1959 GM tour bus on a 14 stop journey across the U.S. where along the way we’ll meet with developers, bikers, athletes, and even Elmo. We’ll be meeting with some of our youngest fans on Sesame Street to talk about maps and map literacy. And for our final celebration, where better than the place where dreams come true? We’re going to Disney World to share the magic of coding!

Code the Road starts at Google I/O in San Francisco on May 28, where attendees can experience first-hand what we’ll be featuring on the road. The bus will be a permanent fixture during Google I/O across from Moscone West at the corner of 4th Street and Howard Street. Note that because we’re outside the venue, you don’t need an I/O ticket get on the bus, so come down to visit!

From there we’ll be heading across the country—stopping in Utah, Colorado, Wisconsin, Illinois, New York, Virginia, Georgia and Florida. Along the way we’ll be featuring some of the amazing applications developers have created using Google Maps APIs including apps from iFit, Harley-Davidson, Lyft, Hilton Hotels, The Weather Channel and Walt Disney World.
Code_the_Road_route.png
We will also be hosting three developer meetups in Boulder on June 4, Chicago on June 9 and New York on June 18. The meetups will highlight how developers can use the Google Maps APIs in their apps and websites and include sessions with Google Engineers and customers. We’re expecting these meet-ups to fill-up quickly, so reserve a seat at a location near you.

Here’s where and when you can come visit us:

Date
City
Location
May 28 & 29
San Francisco
Google I/O at the corner of 4th and Howard
June 2
Logan, UT
A visit with iFit ICON Health and Fitness with a 5K treadmill Run
June 3
Moab, UT
Arches National Park
June 4
Boulder, CO
Boulder Developer Meetup
June 8
Milwaukee, WI
Police escorted H.O.G. ride from Harley-Davidson headquarters to the Harley-Davidson Museum
June 9
Chicago, IL
Chicago Developer Meetup
June 10
Chicago, IL
A visit with Lyft
June 12
Chicago, IL
A visit with the Chicago Department of Transportation at North Avenue Beach
June 17
New York, NY
A visit with Sesame Street
June 18
New York, NY
NYC Developer Meetup
June 22
McLean, VA
A visit with Hilton Worldwide
June 23 & 24
Atlanta, GA
A visit with The Weather Channel and 48-hour Hackathon
June 26
Orlando, FL
Walt Disney World Resort

Follow us on our journey via the Code the Road website to provide additional details about the dates and locations of our stops as well as charting our progress as we head across the country. We will also be sharing on-the-road updates, videos and photos on the site throughout the trip.

We hope to see you on the road!

Posted by Ashley Smith, Developer Marketing, Google Maps APIs

Posted:


Editor’s note: Today’s guest blogger is Robert Maretsky, Director of Mobile for GolfNowGolf Channel. Read how the GolfNow app uses Google Maps APIs to help golfers find the right course and improve their scores.

It can be easier for golfers to get a hole in one than to find the right golf course. That’s what led us to create the GolfNow app (available for Android), which helps golfers find and make reservations at courses, and improve their games by showing satellite views of courses as they play. The app is a spinoff of our GolfNow website. The app shows golfers their exact location on the course and the distance between their location and the cup by collecting routing information from a third party and overlaying it on top of Google Maps Satellite view.
We chose the Google Maps APIs because of the comprehensive coverage, timely updates and easy integration with our Android app. We use Google Maps to provide course details so that golfers can find the course that’s right for them. When on the course, to help golfers decide how to best play their next shot, we use the APIs to display satellite images from Google Maps and use a phone’s GPS to show golfers where they are on the course.
The Places API has been particularly useful for helping people search for golf courses based on location. If you know you’re going to have free time when visiting (for example) Universal Studios in Orlando, you can type 'Universal Studios' in the search bar and discover nearby courses. Results display course information, including reviews and star ratings from GolfAdvisor.com. We use custom layouts in our infowindows to style and display the data from the Places API.
GolfNow website is the largest provider of tee times in the world, with more than 13 million rounds and counting. Now, thanks to apps powered by Google Maps APIs, we’re making it even easier for golfers to get the most out of their favorite sport — helping them find and book tee times, playing golf with accurate GPS information, and reviewing how they did after the round is complete.

Posted:


Editor’s note: Today’s guest blogger is Tom Edwards from the marketing and promotions agency The Marketing Arm. Read how The Marketing Arm used Google Maps APIs to build a website for GameStop to promote the launch of a new game.

If you’re going on a monster hunt, it’s a good idea to bring a map. And if you want to build buzz around the release of a new game, you should have the right tool as well—in our case it was Google Maps APIs. We built a website for GameStop to promote the launch of The Witcher 3: Wild Hunt, an action role-playing game from Warner Brothers and CD Projekt RED. After a visitor logs into the promotional website she is dropped into a map of the world and collects clues about where to find monsters. The goal is to be the first person to find each monster and win a prize.

The game’s launch deadline required us to build the site within a tight timeframe. We chose Google Maps APIs because they provided the tools we needed to build our maps quickly and easily. They also let us focus on the site creative rather than get bogged down with technical issues. We use the Google Maps JavaScript API for the front end, to start the experience and immerse visitors into the virtual world. Then, with the Google Maps Street View Service we allow users to search for monsters. We took images of the monsters and used overlays to drop them into familiar surroundings.

We use the Street View API to plant the user in a random location somewhere in the world, then visualize their surroundings, including monsters and trails of blood. We set a randomly generated starting point to the map based on five predefined locations. From there we have event listeners in place for 'mapView: bounds_changed, streetView: visible_changed, streetView: position_changed, streetView: pov_changed, searchBox: places_changed'.

When the user has initialized Street View, we make a call to our API to see if any monsters are within a defined distance from the LatLng of our monster data set. We continue this test anytime the position_changed event is fired until a monster is within range. At that point we update the class of a div that sits above the map view. Each monster is assigned a specific css class which allows us to easily make tweaks.

Google Maps made it easy to combine the real world of Street View with imaginary creatures from the game. Our goal went beyond just our users having fun — we wanted to build a site that would create genuine excitement around the game and give people a taste of monster hunting in the real world.

Posted:

We’re hitting the road—hosting a series of developer meetups in Boulder, Chicago and New York. As a way to bring the excitement of Google I/O to our developer community, we’re visiting select cities across the U.S. to share how developers can use the Google Maps APIs in their apps and websites.

The meetups will feature sessions with Google Engineers as well as customers such as Lyft, iFit by Icon Fitness, and more. Request a seat for our meetup in a city near you. Space is limited, so we encourage you to sign-up in advance. Once space is sold out, we’ll place additional requests on our waiting list.

June 4th - Boulder, CO
June 9th - Chicago, IL
June 18th - New York, NY

We hope to see you on the road.

Posted by Ashley Smith, Developer Marketing, Google Maps APIs

Posted:
The Google Geocoding API now returns Place IDs in the response and can also be queried with Place IDs. Place IDs identify a unique place in the Google Places database and on Google Maps and can be used to ensure that multiple APIs are referencing the same place. Now developers can use Place IDs across the Google Maps Roads API, Geocoding API, the Places library in the Google Maps Javascript API, and the Google Places API.

Traditionally, developers reference locations on a map as latitudinal and longitudinal coordinates. However, different APIs can translate the same latlng to different addresses, and the translation from latlngs to addresses can also change over time. Place IDs provide a way to consistently reference the same location across multiple APIs. By using Place IDs in your app, the locations you reference become more consistent and apps become more reliable and user-friendly.

For example, when using latlngs to reference locations, the Google Maps Roads API only ever returns drivable roads, whereas the Google Geocoding API prefers to return the addresses of buildings. If your app used the Roads API to snap to a road, and then queried Geocoding API with a latlng to get the road name, the Geocoding API may have returned a neighboring road depending on the nearest building. With this launch, you can now query Geocoding API with the Place ID of the road returned by Roads API, ensuring that you’re getting the name of the correct road.

We’ve started adding support for Place IDs across the Google Maps APIs in order to standardize the way locations are handled between APIs. To learn more about using Place IDs, take a look at our documentation to learn how to retrieve a place using the place ID, handle multiple place IDs, and more.

Posted by Elena Kelareva, Product Manager, Google Maps APIs