import Extent from '../geo/Extent';
import { Geometry } from '../geometry';
import Layer, { LayerOptionsType } from './Layer';
import { HandlerFnResultType } from '../core/Eventable';
export declare function isGeometry(geo: any): boolean;
/**
* layers 的基础类,可用于 geometries 的添加移除
* 抽象类,不准备实例化
*
* @english
* @classdesc
* Base class of all the layers that can add/remove geometries.
* It is abstract and not intended to be instantiated.
* @category layer
* @abstract
* @extends Layer
*/
declare class OverlayLayer extends Layer {
options: OverlayLayerOptionsType;
constructor(id: string, geometries?: OverlayLayerOptionsType | Array, options?: OverlayLayerOptionsType);
getAltitude(): number;
/**
* 通过 id 获取 geometry
*
* @english
* Get a geometry by its id
* @param id - id of the geometry
* @return
*/
getGeometryById(id: string | number): Geometry;
/**
* 获取所有geometries,如果提供 filter() 方法,则根据方法返回
*
* @english
* Get all the geometries or the ones filtered if a filter function is provided.
* @param filter=undefined - a function to filter the geometries
* @param context=undefined - context of the filter function, value to use as this when executing filter.
* @return
*/
getGeometries(filter?: (geo: Geometry) => boolean, context?: any): Array;
/**
* 获取第一个geometry, geometry 位于底部
*
* @english
* Get the first geometry, the geometry at the bottom.
* @return first geometry
*/
getFirstGeometry(): Geometry;
/**
* 获取最后一个geometry, geometry 位于上部
*
* @english
* Get the last geometry, the geometry on the top
* @return last geometry
*/
getLastGeometry(): Geometry;
/**
* 获取 geometries 个数
*
* Get count of the geometries
* @return count
*/
getCount(): number;
/**
* 获取 geometries 的 extent, 如果 layer 为空,返回 null
*
* @english
* Get extent of all the geometries in the layer, return null if the layer is empty.
* @return {Extent} - extent of the layer
*/
getExtent(): Extent;
/**
* 按顺序为图层中的每个 geometry 执行一次提供的回调。
*
* @english
* Executes the provided callback once for each geometry present in the layer in order.
* @param fn - a callback function
* @param context=undefined - callback's context, value to use as this when executing callback.
* @return this
*/
forEach(fn: (geo: Geometry, index: number) => void, context?: any): this;
/**
* 创建一个包含所有通过由提供的函数实现的测试的 geometries 的 GeometryCollection。
*
* @english
* Creates a GeometryCollection with all the geometries that pass the test implemented by the provided function.
* @param fn - Function to test each geometry
* @param context=undefined - Function's context, value to use as this when executing function.
* @return A GeometryCollection with all the geometries that pass the test
*/
filter(fn: (geo: Geometry) => boolean, context?: any): Array;
/**
* layer 是否为空
*
* @english
* Whether the layer is empty.
* @return {Boolean}
*/
isEmpty(): boolean;
/**
* 为 layer 添加 geometries
*
* @english
* Adds one or more geometries to the layer
* @param geometries - one or more geometries
* @param fitView=false - automatically set the map to a fit center and zoom for the geometries
* @param fitView.easing=out - default animation type
* @param fitView.duration=map.options.zoomAnimationDuration - default animation time
* @param fitView.step=null - step function during animation, animation frame as the parameter
* @return this
*/
addGeometry(geometries: Geometry | Array, fitView?: boolean | addGeometryFitViewOptions): any;
/**
* 所有 geometries 最小的 zIndex
*
* @english
* Get minimum zindex of geometries
*/
getGeoMinZIndex(): number;
/**
* 所有 geometries 最大的 zIndex
*
* @english
* Get maximum zindex of geometries
*/
getGeoMaxZIndex(): number;
/**
* 移除一个或多个geometries
*
* @english
* Removes one or more geometries from the layer
* @param geometries - geometry ids or geometries to remove
* @returns this
*/
removeGeometry(geometries: Geometry | Geometry[]): any;
/**
* 清除 layer
*
* @english
* Clear all geometries in this layer
* @returns this
*/
clear(): this;
/**
* 移除geometry 回调函数
*
* @english
* Called when geometry is being removed to clear the context concerned.
* @param geometry - the geometry instance to remove
* @protected
*/
onRemoveGeometry(geometry: Geometry): void;
/**
* 获取 layer 的 style
*
* @english
* Gets layer's style.
* @return layer's style
*/
getStyle(): any | any[];
/**
* layer 设置 style, 用样式符号对满足条件的 geometries进行样式修改
* 基于[mapbox-gl-js's style specification], {https://www.mapbox.com/mapbox-gl-js/style-spec/#types-filter}.
*
* @english
* Sets style to the layer, styling the geometries satisfying the condition with style's symbol.
* Based on filter type in [mapbox-gl-js's style specification]{https://www.mapbox.com/mapbox-gl-js/style-spec/#types-filter}.
* @param style - layer's style
* @returns this
* @fires OverlayLayer#setstyle
* @example
* layer.setStyle([
{
'filter': ['==', 'count', 100],
'symbol': {'markerFile' : 'foo1.png'}
},
{
'filter': ['==', 'count', 200],
'symbol': {'markerFile' : 'foo2.png'}
}
]);
*/
setStyle(style: any | any[]): this;
/**
* 移除 style
*
* @english
* Removes layers' style
* @returns this
* @fires OverlayLayer#removestyle
*/
removeStyle(): this;
onAddGeometry(geo: Geometry): void;
hide(): this;
onGeometryEvent(param?: HandlerFnResultType): void;
}
export default OverlayLayer;
export type OverlayLayerOptionsType = LayerOptionsType & {
drawImmediate?: boolean;
geometryEvents?: boolean;
geometryEventTolerance?: number;
style?: any;
};
export type addGeometryFitViewOptions = {
easing?: string;
duration?: number;
step?: (frame: any) => void;
};
//# sourceMappingURL=OverlayLayer.d.ts.map