import Class from '../core/Class'; import CollisionIndex from '../core/CollisionIndex'; import type { Map } from '../map'; import type { Marker, MultiPolygon, Polygon } from '../geometry'; import { CommonProjectionType } from '../geo/projection'; import Coordinate from '../geo/Coordinate'; import Point from '../geo/Point'; declare const Layer_base: { new (...args: any[]): { _jsonType?: string; getJSONType(): string; }; registerJSONType(type: string): void; getJSONClass(type: string): { new (...args: any[]): { _eventMap?: Record; _eventParent?: any; _eventTarget?: any; on(eventsOn: string | import("../core/Eventable").EventRecords, handler: import("../core/Eventable").HandlerFn, context?: any): any; addEventListener(...args: any[]): any; once(eventTypes: string | import("../core/Eventable").EventRecords, handler: import("../core/Eventable").HandlerFn, context?: any): any; off(eventsOff: string | import("../core/Eventable").EventRecords, handler: import("../core/Eventable").HandlerFn, context?: any): any; removeEventListener(...args: any[]): any; listens(eventType: string, handler?: import("../core/Eventable").HandlerFn, context?: any): number; getListeningEvents(): string[]; copyEventListeners(target: any): any; fire(eventType: string, param?: import("../core/Eventable").BaseEventParamsType): any; _wrapOnceHandler(evtType: string, handler: import("../core/Eventable").HandlerFn, context?: any): (...args: any[]) => void; _switch(to: string, eventRecords: import("../core/Eventable").EventRecords, context?: any): any; _clearListeners(eventType: string): void; _clearAllListeners(): void; _setEventParent(parent: any): any; _setEventTarget(target: any): any; _fire(eventType: string, param: import("../core/Eventable").BaseEventParamsType): any; }; } & { new (...args: any[]): {}; registerRenderer(name: string, clazz: T): any & typeof Class; getRendererClass(name: string): Class; } & typeof Class; } & { new (...args: any[]): { _eventMap?: Record; _eventParent?: any; _eventTarget?: any; on(eventsOn: string | import("../core/Eventable").EventRecords, handler: import("../core/Eventable").HandlerFn, context?: any): any; addEventListener(...args: any[]): any; once(eventTypes: string | import("../core/Eventable").EventRecords, handler: import("../core/Eventable").HandlerFn, context?: any): any; off(eventsOff: string | import("../core/Eventable").EventRecords, handler: import("../core/Eventable").HandlerFn, context?: any): any; removeEventListener(...args: any[]): any; listens(eventType: string, handler?: import("../core/Eventable").HandlerFn, context?: any): number; getListeningEvents(): string[]; copyEventListeners(target: any): any; fire(eventType: string, param?: import("../core/Eventable").BaseEventParamsType): any; _wrapOnceHandler(evtType: string, handler: import("../core/Eventable").HandlerFn, context?: any): (...args: any[]) => void; _switch(to: string, eventRecords: import("../core/Eventable").EventRecords, context?: any): any; _clearListeners(eventType: string): void; _clearAllListeners(): void; _setEventParent(parent: any): any; _setEventTarget(target: any): any; _fire(eventType: string, param: import("../core/Eventable").BaseEventParamsType): any; }; } & { new (...args: any[]): {}; registerRenderer(name: string, clazz: T): any & typeof Class; getRendererClass(name: string): Class; } & typeof Class; /** * layers的基础类,定义了所有layers公共方法。 * 抽象类,不做实例化打算 * * @english * @classdesc * Base class for all the layers, defines common methods that all the layer classes share.
* It is abstract and not intended to be instantiated. * * @category layer * @abstract * @extends Class * @mixes Eventable * @mixes JSONAble * @mixes Renderable */ declare class Layer extends Layer_base { map: Map; parent: any; options: LayerOptionsType; getLayers?(): Layer[]; constructor(id: string, options?: LayerOptionsType); /** * 加载tile layer,不能被子类重写 * * @english * load the tile layer, can't be overrided by sub-classes */ load(): this; /** * 获取layer Id * * @english * Get the layer id * @returns id */ getId(): string; /** * 为layer新设一个 Id * * @english * Set a new id to the layer * @param id - new layer id * @return this * @fires Layer#idchange */ setId(id: string): this; /** * 将图层添加至 map * * @english * Adds itself to a map. * @param map - map added to * @return this */ addTo(map: Map): this; /** * 为layer 设置zIndex * * @engilsh * Set a z-index to the layer * @param zIndex - layer's z-index * @return this */ setZIndex(zIndex: number): this; /** * 获取layer 的 zIndex * * @english * Get the layer's z-index * @return */ getZIndex(): number; /** * 获取 layer 的 minZoom * * @english * Get Layer's minZoom to display * @return */ getMinZoom(): number; /** * 获取layer 的 maxZoom * * @english * Get Layer's maxZoom to display * @return */ getMaxZoom(): number; /** * 获取 layer 的 opacity * * @english * Get layer's opacity * @returns {Number} */ getOpacity(): number; /** * 设置 layer 的 opacity * * @english * Set opacity to the layer * @param opacity - layer's opacity * @return this */ setOpacity(op: number): this; /** * layer 是否为 HTML5 Canvas 渲染 * * @english * If the layer is rendered by HTML5 Canvas. * @return * @protected */ isCanvasRender(): boolean; /** * 获取图层所在 map * * @english * Get the map that the layer added to * @returns {Map} */ getMap(): Map; /** * 获取 layer 所在map 的 projection * * @english * Get projection of layer's map * @returns */ getProjection(): CommonProjectionType; /** * 将图层置顶 * * @english * Brings the layer to the top of all the layers * @returns this */ bringToFront(): this; /** * 将图层置底 * * @english * Brings the layer under the bottom of all the layers * @returns {Layer} this */ bringToBack(): this; /** * 显示图层 * * @english * Show the layer * @returns this */ show(): this; /** * 隐藏图层 * * @english * Hide the layer * @returns this */ hide(): this; /** * layer 的当前 visible 状态 * * @english * Whether the layer is visible now. * @return */ isVisible(): boolean; /** * 移除图层 * * @english * Remove itself from the map added to. * @returns this */ remove(): this; /** * 获取 mask geometry * * @english * Get the mask geometry of the layer * @return {Geometry} */ getMask(): Marker | MultiPolygon | Polygon; /** * 设置mask geometry, 只显示掩码的区域 * * @english * Set a mask geometry on the layer, only the area in the mask will be displayed. * @param {Geometry} mask - mask geometry, can only be a Marker with vector symbol, a Polygon or a MultiPolygon * @returns {Layer} this */ setMask(mask: Polygon | MultiPolygon | Marker): this; /** * 移除mask * * @engilsh * Remove the mask * @returns {Layer} this */ removeMask(): this; /** * 准备层的加载,是一个由子类重写的方法。 * * @english * Prepare Layer's loading, this is a method intended to be overrided by subclasses. * @return true to continue loading, false to cease. * @protected */ onLoad(): boolean; onLoadEnd(): void; /** * 是否加载layer * * @english * Whether the layer is loaded * @return */ isLoaded(): boolean; /** * 获取collision index * * @english * Get layer's collision index * @returns {CollisionIndex} */ getCollisionIndex(): CollisionIndex; /** * 清除 layer 的 collision index。 * 如果 collisionScope !== 'layer' 将忽略 * * @english * Clear layer's collision index. * Will ignore if collisionScope is not layer */ clearCollisionIndex(): this; getRenderer(): any; onConfig(conf: { [key: string]: any; }): void; onAdd(): void; onRendererCreate(): void; onCanvasCreate(): void; onRemove(): void; getRendererOption(): "canvas" | "gl" | "gpu" | "dom"; toJSON(options?: any): LayerJSONType; /** * Reproduce a Layer from layer's JSON. * @param {Object} layerJSON - layer's JSON * @return {Layer} */ static fromJSON(layerJSON: { [key: string]: any; }): Layer | null; identify(_coordinate: Coordinate, _options: LayerIdentifyOptionsType): void; identifyAtPoint(_containerPoint: Point, _options: LayerIdentifyOptionsType): void; } export default Layer; export type LayerOptionsType = { attribution?: string; minZoom?: number; maxZoom?: number; visible?: boolean; opacity?: number; zIndex?: number; globalCompositeOperation?: string; renderer?: 'canvas' | 'gl' | 'gpu' | 'dom' | null; debugOutline?: string; cssFilter?: string; forceRenderOnMoving?: boolean; forceRenderOnZooming?: boolean; forceRenderOnRotating?: boolean; collision?: boolean; collisionScope?: 'layer' | 'map'; hitDetect?: boolean; canvas?: HTMLCanvasElement; mask?: any; drawImmediate?: boolean; geometryEvents?: boolean; geometryEventTolerance?: number; maskClip?: boolean; }; export type LayerJSONType = { id: string; type: string; options: Record; geometries?: Array; layers?: Array; }; export type LayerIdentifyOptionsType = { onlyVisible?: boolean; tolerance?: number; }; //# sourceMappingURL=Layer.d.ts.map