MapQuest-GL.js

Getting Started

MapQuest-GL.js is a JavaScript library for interactive maps, geocoding, directions, and traffic. MapQuest-GL.js is powered by the MapQuest APIs.

To get started, first include MapQuest-GL.js and MapQuest.css in your HTML header.

<script src="https://api.mqcdn.com/sdk/mapquest-gl-js/v0.4.0/mapquest-gl.js"></script>
<link type="text/css" rel="stylesheet" href="https://api.mqcdn.com/sdk/mapquest-gl-js/v0.4.0/mapquest-gl.css"/>

Then define a MapQuest map object with your MapQuest key, with center, zoom, pitch, and bearing values.

var map = new mqgl.Map('map', 'KEY', {
  center: [-122.2082454,37.4780123],
  zoom: 13,
  pitch: 60,
  bearing: 0
});

map.load(function() {
  setTimeout(function() {
    map.map.flyTo({speed: 0.5, zoom: 15, pitch: 60, bearing: 180, center: [-122.3989808,37.7517676]})
  }, 2000);
});

Join the Community

You'll need to sign up for an account with MapQuest. An API key is provided upon sign up and is required when accessing MapQuest services.

Sign Up

Get Coding

Once you have an account, get started making. We have tons of APIs to try including Mapping, Geocoding, Directions, and Search.

Grab the Key

Supported Browsers

Desktop

  • Chrome (33+)
  • Firefox (Current)
  • Safari (8+)
  • IE (11)
  • Microsoft Edge (Current)

Mobile

  • Safari for iOS (8+)
  • Android browser (5+)
  • Chrome for mobile (Current)
  • Firefox for mobile (Current)
  • IE Mobile (11)

Supporting Documentation