/** * @author: xd * @Date: 2022-08-02 15:06:38 * @LastEditors: xd * @LastEditTime: 2023-06-02 16:31:39 * @FilePath: \Map2D\src\base\baseOptionType.ts * @Description: * * Copyright (c) 2022 by xd, All Rights Reserved. */ import { Style } from "ol/style"; import { Coordinate } from "ol/coordinate"; import { Positioning } from "ol/Overlay"; import { crsType, featuretype } from "../Enum/typeEnum"; export interface IContextmenu { classname?: string; text: string; icon?: string; data?: any; items?: any; callback?: (data: any) => void; } export interface IMapOption { enabledRightMenu?: boolean; enabledPopup?: boolean; enabledTooltip?: boolean; contextmenu?: Array; tooltipInfo?: Array | string; tooltipOption?: { offset: Array; }; popupInfo?: Array | string; popupOption?: { offset: Array; }; } export interface IimageLayer { zIndex: number; projection?: string; url: string; ImageExtent: { xmin: number; xmax: number; ymin: number; ymax: number; }; ImageExtentWKID: crsType; opacity: number; } export interface IFeatureAttribute { classname: string; uuid: string; editallows: boolean; editstate: boolean; movestate: boolean; featuretype: featuretype; dataType: string; } export interface IFeatureAnimationOptions { speed?: Number; duration?: number; side?: any; revers?: boolean; repeat?: number; hiddenStyle?: Style; horizontal?: boolean; fade?: (p0: number) => number; easing?: (p0: number) => number; } export interface ITooltipInfo { dataType: any; showContent: any; } export interface ILayerOption { featureStyle: any; name?: string; id?: string; url?: string; zIndex?: number; radio?: boolean; opacity?: number; } export interface IGraphicLayerOption extends ILayerOption { autoPointSize?: boolean; enabledRightMenu?: boolean; enabledPopup?: boolean; enabledTooltip?: boolean; imageRatio?: number; contextmenu?: Array; tooltipInfo?: Array | string; tooltipOption?: { offset: Array; }; popupInfo?: Array | string; popupOption?: { offset: Array; }; hashEdit?: boolean; hashMove?: boolean; hashSelect?: boolean; declutter?: boolean; } export interface IArcGisFeatureOption extends IGraphicLayerOption { queryParams: { where?: string; outFields?: string; extent?: Array; extentWkid?: string; onlyField?: string; autoShowFeature?: boolean; }; } export interface IWFSFeatureOption extends IGraphicLayerOption { url: string; tk?: string; queryParams: { service?: string; request?: string; version?: string; outputFormat?: string; maxFeatures?: string; typeName?: string; bbox?: string; filter?: string; onlyField?: string; queryField?: string; querykeyword?: string; autoShowFeature?: boolean; [key: string]: any; }; } export interface IImageCanvasLayerOption extends ILayerOption { line1Style?: string; line1Width: number; line5Style?: string; line5Width: number; line10Style?: string; line10Width: number; lineRectStyle?: string; lineRectWidth: number; } export interface ITileLayerOption extends ILayerOption { ImageExtent?: { xmin: number; ymin: number; xmax: number; ymax: number; }; ImageExtentWKID?: string; projection?: string; chinaCRS?: string; ratio?: number; params?: any; subdomains?: string; } export interface IGeoImageLayerOption extends ITileLayerOption { imageCenter: Array; imageScale: Array; imageCrop?: Array; imageRotate?: number; imageMask?: Coordinate[]; hashEdit?: boolean; } /** * IWmtsLayerOption * @param {attributions} Options * @param {layer} 图层layer名,需查看xml中设置 * @param {opacity} 图层透明度 默认值 "1.0" * @param {matrixSet} 图层matrixSet * @param {format} 图层格式 默认值 "image/png" * @param {projection} 图层投影 默认值 "EPSG:3857 * @param {style} 图层样式 默认值 "default * @param {offsetX} 图层X偏移 默认0 可以设置-1等 * @param {offsetY} 图层Y偏移 默认0 可以设置-1等 * @param {offsetZ} 图层Z偏移 默认0 可以设置-1等 */ export interface IWmtsLayerOption extends ITileLayerOption { attributions: string; layer: string; opacity: number; matrixSet: string; format: string; projection: string; style: string; offsetX: number; offsetY: number; offsetZ: number; } export interface IlevelColor { maxnum?: number; strokecolor: string; strokewidth: number; fillcolor: string; } export interface IHeatmapLayerOption extends IGraphicLayerOption { blur?: number; radius?: number; gradient: Array; } export interface IClusterLayerOption extends IGraphicLayerOption { convexhull?: boolean; animatesel?: boolean; animationDuration?: number; haslink?: boolean; distance?: number; levelColor?: Array; selectClusterOption?: ISelectClusterOption; } export interface ISelectClusterOption { pointRadius?: number; maxObjects?: number; spiral?: boolean; autoClose?: boolean; clusterPointStyle?: IImageStyle; clusterLineStyle?: IStrokeOption; BackgroundCircle?: IImageStyle; } export interface IClusterImageLayerOption extends IGraphicLayerOption { distance?: number; imageFieldName?: string; animationDuration?: number; maxResolution?: number; } export interface ITextOption { font?: string; text?: string; fill?: IFillOption; stroke?: IStrokeOption; backgroundFill?: IFillOption; backgroundStroke?: IStrokeOption; padding?: Array; offsetX?: number; offsetY?: number; textBaseline?: string; } export interface IStrokeOption { color?: string; width?: number; lineDash?: Array; image?: string | undefined; opacity?: number; pattern?: string | undefined; patternColor?: string; offset?: number; size?: number; spacing?: number; angle?: number; scale?: number; ratio?: number; } export interface IFillOption { color?: string; image?: string; opacity?: number; pattern?: string | undefined; patternColor?: string; offset?: number; size?: number; spacing?: number; angle?: number; scale?: number; ratio?: number; } export interface IGraphicOption { lnglat?: Array | Coordinate[][] | any; graphicType?: string; dataWkID?: crsType | string; attribute?: any; popupInfo?: any; tooltipInfo?: any; tooltipOption?: { offset: Array; }; popupOption?: { offset: Array; }; enabledRightMenu?: boolean; enabledPopup?: boolean; enabledTooltip?: boolean; showLayerContextmenu?: boolean; contextmenu?: Array; style?: any; } export interface IImageStyle { scale?: number; radius?: number; fill?: IFillOption; stroke?: IStrokeOption; points?: number; angle?: number; rotation?: number; } export interface ILabelStyle { text?: ITextOption; image?: IImageStyle; zIndex?: number; } export interface ILabelOption extends IGraphicOption { style: IPointStyle; } export interface IPointStyle { text?: ITextOption; image?: IImageStyle; zIndex?: number; } export interface IPointOption extends IGraphicOption { style: IPointStyle; } export interface IimagePointOption extends IGraphicOption { style: { text: ITextOption; imageOption: any; zIndex?: number; }; } export interface IPolylineStyle { text?: ITextOption; stroke?: IStrokeOption; zIndex?: number; } export interface IPolylineOption extends IGraphicOption { style: IPolylineStyle; } export interface IPolygonStyle { text?: ITextOption; stroke?: IStrokeOption; fill?: IFillOption; zIndex?: number; } export interface IPolygonOption extends IGraphicOption { style: IPolygonStyle; } export interface ICurveGraphicOption extends IGraphicOption { style: { text?: ITextOption; stroke?: IStrokeOption; fill?: IFillOption; zIndex?: number; radius?: number; startAngle?: number; stopAngle?: number; rotation?: number; }; } export interface IPathLayerOption extends IGraphicLayerOption { roadNetworkData: string; pathDefaultStyle: { color: string; width: number; }; pathStyle: { color: string; width: number; imageUrl: string; }; trackPathStyle: { color: string; width: number; }; geoMarkerStyle: { url: string; }; navigationOption: { defaultZoom: number; turnToZoom: number; speed: number; tracking: boolean; trackingDirection: boolean; totalDistance: number; showNode: boolean; showStartEndNode: boolean; showPathLine: boolean; scale: number; pointDistance: number; }; } export interface IDivGraphicOption { coordinate?: Array; dataWkID?: crsType | string; html?: string; positioning?: Positioning; hashMove?: boolean; enabledRightMenu?: boolean; enabledPopup?: boolean; enabledTooltip?: boolean; contextmenu?: Array; popupInfo?: Array | string; tooltipInfo?: Array | string; tooltipOption?: { offset: Array; }; popupOption?: { offset: Array; }; attribute?: any; } /** * @description: 多窗口参数 * @param {string | HTMLElement} target 容器 * @param {string} layername 图层名 */ export interface IMapViewOption { target?: string | HTMLElement; baselayer?: string; overLayer?: any; syncGraphicLayer?: boolean; } /** * @description: 网格参数 * @param {Array.} [options.startPoint=[510367.2358, 2895576.008]] 起点坐标,西南角 * @param {number} [options.startNumberX=1] - startNumberX 东方向起始号 默认:1 * @param {number} [options.startNumberY=1] - startNumberY 北方向起始号 默认:1 * @param {number} [options.maxWidth=100] - maxWidth 最大宽度范围,东方向总长度 默认:100 * @param {number} [options.maxHeight=100] - maxHeight 最大高度范围,北方向总长度 默认:100 * @param {number} [options.onlyWidth=5] - onlyWidth, 单探方宽度 默认:5 * @param {number} [options.onlyHeight=5] - onlyHeight,单探方高度 默认:5 * @param {number} [options.quadrant=1] - quadrant, 象限【1,2,3,4】 默认:1 * @param {string} [options.fqChar=1] - fqChar,分区号 默认:"" * @param {string} [options.firstChar="A"] - firstChar,编号首字符,默认是T * @param {string} [options.xChar=""] - xChar,x编号首字符 默认:"" * @param {string} [options.yChar=""] - yChar,y编号首字符 默认:"" * @param {boolean} [options.xReverseOrder=false] - xReverseOrder,X反向编号,从大到小 默认:false * @param {boolean} [options.yReverseOrder=false] - yReverseOrder, Y反向编号,从大到小 默认:false * @param {string} options.wkid - wkid, 输入值的wkid编号,不需要带【EPSG:】 默认:"" * @param {string} options.digit - 编号为位数,默认两位数 100 * @param {boolean} options.north - 北方向在前 默认:true * @param {number} options.step - 布方步长 默认: 1 * @param {object} [options.createExtent] createExtent -绘制的外多变形限制范围 * @param {object} [options.excludeExtent] createExtent -绘制的外多变形限制范围 * @param {object} [options.gridType] gridType -网格类型 1,象限网格 2 y坐标以 字母递增 x坐标以数字递增 */ export interface IGridOption { startPoint: number[]; startNumberX: number; startNumberY: number; maxWidth: number; maxHeight: number; onlyWidth: number; onlyHeight: number; quadrant: number; fqChar: string; firstChar: string; xChar: string; yChar: string; xReverseOrder: boolean; yReverseOrder: boolean; wkid: string; digit: number; north: boolean; createExtent: never[]; excludeExtent: never[]; step: number; gridType: number; }