@versatiles/style
    Preparing search index...

    Function inspectorStyle

    Everything both entry points expose. index.ts (npm) adds the authoring helpers on top; browser.ts (the CDN bundle) does not — see the note in each.

    • A colour-coded style that draws every source-layer of a vector tileset, whatever it contains.

      Each source-layer gets three layers — a translucent fill, a line, and a name label — in one hue derived from its name, over a neutral background. Nothing is filtered and nothing is hidden, so geometry shows up whichever type it turns out to be. This is what you want when the tiles are unfamiliar, or when you are checking what a tileset actually carries rather than how it should look.

      It is the style guessStyle falls back to for vector tiles whose schema it cannot build, and exporting it means you can ask for it deliberately — including for a tileset that is recognised, where guessStyle would give you real cartography instead:

      import { inspectorStyle } from '@versatiles/style';
      const style = inspectorStyle(tileJSON); // raw source-layers, even for Shortbread tiles

      Synchronous and performs no I/O, like osm() and guessSchema(): it takes a TileJSON object. Pass a URL through fetchTileJSON first.

      Unlike guessStyle, this throws rather than returning a blank style — it is a builder, and you asked for this style specifically, so a malformed tileset is an error rather than something to paper over.

      Parameters

      • tileJSON: TileJSONSpecification

        a vector TileJSON, i.e. one carrying vector_layers

      • Optionaloptions: InspectorStyleOptions

        urls.base resolves relative tile URLs; urls.glyphsPattern says where the labels load fonts from. No sprite: nothing here places an icon.

      Returns StyleSpecification

      if tileJSON is not a valid TileJSON, carries no vector_layers, or options has an unknown key.