Author Archives: Maps Devel

Code the Road: Hitting the Road with Harley-Davidson


Monday, June 8, was a great day in Milwaukee at Harley-Davidson where we met with the local H.O.G, chapters for a motorcycle ride to the Harley-Davidson Museum across town. We stopped in Milwaukee on our road trip with our Code the Road bus to celebrate the great work Harley-Davidson has done building the Harley-Davidson Ride Planner app using the Google Maps APIs.
IMG_3112.JPG

Upon arriving in Milwaukee, we were greeted by the most accommodating and friendly group of people as we lined up for our ride through the streets of Milwaukee. Although a rainy start, our riders didn’t let it dampen their spirits as we were led by some of the most beautiful motorcycles in the world. As far as we could see was a line of motorcycles leading the bus to the Harley-Davidson Museum—expertly escorted by Milwaukee police officers.

We captured some great footage of the ride from above with our drone and attached camera.

Our ride ended at the Harley-Davidson museum with tours of the Code the Road bus, a fun band, and refreshments for all the riders. We had local press outlets in attendance as well as many tourists visiting the museum. It was great to see the bus and the bikers that joined us on the local news channels that evening.
IMG_20150608_150055.jpg

The team had a blast driving a beautiful blue 2015 Softail Slim Harley-Davidson on a stationary treadmill and we even got to check out Harley-Davidson’s very first electric motorcycle, the LiveWire.

Our Code the Road postcard station is still going strong and we are enjoying seeing everyone send postcards home to document their visit to the bus.
5D.00_10_51_00.Still002.jpg

We’re rolling on and headed to New York. Don’t forget to signup for our New York Developer Meetup on Thursday, June 18.

Posted by Ed Boiling, Solutions Architect, Google Maps for Work

Harley-Davidson Ride Planner uses Google Maps APIs to help motorcyclists cruise the highways and byways



Editor’s note: Today’s guest blogger is Heidi Skinner, Social Strategy Manager at the Harley-Davidson Motorcycle Company. Read how Harley-Davidson uses Google Maps APIs to help motorcyclists plan and share road trips. Harley-Davidson is one of many customers sharing their story as part of our cross-country road trip, Code the Road.

Hitting the open road on your motorcycle isn’t what it used to be—it’s better, thanks to the Harley-Davidson Ride Planner mobile app and website that use the Google Maps APIs to help you plan trips, share them with others and get the most out of your route along the way. It's one of the many ways Harley-Davidson helps more people ride more miles.

Motorcyclists are a varied bunch. Some like short drives through urban centers, while others favor long rides through mountain ranges. They plan their rides with the same care as they plan their honeymoons or vacations. On the Ride Planner website, powered by the Google Maps JavaScript API, they can build their routes using Google Maps and choose the kinds of roads they favor, including Harley-Davidson Great Roads, which are some of the best roads in the country to ride on as rated by other Harley-Davidson riders.

The Google Places API lets them add important places—gas stations, hotels and attractions. We also use it to call out relevant places people might want to visit, like the hundreds of Harley-Davidson dealerships across the country that offer official Harley-Davidson merchandise, riding gear and parts & accessories as well as great restaurants, landmarks, campgrounds and other points of interest.
RidePlannerWeb2.png

RidePlannerWeb4_WithPlacesOptions.png

After people build their trips, the iOS and Android apps grab the information. The Android app uses the Google Maps API for Android to display the map, route and turn-by-turn directions. The Google Places API for Android lets people see and change their planned stops and attractions. The Google Maps SDK for iOS and Google Places SDK for iOS do the same thing for our iOS app, providing the same user experience across both platforms.
RidePlannerMobile1.jpg

People can share their rides as well. Members of the Harley Owners Group (H.O.G.) plan rides for as many as 500 people, who follow the route on the mobile apps. The apps also tie into mobile device GPS systems for navigation, and motorcyclists can export rides using GPX format into the built-in GPS on their Harley-Davidson motorcycles.

The app has been a huge success—people have planned hundreds of thousands of rides on the website, and the apps are each downloaded between 3,000 and 5,000 times a month. To help celebrate this momentum, we’re excited to be part of the Code the Road road trip with Google.

On June 8, members of local H.O.G. groups drove their Harleys alongside the Code the Road bus from our headquarters in Milwaukee to the nearby Harley-Davidson Museum. At the museum, we celebrated with a big party, including live music, tours of the bus and museum discounts for attendees. It was a great time with a great partner.

Code the Road Android App: Store your location data in the cloud with Firebase



Editor’s Note: We will be (literally) coding a mobile app on the road as part of our cross-country road trip, Code the Road. If you haven’t read our previous posts in the series, be sure to check out our first blog post, Code the Road: Hitting the Road with the Google Maps Android API to get started. Follow along as we build our app on the road and read more from Dong Sun, Maps Deployment Engineer at Google.

As we enter week two of our Code the Road journey and travel across the U.S., we thought: “What would be a better way to remember this amazing trip than by logging and saving our location history to the cloud?” In this post we will extend and build upon the Google Maps application we started in week 1 by:

  • Logging locations using the fused location provider, a simple API bundled with Google Play services, that provides high accuracy and low battery usage.
  • Saving and retrieving these locations using Firebase, a powerful application platform that enables real-time features without the hassle of networking, scaling, or complicated server code.
  • Displaying these recorded locations as markers on the map.

Step 1: Setup Firebase

Set up Firebase and data access. The first thing you need to do is set up Firebase, which will be used to store and retrieve your locations. Get started with the following steps:

  • Add the Firebase Android SDK—We used Firebase to store and retrieve location data. Follow this step-by-step guide to add Firebase to your project. Create a Firebase account, install the Firebase SDK, and set up the needed internet permission in your AndroidManifest.xml.

Firebase location data structure. Along with the latitude and longitude information, we will include a timestamp for each saved location. By saving the timestamp, it enables our application to aggregate the data daily, monthly, or any other specified time period. When this data is pushed into Firebase, it will appear as follows in the Firebase dashboard:
firebase-schema.png

Step 2: Capture Location and Save to Firebase

Now that we have Firebase ready and configured, our app needs to get both the initial location as well as location updates to save to Firebase.

Add start and stop logging buttons. We will add two buttons on the map application for starting and stopping location logging actions. For details on how to add buttons to the layout, please reference this link.
code-the-road-firebase-01.jpg
Request location permission. To get the user location, we required additional permissions. We need to add the following uses-permission elements to the manifest file. These settings control the accuracy of the current location.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Implement necessary interfaces. To ensure the app does not become unresponsive when capturing the device’s location, we use an asynchronous process by implementing ConnectionCallbacks, OnConnectionFailedListener, and LocationListener on our MapsActivity. You will need to implement the required methods in the interfaces.
public class MapsActivity extends FragmentActivity
    implements GoogleApiClient.ConnectionCallbacks,
    GoogleApiClient.OnConnectionFailedListener, 
    LocationListener {
}
Connect to Google Play Services. In our activity's onCreate() method, we created an instance of the Google API Client using GoogleApiClient.Builder and added the LocationServices API to the client.
protected synchronized void buildGoogleApiClient() {
  mGoogleApiClient = new GoogleApiClient.Builder(this)
      .addConnectionCallbacks(this)
      .addOnConnectionFailedListener(this)
      .addApi(LocationServices.API)
      .build();
}
Get initial device location. Whenever the client is connected to the service, GoogleApiClient.ConnectionCallbacks are called. The OnConnected() method will be invoked asynchronously when the connect request has successfully completed. Once the client is connected, we use the the fused location provider to get the last known location and zoom the map to that location.
@Override
public void onConnected(Bundle bundle) {
  mLastLocation = LocationServices.FusedLocationApi.getLastLocation(
       mGoogleApiClient);
  mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(
      new LatLng(mLastLocation.getLatitude(), 
      mLastLocation.getLongitude()),      
                 MAP_ZOOM_LEVEL));
}
Set up location request and update interval. We need to create and configure a LocationRequest object. You will need to set the location request preferences that are appropriate for your application. For example, fitness apps will want high accuracy with small intervals, but an asset tracking app might require lower accuracy with larger intervals.
public static final long  UPDATE_INTERVAL_IN_MS = 120000; 
public static final long FASTEST_UPDATE_INTERVAL_IN_MS =
UPDATE_INTERVAL_IN_MS / 4;
protected LocationRequest mLocationRequest;
Request regular location updates. When the “START” button is clicked, we use the method below to start regular location updates.
private void startLogging() {
  mLocationRequest = new LocationRequest();
  mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MS); 
  mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MS);
  mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
  if (mGoogleApiClient.isConnected() && !mRequestingLocationUpdates) {
       mRequestingLocationUpdates = true;
       startLocationUpdates();
   }
}
 
protected void startLocationUpdates() {
    LocationServices.FusedLocationApi.requestLocationUpdates(
           mGoogleApiClient, mLocationRequest, this);
}
The fused location provider invokes the LocationListener.onLocationChanged() callback method when a new location is detected by Google Play Services. We get each location, and save the system time in UTC, latitude and longitude to Firebase.
@Override
public void onLocationChanged(Location location) {
   mCurrentLocation = location;
   DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
   dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
   Date date = new Date(); 
   mLastUpdateTime = dateFormat.format(date).toString();

   saveToFirebase();

   // Retrieve saved locations and draw as marker on map
   drawLocations();

   // Update UI to draw bread crumb with the latest bus location.
   mMap.clear();

   LatLng mLatlng = new LatLng(mCurrentLocation.getLatitude(), 
   mCurrentLocation.getLongitude());
   MarkerOptions mMarkerOption = new MarkerOptions()
      .position(mLatlng)
      .title(mLastUpdateTime))
      .icon(BitmapDescriptorFactory.fromResource(R.drawable.code_the_road_small));

   Marker mMarker = mMap.addMarker(mMarkerOption); 
}
Save location info to Firebase. The Firebase Android SDK offers offline capability so Firebase applications work even when network connection is temporarily lost. Learn more about the offline capabilities of Firebase. We first need to create a connection to our Firebase instance:
myFirebaseRef = new Firebase("<YOUR-FIREBASE-APP>");
We then use the Firebase push() function that generates a unique ID every time a new child is added to the specified Firebase reference.
private void saveToFirebase() {
    Map mLocations = new HashMap();
    mLocations.put("timestamp", mLastUpdateTime);
    Map  mCoordinate = new HashMap();
    mCoordinate.put(“latitude”, mCurrentLocation.getLatitude());
    mCoordinate.put(“longitude”, mCurrentLocation.getLongitude());
    mLocations.put("location", mCoordinate); 
    myFirebaseRef.push().setValue(mLocations);
}

Step 3: Fetch Saved Locations and Draw on Map

Every location saved after the “START” button was clicked is retrieved from Firebase and drawn on the map as a marker. For better query performance, we added an index rule to index the data element “timestamp.” The app stops logging locations when the user clicks the “STOP” button.
private void drawLocations() {
  // Get only latest logged locations - since 'START' button clicked
  Query queryRef = 
  myFirebaseRef.orderByChild("timestamp").startAt(startLoggingTime);
  // Add listener for a child added at the data at this location
  queryRef.addChildEventListener(new ChildEventListener() {
    LatLngBounds bounds;
    LatLngBounds.Builder builder = new LatLngBounds.Builder();
    @Override
    public void onChildAdded(DataSnapshot dataSnapshot, String s) {
      Map  data = (Map ) dataSnapshot.getValue();
      String timestamp = (String) data.get("timestamp");
      // Get recorded latitude and longitude
      Map  mCoordinate = (HashMap)data.get("location");
      double latitude = (double) (mCoordinate.get("latitude"));
      double longitude = (double) (mCoordinate.get("longitude"));

      // Create LatLng for each locations
      LatLng mLatlng = new LatLng(latitude, longitude);

      // Make sure the map boundary contains the location
      builder.include(mLatlng);
      bounds = builder.build();

      // Add a marker for each logged location
      MarkerOptions mMarkerOption = new MarkerOptions()
          .position(mLatlng)
          .title(timestamp)
          .icon(BitmapDescriptorFactory.fromResource(R.drawable.measle_blue));
      Marker mMarker = mMap.addMarker(mMarkerOption);
      markerList.add(mMarker);

      // Zoom map to the boundary that contains every logged location
      mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds,
         MAP_ZOOM_LEVEL));
     }

      //Override other abstract methods for addChildEventListener below
      …
      });
    }
code-the-road-firebase-02.png
What’s next?
Now that we can record locations on demand, we could clean up our GPS locations using the snap-to-road function in the Roads API—just remember to proxy the use of this web service through your server. We could also further develop the application to share our location with friends or calculate the distance traveled. In the next few blog posts, we’ll expand our app by adding check-ins using the Places API and adding support for wearable devices.

Lyft connects drivers and riders with Google Maps APIs



Editor’s note: Today’s guest blogger is Vishay Nihalani, Product Manager at the ride-sharing service Lyft. Read how Lyft uses Google Maps APIs to help riders save money and get to their destinations faster. Lyft is one of many customers sharing their story as part of our cross-country road trip, Code the Road.

We know a lot about road trips—people have taken tens of millions of rides with us from the steep hills of San Francisco to the city streets of Chicago. Ride-sharing today is an intensely competitive business. If you’re going to succeed, you’ve got to connect riders and drivers simply and conveniently and make the experience delightful from beginning to end. That’s why we chose Google Maps and the Google Maps APIs. We started using them with our internal operations tools, and when we saw how valuable and scalable they were, we worked with Google to launch their services in our customer-facing apps.

The Google Maps Android API creates our Android app’s main interface—it’s the map you see when users log in. Our users can drop pins on a map or enter their location manually to indicate pick-up and drop-off locations. Through reverse geocoding, the app will recognize locations and determine an address automatically based on where the pin is dropped. We also help people find their locations by using the Google Places Search API. People often think about the places they want to go by name—for example, they’ll enter “Cliff House” rather than the restaurant’s street address. The Google Places Search API allows a passenger to enter the name of a destination.

When customers use our app, they expect there’ll be a car waiting for them and they’ll get to their destination as quickly as possible. They need to know when they’ll be picked up and when they’ll get where they want to go. We make it easy for our riders to quickly see this information right in the app.

Lyft now has more than 100,000 drivers and delivers more than two million rides per month in 65 cities. We’ve seen more than 500% growth in rides and revenue since last year, thanks in large part to Google Maps. And we’re exploring ways to make Lyft even better by using maps to improve the ride options we offer—for example, by expanding our new Lyft Line option for riders going in the same direction.

Google has been a great partner and has really contributed to our success, so we’re pleased to participate in Code the Road as Google celebrates mapping innovation and fun on its trip across America. Kyle Madsen, Android Developer at Lyft, presented at the Chicago developer meetup on June 9th. It was a great crowd and an exciting event. We hope to see you on the road!

Code the Road: Boulder Developer Meetup Recap

Screen Shot 2015-06-07 at 9.13.17 PM.png

For our first of three developer meetups, we stopped in Boulder, CO—after traveling from Arches National Park. We were thrilled to have a packed house at our first Code the Road meetup, with our attendees maxing out our 80-person capacity. We held four technical talks, an outdoor barbecue and met with many new friends. We hope everyone who attended enjoyed the evening.

First up was Google Maps APIs Engineering Manager James McGill who gave a talk titled Using the Google Maps APIs in your iOS or Android App.
A012_C046_060447.0000107.jpg
James McGill, Engineering Manager Google Maps APIs

Next, we were happy to welcome Chase Brammer, Head of iFit Product Development from our friends at iFit. Chase gave a talk about how the iFit technology brings hikes into your home using the Google Maps APIs.
A012_C049_06042X.0000052.jpg
Chase Brammer, Head of iFit Product Development, ICON Health and Fitness

I was up next outlining how you can use the Google Maps APIs with Google Cloud Platform to supercharge your apps. Closing out our round of tech talks was Nirav Patel, Director of Geospatial Solutions at Dito who outlined how they helped their client, Kocomojo, optimize Bluetooth iBeacon Technology using the Google Maps APIs.
A007_C028_06041W.0000691.jpg
The BBQ during the Boulder Developer Meetup

We’re looking forward to sharing a recap of our visit to Milwaukee at the Harley-Davidson Museum in the afternoon, and if you can make it, register for our Chicago and New York developer meetups. See you on the road!

Posted by Sean Wohltman, Geospatial Scientist, Google Maps for Work

Code the Road: A Postcard from Arches National Park

We stopped at Arches National Park on June 3 on our way to Boulder, Colorado for our Developer Meetup. While there, we hiked into the park with our Street View Trekker backpack hoping to get a peek of just a few of the 2,000 natural stone arches, hundreds of soaring pinnacles, massive fins and giant balanced rocks.

On the hike we learned it has taken over 30 years for dedicated “arch-hunters” to find, document and map the various features of the park. In 1970, official park literature stated that the park contained ‘nearly 90 arches’, which is less than 0.05 percent of what is known today. In 1973 a geography professor conducted the first scientific study of the a park and three decades of concentrated exploration and discovery has put many "new" arches on the map.

It’s fitting, as we celebrate 10 years of Google Maps, that we also remember the history and dedication of those who mapped some of the most beautiful landscapes in the world—without the technology of a Street View Trekker backpack.
We wish we had been with them 30 years ago to use our Street View Image API to integrate the amazing vistas into Google Maps so everyone could experience the 2,000 landmarks.
MOABDRIVE_3.Still002.jpg

Today we’re in Milwaukee visiting with Harley-Davidson and some of their HOG riders. We can’t wait to see you on the road!

Posted by Ashley Smith, Developer Marketing, Google Maps APIs

Code the Road: Running the streets of Paris in Logan, Utah with iFit



What a workout!

After packing up our Code the Road bus at the conclusion of Google I/O, it was time to hit the road. Our first stop was Logan, Utah on Tuesday, June 2, to visit ICON Health and Fitness for the world’s first virtual 5k run on ICON’s line of NordicTrack treadmills powered by iFit and our Google Maps APIs.
ifitr.jpeg

Over 1,000 people turned out watch 40 runners compete in the run, including two runners from the Google Maps APIs team: myself and one of our engineering managers, James McGill.
googy.jpg

The event kicked-off with our lead runner arriving via helicopter(!) with a run she had recorded on her Android Wear watch while running the streets of Paris. Immediately she uploaded her route to all the iFit treadmills and we were off and running. As we ran, imagery from Street View was displayed on each treadmill so every runner was virtually running the streets of Paris together.
IMG_5407.JPG

Even more fascinating, the treadmills increased and decreased their incline as we ran, via data piped in from the Google Maps Elevation API.
DSC00055.jpg

Before, during, and after the run, attendees toured the Code the Road bus to get a close-up look of what developers and customers are building with our API suite and to get the chance to try out some of those innovative experiences for themselves.
IMG_3089.JPG

And then we were off again to Moab, Utah! Wednesday, June 3, we went hiking with Street View cameras at gorgeous Arches National Park and yesterday we hosted a Developer Meetup in Boulder, Colorado. Stay tuned for more updates and we can’t wait to see you on the road!

Posted by Ken Hoetmer, Product Manager, Google Maps APIs

Code the Road: Hitting the Road with the Google Maps Android API



Editor’s note: We will be (literally) coding a mobile app on the road as part of our cross-country road trip, Code the Road. Follow along as we build our app on the road and read more from David McClusky, Solutions Architect at Google.

Welcome to our first post in our Code the Road mobile app development series. If you have not heard, we are celebrating 10 years of the Google Maps API with a road trip across the United States, starting at Google I/O, at the Moscone Center in San Francisco, and ending at Walt Disney World Resort. Along the way, we’ll be making a number of stops and hosting Google Maps API Developer Meetups in Boulder, Chicago and New York.

While on the road, we’re building a mobile application to show how easy it is to get started with the Google Maps and Places APIs on Android. Over the next several weeks, we will be building a road trip app which will help our team stay connected while on the road. We'll be demonstrating how to:
  • Store your location data in the cloud with Firebase
  • Check in along the road using Places API
  • Plan a hike or bike ride using the Directions and Elevation APIs
  • Send notifications to your Android Wear watch
Want to follow along and build your own app? Here are some tips to help you get started:

Setup your environment. If you haven’t already, download and install the latest version of Android Studio. In addition, be sure use the SDK Manager to download the SDKs for your target version of Android, and the latest version of the the Google Play services SDK.

Create a new project. Create a new project in Android Studio and give it a name. We are calling ours “Code the Road.” Select a minimum SDK version to target, and then add a Google Maps Activity.

Create your Google Maps API keys. Before you can run your Google Maps application, you must create a free API key in the Developers Console. Please see the detailed instructions here on creating a key.

In the google_maps_api.xml file, you want to insert your key here:
<string name="google_maps_key" templateMergeStrategy="preserve" translate="false">
YOUR_KEY_HERE
</string>

Now you can run your Google Maps application, either in an emulator or on your device.

Display a marker on the map. For our Code the Road application, we want to start out simple. Let’s put a marker on map showing the kick-off location of our Code the Road road trip, at the Moscone Center in San Francisco. We’ll also change the icon to an image of our Code the Road bus.
To import your own custom marker image into your Android application, you need to copy the image file file into the app / res / drawable folder of your Android project. In this example, we are using this image of our bus, but you can use any image you like.

Finally, we need a bit of code to set up our map and draw our marker. In the MapsActivity.java file, we’ll modify the setUpMap() function as follows:
private void setUpMap() {
  LatLng busLocation = new LatLng(37.783879,-122.401254);

  mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(busLocation, 12));
  mMap.addMarker(new MarkerOptions()
           .position(busLocation)
           .title("Code the Road Bus")
           .icon(BitmapDescriptorFactory.fromResource(R.drawable.bus)));
}
You may also need to add the following import statements at the top of MapsActivity.java:
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
Click the Run button to run in an emulator or an attached Android device. You now have a fully working Android application with Google Maps!
screenshot2.png

Our application does not do too much right now, so be sure to read our follow-on posts where we’ll be adding a lot more capability to our app, such as finding nearby places, storing our road trip location history to the cloud, and integrating with wearable devices. Stay tuned for more!

Code the Road: I/O Recap


Hello from Logan, Utah where we are setting up for our event with iFit today! After 18 hours on the road, we’re off to a great start on our Code the Road journey. Thousands of people were able to tour our 1959 GM bus at the corner of 4th and Howard in San Francisco last week. We hosted developers attending I/O, tourists visiting San Francisco, children walking home from school, and even a few Android Robots.
IMG_2852.JPG

Our postcard station was a great hit with both local and international visitors. Over 1000 postcards were dropped in the mail, some traveling only a few blocks and some traveling all the way to our friends in Japan!
IMG_2866.JPG
We were also really happy to host our Google Developer Experts for a breakfast at the bus on the last day of I/O. What a crew.

I/O Launches
Lastly, not only did we launch our Code the Road tour at I/O but we also launched two great new products.

Google Maps API for Android Wear brings the rich data of Google Maps to wearables, helping developers build apps that find the nearest coffee shop, get the fastest route home from work, track runs, and more.

Places API for iOS enables iOS apps to access Google’s database of 100 million places worldwide.

We can’t wait to see everyone on the road. If you haven’t already, please register for our developer events in Boulder, Chicago, and New York.

Posted by James McGill, Engineering Manager, Google Maps APIs

iFit builds immersive fitness experiences with Google Maps APIs



Editor’s note: Today’s guest blogger is Chase Brammer, Head of Product Development for iFit, a division of ICON Health and Fitness. ICON owns some of the best known brands in fitness, including NordicTrack, Proform, FreeMotion Fitness and Gold’s Gym. Read how iFit uses Google Maps APIs to build fitness equipment with Google Maps built-in. ICON is one of many customers sharing their story as part of our cross-country road trip, Code the Road.

Google Maps has been key in creating a great customer experiences for us, so we’re looking forward to welcoming the bus to Utah and participating in Code the Road. We’ll be providing a bike and treadmill to travel with the tour which demo how we are using Maps in our fitness equipment. We’ll also be hosting an event at our headquarters on June 2—one of the largest 5Ks to take place on treadmills—powered by iFit and Google Maps.

It’s tough for people to stick to their workout routines — but if you make it fun, social, and immersive they’re more likely to keep at it. To do that, we’ve built Google Maps into our line of fitness equipment, including treadmills and gym bikes. You can virtually run the Boston Marathon, bike the Tour de France, or just see whether you can beat your best friend in a short sprint.
NTL24013_tall_cat_xxl.png

When you’re on a treadmill or bike you can bring up Google Maps on an attached Android tablet and pick a route. You’ll see your progress on the map as you run or bike, and as the elevation of the route changes — for example if you’re heading up the Boston Marathon’s Heartbreak Hill — the angle of the treadmill or bike changes to match the real-life incline. You can also see markers representing other people who have run the route to see how your time compared to theirs.

We use Google Maps Android API to display the route and to show markers along the way. The Elevation API grabs the exact elevation of the route so we can change the incline of the treadmill or bike to match the route’s, while Street View displays what the route actually looks like. There are plenty of reasons we chose Google Maps APIs, but one of the most important was the way it lets us combine Street View with the Elevation API like this to create a truly immersive experience for our users.
iFit 2.png

One of the more interesting challenges we faced was how to place markers to show people their progress — including their position compared to another person — on a static map image.
iFit 1.png

So far our users have created 13.5 million customized workouts on our equipment using Google Maps. They’ve run or biked 76.5 million miles and burned more than 6.5 billion calories. We’ve heard stories of people who could barely walk but kept exercising because of their interactions with Maps, and are now running road races. We’ve seen our customers get more active, reach their goals and explore the world while doing it.