MapQuest Maps SDK for Android

Android Phones with MapQuest Maps

The MapQuest Maps SDK is a native library for interactive maps and traffic – built on vector maps and powered by the MapQuest tileset and traffic data.

Features

  • Location Follow Mode provides a customizable user location marker with the ability to snap to a route New in 2.0.9
  • Multiple Sample applications including a Maps Test app or the MapQuest Navigation SDK Sample app – provided as a reference design for customers, and to show off best UX practices for a navigation experience.
  • Built-in Styles Standard street, Night, and Satellite map styles included - along with the new MapQuest style!
  • Customizable styles on top of the MapQuest style gives you unparalleled flexibility
  • Label collision detection ensures that your annotation labels don't colide and look better on the map
  • Annotations, Overlays, Images, Polyline/Polygon add annotations, overlays, polylines, polygons on your map. Use bubble annotations when an annotation is tapped.
  • Layers provides support for multiple ways to display data on top of your map
  • Runtime Styling gives you the ability to dynamically change the look and feel of your map in real time
  • Faster and more efficient now more efficient in memory usage along with a better user experience
  • Offline Maps support downloading pre-selected regions for offline use

Complementary APIs

The following APIs are often used with the Navigation SDK, but note these do incur a transaction cost to use:

  • Navigation SDK : full documentation available here
  • Geocoding APIs : full documentation available here
  • Search / Search Ahead APIs : full documentation available here

Getting Started

MapQuest Key

In order to use MapQuest APIs and SDKs you will need a MapQuest key. We use this key to associate your requests to APIs with your account. You can find your existing keys or create a new one on the Applications page.

Sample Key Page

If you don't have a MapQuest Developer Account you can Sign Up Here.

Android Studio and SDK

We'll use Android Studio as our IDE in these examples. This install includes the Android SDK Manager required to download and run the Android SDK. Download Android Studio

Project Setup

Open Android Studio and go to File ‣ New ‣ Project or select "Start New Project". If this is your first time running Android Studio, you may be prompted to install the Android SDK - go ahead and follow the prompts to get the SDK installed.

On the following page, set the Application Name to My First MapQuest App. Set the Company Domain as desired and set the Project Location appropriately.

Configure Project

On the Target Android Devices page, leave everything at its default value and select Next.

Configure Project

On the following page, select the Empty Activity and leave the default settings on the Customize the Activity page. Select Finish to finalize the creation of your new app.

Importing the MapQuest Android SDK

Install the MapQuest Android SDK using Gradle.

After creating your project, insert the following into your project's build.gradle file:

allprojects {
  repositories {
       // mq maven repo
      maven { url 'https://artifactory.cloud.mapquest.com/artifactory/et-android-binaries' }
  }
}

Also, insert the following into your application's build.gradle file:

android{
    ...
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
...
implementation('com.mapquest:mapping-android-sdk:2.0.10')   // for Mapping SDK MapView

Add the following to the activity's onCreate method

MapQuest.start(getApplicationContext());

It may be necessary to perform a gradle clean build from the command line once to resolve the MapQuest resources.

Using your MapQuest Key in the SDK

<com.mapquest.mapping.maps.MapView xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/mapquestMapView"
    app:mapquest_app_key="YOUR_MAPQUEST_KEY_HERE"
/>

Examples

We have provided a variety of examples with how to use the Maps SDK. From how to load a basic map view to runtime styling and user location follow mode. Start off with the basic MapQuest Map View.

Supporting Documentation