import { HttpService } from "@open-pioneer/http"; import { DECLARE_SERVICE_INTERFACE, ServiceOptions } from "@open-pioneer/runtime"; import { LayerConstructor } from "./layers/shared/internals"; import { LayerConfig } from "./layers/shared/LayerConfig"; import { Layer } from "./layers/unions"; interface References { httpService: HttpService; } /** * Options that can be passed to {@link LayerFactory.create}. * * The `type` option is mandatory and indicates the type of the layer (e.g. `WMSLayer`). * The other options depend on the specific layer type. * * @group Services */ export type LayerCreateOptions = { /** The layer type to construct. */ type: LayerConstructor; } & Config; /** * Creates instances of layer classes. * * Use the interface `"map.LayerFactory"` to obtain an instance of this service. * * @group Services */ export declare class LayerFactory { #private; [DECLARE_SERVICE_INTERFACE]: "map.LayerFactory"; constructor(options: ServiceOptions); /** * Creates a new instance of the given layer type. * The `"type"` option is mandatory and specifies which layer type to create. * * The other configuration options may be dependent on the specific layer type. * * Example: * * ```ts * import { SimpleLayer } from "@open-pioneer/map"; * * const layerFactory = ...; // injected * const layer = layerFactory.create({ * type: SimpleLayer, * title: "Layer title", * olLayer: new TileLayer({}), * // ... other options * }); * ``` */ create(config: LayerCreateOptions): LayerType; } export {};