MapQuest-GL.js

mqgl.Map(element, key, options)

Create and configure a vector map with pitch, markers, and interactivity.

Syntax

// 'map' refers to a <div> element with the ID map
var map = new mqgl.Map('map', 'KEY', {
  center: [-73.993411, 40.731701]
});

Parameters

  • element required string

    Must be the id of an element, or a DOM element reference.

  • key required string

    The API Key, which is needed to access MapQuest services.

  • options object

    An object containing any of the options described on the Options page.

Return Value

A new map object with the properties defined in the options.

Visual Example