locar-tiler
    Preparing search index...

    Class JsonTiler

    Class representing a Tiler which delivers JSON data.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    dataTiles: Map<string, DataTile>
    tile: Tile
    url: string

    Methods

    • For a given Spherical Mercator position and zoom, downloads data if necessary and returns the data at the tile corresponding to that position.

      Parameters

      • sphMercPos: EastNorth

        the Spherical Mercator position.

      • z: number = 13

        zoom level to use (default 13)

      Returns Promise<Tile>

      Promise resolving with the given Tile.

    • Converts the raw data from the server to a custom type of data. By default, returns a DataTile object containing the Tile and the raw data returned from readTile(), but this can be overridden (e.g. in DemTile the data of the DataTile is a DEM object).

      Parameters

      • tile: Tile

        the current tile.

      • data: any

        the raw downloaded data.

      Returns DataTile

      the DataTile pairing the Tile and the data in the format we want.

    • Overridden readTile() for JsonTiler.

      Parameters

      • url: string

        the URL.

      Returns Promise<any>

      a Promise resolving with parsed JSON data.

    • Sets the zoom.

      Parameters

      • z: number

        the zoom to use.

      Returns void

    • Download new tiles for a given Spherical Mercator position.

      Parameters

      • pos: EastNorth

        the Spherical Mercator position.

      Returns Promise<DataTile[]>

      a Promise resolving with an array of the newly-downloaded data tiles (only new tiles; existing ones are not returned)

    • Download new tiles for a given longitude/latitude.

      Parameters

      Returns Promise<DataTile[]>

      a Promise resolving with an array of the newly-downloaded data tiles (only new tiles; existing ones are not returned)