Module mapbox

Index

Modules

Interfaces

Classes

Functions

Functions

featureLayer(): FeatureLayer

L.mapbox.featureLayer provides an easy way to integrate GeoJSON from Mapbox and elsewhere into your map.

Returns

FeatureLayer

featureLayer(id: string, options?: FeatureLayerOptions): FeatureLayer

Parameters

Returns

FeatureLayer

featureLayer(geojson: any, options?: FeatureLayerOptions): FeatureLayer

Parameters

Returns

FeatureLayer

geocoder(id: string): Geocoder

A low-level interface to geocoding, useful for more complex uses and reverse-geocoding.

Parameters

  • id: string

Returns

Geocoder

geocoderControl(id: string, options?: GeocoderControlOptions): GeocoderControl

Adds geocoder functionality as well as a UI element to a map. This uses the Mapbox Geocoding API.

Parameters

Returns

GeocoderControl

gridControl(layer: string, options?: GridControlOptions): GridControl

Interaction is what we call interactive parts of maps that are created with the powerful tooltips & regions system in TileMill. Under the hood, it's powered by the open UTFGrid specification.

Parameters

Returns

GridControl

gridLayer(id: string): GridLayer

An L.mapbox.gridLayer loads UTFGrid tiles of interactivity into your map, which you can easily access with L.mapbox.gridControl.

Parameters

  • id: string

Returns

GridLayer

gridLayer(tilejson: any): GridLayer

Parameters

  • tilejson: any

Returns

GridLayer

infoControl(options?: ControlOptions): InfoControl

A map control that shows a toggleable info container. If set, attribution is auto-detected from active layers and added to the info container.

Parameters

Returns

InfoControl

legendControl(options?: ControlOptions): LegendControl

A map control that shows legends added to maps in Mapbox. Legends are auto-detected from active layers.

Parameters

Returns

LegendControl

map(element: string, id: string, options?: MapOptions): Map

Create and automatically configure a map with layers, markers, and interactivity.

Parameters

  • element: string
  • id: string
  • options?: MapOptions optional

Returns

Map

map(element: string, tilejson: any, options?: MapOptions): Map

Parameters

  • element: string
  • tilejson: any
  • options?: MapOptions optional

Returns

Map

sanitize(text: string): string

A HTML sanitization function, with the same effect as the default value of the sanitizer option of L.mapbox.featureLayer, L.mapbox.gridControl, and L.mapbox.legendControl.

Parameters

  • text: string

Returns

string

shareControl(id: string, options?: ShareControlOptions): ShareControl

Adds a "Share" button to the map, which can be used to share the map to Twitter or Facebook, or generate HTML for a map embed.

Parameters

Returns

ShareControl

template(template: string, data?: any): string

A mustache template rendering function, as used by the templating feature provided by L.mapbox.gridControl.

Parameters

  • template: string
  • data?: any optional

Returns

string

tileLayer(id: string, options?: TileLayerOptions): TileLayer

You can add a tiled layer to your map with L.mapbox.tileLayer(), a simple interface to layers from Mapbox and elsewhere.

Parameters

Returns

TileLayer

tileLayer(tilejson: any, options?: TileLayerOptions): TileLayer

Parameters

Returns

TileLayer