mobility-toolbox-js
Version:
Toolbox for JavaScript applications in the domains of mobility and logistics.
78 lines (77 loc) • 2.8 kB
TypeScript
import VectorLayer from 'ol/layer/Vector';
import { Vector } from 'ol/source';
import MapsetAPI from '../../api/MapsetApi';
import type { Map } from 'ol';
import type { EventsKey } from 'ol/events';
import type { FeatureLike } from 'ol/Feature';
import type { Options } from 'ol/layer/Vector';
import type { MapsetPlan } from '../../api/MapsetApi';
import type { MapsetAPIOptions } from '../../api/MapsetApi';
import type { MobilityLayerOptions } from './Layer';
export type MapsetLayerOptions = {
api?: MapsetAPI;
doNotRevert32pxScaling?: boolean;
loadAll?: boolean;
planId?: string;
} & MapsetAPIOptions & MobilityLayerOptions & Options;
/**
* An OpenLayers layer able to display plan data from [mapset](https://geops.com/de/solution/mapset).
*
* @example
* import { MapsetLayer } from 'mobility-toolbox-js/ol';
*
* const layer = new MapsetLayer({
* apiKey: 'yourApiKey',
* // tags: ['test'],
* // tenants: ['geopstest'],
* // url: 'https://editor.mapset.io/api/v1',
* });
*
* @see <a href="/doc/class/build/api/MapsetApi%20js~MapsetAPI%20html-offset-anchor">MapsetAPI</a>
* @see <a href="/example/ol-mapset-layer">OpenLayers Mapset layer example</a>
*
*
* @extends {ol/layer/VectorLayer~VectorLayer}
*
* @public
*/
declare class MapsetLayer extends VectorLayer<Vector<FeatureLike>> {
#private;
loadAll: boolean;
olEventsKeys: EventsKey[];
get api(): MapsetAPI;
set api(value: MapsetAPI);
get apiKey(): string | undefined;
set apiKey(value: string | undefined);
get doNotRevert32pxScaling(): boolean;
set doNotRevert32pxScaling(value: boolean);
get planId(): string | undefined;
set planId(value: string | undefined);
get plans(): MapsetPlan[];
set plans(value: MapsetPlan[]);
get tags(): string[];
set tags(value: string[]);
get tenants(): string[];
set tenants(value: string[]);
get timestamp(): string | undefined;
set timestamp(value: string | undefined);
get url(): string;
set url(value: string);
/**
* Constructor.
*
* @param {Object} options
* @param {string} options.apiKey Access key for [geOps APIs](https://developer.geops.io/).
* @param {string[]} [options.tags] The tags of the required plans.
* @param {string} [options.timestamp] The timestamp of the required plans.
* @param {string[]} [options.tenants] The tenants of the required plans.
* @param {string} [options.url] The URL of the [geOps Mapset API](https://geops.com/de/solution/mapset).
* @public
*/
constructor(options: MapsetLayerOptions);
fetchPlanById(planId?: string): Promise<void>;
fetchPlans(): Promise<never[] | undefined>;
setMapInternal(map: Map): void;
updateFeatures(): void;
}
export default MapsetLayer;