Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Latest commit

 

History

History
128 lines (79 loc) · 4.08 KB

API.md

File metadata and controls

128 lines (79 loc) · 4.08 KB

Table of Contents

VectorTiles

Extends GridLayer

Manages interactive tiles of data

Examples

var vtLayer = new L.VectorTiles('http://mytiles.com/{z}/{x}/{y}.pbf', {
  map: map,
  debug: true
}).addTo(map);

initialize

Constructor

Parameters

search

Returns an array of feature ids near a given point

Parameters

  • min L.LatLng
  • max L.LatLng

Returns Array<string>

hideByProperty

Removes features from the map by property. Wrapper function of _toggleByProperty. Equivalent to this._toggleByProperty(property, value, false).

Parameters

showByProperty

Add features to the map by property. Wrapper function of _toggleByProperty. Equivalent to this._toggleByProperty(property, value, true).

Parameters

restyleByProperty

Change the style of features based on property values

Parameters

Returns L.VectorTiles this

setFeatureStyle

Change the style of a feature by its id

Parameters

Returns L.VectorTiles this

getLayer

Returns a reference to the layer identified by the id

Parameters

Returns L.Path

getGeoJSON

Returns a reference to the GeoJSON feature identified by the id

Parameters

Returns Object

removeFeature

Deletes a feature by its ID Note that this feature will still be loaded in subsequent tiles

Parameters

Returns L.VectorTiles this