Interface ResourceAdapter<M, L, O, F>

Adapter for vector data display control.

Type Parameters

Hierarchy

Implemented by

Properties

baselayer?: boolean
id?: string
layer?: L
map?: M
name?: string
options: O
order?: number
resourceId: number
selected?: boolean

True if there are selected features in the layer

source?: unknown

Experimental option, only for MVT. Points to a data source instead of loading data into a layer.

Methods

  • The way to filter layer objects through serializable expressions. To clear the filter, pass null or undefined as the second parameter.

    Parameters

    • filters: PropertiesFilter<(F extends Feature<Geometry, GeoJsonProperties>
              ? F["properties"]
              : Record<string, string>) extends null
          ? Record<string, any>
          : F extends Feature<Geometry, GeoJsonProperties>
              ? F["properties"]
              : Record<string, string>>

      Filter, conforming to the PropertiesFilter expression specification's.

    • Optional options: FilterOptions<(F extends Feature<Geometry, GeoJsonProperties>
              ? F["properties"]
              : Record<string, string>) extends null
          ? Record<string, any>
          : F extends Feature<Geometry, GeoJsonProperties>
              ? F["properties"]
              : Record<string, string>>

      Options object.

    Returns Promise<void>

    Example

    layer.propertiesFilter(['all', ['color', 'eq', 'green'], ['year', 'gt', 2011]]);
    layer.propertiesFilter([[
    'any',
    ['color', 'eq', 'green'],
    ['color', 'eq', 'red']
    ],
    ['year', 'gt', 2011]
    ]);
  • Method for selecting objects on the map. The selectedPaint option will be applied to the selected objects.

    Parameters

    Returns void

    Remarks

    It is strongly recommended to use an PtropertiesFilter expression to set selected objects, since the selecting by the callback function is not supported by vector tiles and other asynchronous adapters.

Generated using TypeDoc