MapQuest.js

L.mapquest.incidentsLayer(options)

A layer that shows the traffic incidents and construction on a map. When an incident icon is clicked, a popup will be shown with incident/construction information. Incidents have three levels of severity: low, medium and high. Low severity incidents icons are yellow. Medium severity incident icons are orange. High severity incident icons are red.

Syntax

L.mapquest.key = 'KEY';

var map = L.mapquest.map('map', {
  center: [34.0522, -118.2437],
  layers: L.mapquest.tileLayer('map'),
  zoom: 12
});

map.addLayer(L.mapquest.incidentsLayer());

Parameters

  • options object

    An object containing minZoom and maxZoom.

    minZoom: The minimum zoom that traffic incident icons are visible. Default is 10.

    maxZoom: The maximum zoom that traffic incident icons are visible. Default is 20.

    Example

    {
      minZoom: 10,
      maxZoom: 20
    }

Return Value

An L.Layer object that can be added to a map with the addLayer() function.

Visual Example