MapQuest.js

L.mapquest.tileLayer(id, options)

Syntax

{
  // L.mapquest.tileLayer('map') is the MapQuest map tile layer
  layers: L.mapquest.tileLayer('map')
}

Parameters

  • id required string

    The ID of a map style. The supported style IDs are 'map', 'hybrid', 'satellite', 'light', 'dark'.

  • options object

    An object containing any of the following key value options: format, minZoom, and maxZoom.

    format: The image format of the tiles, either 'png' or 'jpg'. Default is 'png'.

    minZoom: The minimum zoom that tileLayer is visible. Default is 0.

    maxZoom: The maximum zoom that tileLayer is visible. Default is 20.

    Example

    {
      format: 'png',
      minZoom: 0,
      maxZoom: 20
    }

Events

  • map_type_changed Event

    A map_type_changed event is fired when a map new tile layer is added to the map.

    Example

    tileLayer.on('map_type_changed', function(eventResponse) {
      console.log(eventResponse);
    });

Return Value

An L.tileLayer object that contains the MapQuest map style.

Visual Example

Map

Hybrid

Satellite

Dark

Light