MapQuest-GL.js

Map Options

The MapQuest-GL map can be instantiated with an options object as the third argument in the map constructor.

Any of the following values may be provided.

  • bearing number, default is 0

    The bearing or rotation in degrees to be applied to the map.

  • center Array<number>, default is [-104.984855, 39.738452]

    A Lng,Lat array to be used as the map's center.

  • pitch number, default is 0

    The pitch or tilt in degrees to be applied to the map.

  • zoom number, default is 10

    The initial zoom level of the map.

  • minZoom number, default is 0

    The minimum zoom level the map can support.

  • maxZoom number, default is 20

    The maximum zoom level the map can support.

  • padding number, default is 100

    The padding to be applied to generated points and shapes when the fitBounds function is called.

  • open boolean, default is false

    Specifies whether the MapQuest Open APIs should be used for the map.

  • control object, default is mapquest

    The type and position of the control to be added to the map.

    Accepted values are:

    type
    • mapquest
    • basic
    • none

    position
    • topleft
    • topright
    • bottomleft
    • bottomright
  • trafficFlow object

    An object describing traffic configuration.

    Accepted values are:

    • low - rgb, hex, or color name for low traffic conditions
    • medium - rgb, hex, or color name for medium traffic conditions
    • high - rgb, hex, or color name for high traffic conditions
    • closed - rgb, hex, or color name for closed roads
    • thickness - the thickness of the traffic flow lines
    • opacity - opacity applied to all traffic lines. Accepts 0 - 1 as values
    • filter - filters traffic shown on the map

    Accepted filter values are:

    • flow - display only traffic flow
    • incidents - display only traffic incidents
  • scaleBar Array<String>, default is []

    Array of scale bar identifiers to be added to the map.

    Accepted values are:

    • km
    • mi
  • style object

    The style to be applied to the map.

    Accepted values are:

    • map
    • hybrid