Class StaticGeoJSONTileProvider

Loads the provided geojson url and tiles the content in memory, data is only requested once

Hierarchy (view full)

Accessors

  • get className(): string
  • Returns string

Constructors

Methods

  • returns the features intersecting this coordinate. Depending on the resolution a buffer around the coordinate is requested. The Buffer has the size of the resolution.

    Parameters

    • coordinate: Coordinate

      in mercator

    • resolution: number

      in m per pixel

    • Optionalheaders: Record<string, string>

      optional request headers to be sent with the server request

    Returns Promise<Feature<Geometry>[]>

  • Retrieves all features which intersect the given extent. Will load all intersecting tiles.

    Parameters

    • extent: Extent
    • Optionallevel: number

      Optional level to request. Will use highest level if omitted. If the provided level is not a base level, will use the closest match.

    • Optionalheaders: Record<string, string>

      Optional request headers to be sent with the server request

    Returns Promise<Feature<Geometry>[]>

  • returns features for the requested Tile.

    Parameters

    • x: number
    • y: number
    • level: number

      if the level is not a base level, will use the closest match

    • Optionalheaders: Record<string, string>

      optional request headers to be sent with the server request

    Returns Promise<Feature<Geometry>[]>

  • Public API to load features from a source (for example a rest API, or WfsLayer)

    Can be used to write custom TileProvider to provide an interface to a "feature Source" Can also be used to manipulate the features, for example setting an ID Prefix or filter the features.

    Parameters

    • _x: number
    • _y: number
    • _z: number
    • Optionalheaders: Record<string, string>

    Returns Promise<Feature<Geometry>[]>

    to request Geojson from a rest API:
    const rectangle = this.tilingScheme.tileXYToRectangle(x, y, z);
    const southwest = Rectangle.southwest(rectangle);
    const northeast = Rectangle.northeast(rectangle);
    const minx = CesiumMath.toDegrees(southwest.longitude);
    const miny = CesiumMath.toDegrees(southwest.latitude);
    const maxx = CesiumMath.toDegrees(northeast.longitude);
    const maxy = CesiumMath.toDegrees(northeast.latitude);
    const url = `http://myFeatureSource/layer/getFeatures?minx=${minx}&miny=${miny}&maxx=${maxx}&maxy=${maxy}`

    return fetch.get(url)
    .then(response => response.json())
    .then((data) => {
    const { features } = GeoJSONparseGeoJSON(data.data, { dynamicStyle: true });
    return features;
    });

Properties

[moduleIdSymbol]?: string
allowTileAggregation: boolean
baseLevels: number[]

sorted baseLevels, maximumLevel first example: [18,17,16]

cache: Map<number, LRUCache<Promise<TileProviderRtree>>> = ...

cache of tiles for each baseLevel

featureIdToTileIds: Map<string, Set<string>> = ...

set of currently loaded featureIds with the corresponding tileIds

isDestroyed: boolean
name: string

unique Name

properties: Record<string, unknown>
rtreeCache: Map<string, TileProviderRtree> = ...

Caches the loaded rTrees for quick Access to all features.

tileLoadedEvent: VcsEvent<TileLoadedEvent> = ...
tilingScheme: WebMercatorTilingScheme = ...

Cesium Webmercator TilingScheme

trackFeaturesToTiles: boolean
url: string