Skip to content

Instantly share code, notes, and snippets.

View itrew's full-sized avatar

Ian Trewella itrew

  • WA Dept of Fish & Wildlife
  • Olympia, Washington
View GitHub Profile
@itrew
itrew / ESRI_Vector_Tile_Bug.md
Last active June 28, 2021 07:26
ESRI JS API Vector Tile Implementation with Multiple Sources

Bug Overview

ESRI has adopted the Mapbox Vector Tile Spec & associated Mapbox Style Spec for implementing vector tiles. The Mapbox Style Spec has the 'sources' property that defines the sources of different tile sets. This enables the ability to combine tile sets from multiple sources into a single vector tile layer. For example, vector tiles provided by ESRI can be merged with vector tiles published separately into the same layer. This works in various mapping libraries that support vector tiles (tested with mapbox-gl), but ESRI's JS API has an issue. The JS API will only load a single source of vector tiles, even when multiple are specified. And even then, the behavior is inconsistent.

If there is a source named 'esri', that will be the only source loaded via the API. If there is a source with the string 'street' in it's name, the API will throw an error and fail to load the layer. If there are neither layers named 'esri' or contain 'street', only the first layer in the source list is loaded.