v-openlayers 2.9.5 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/v-map/global.d.ts +208 -0
- package/package/v-map/ol/config.d.ts +5 -0
- package/package/v-map/ol/lib/business/OlHandler.d.ts +49 -0
- package/package/v-map/ol/lib/config/mapConfig-4326.d.ts +36 -0
- package/package/v-map/ol/lib/core/VMap.d.ts +556 -0
- package/package/v-map/ol/lib/core/plugins/DrawConditions.d.ts +64 -0
- package/package/v-map/ol/lib/core/plugins/DrawHandler.d.ts +306 -0
- package/package/v-map/ol/lib/core/plugins/FeatureHandler.d.ts +117 -0
- package/package/v-map/ol/lib/core/plugins/GeojsonHandler.d.ts +76 -0
- package/package/v-map/ol/lib/core/plugins/GeometryHandler.d.ts +117 -0
- package/package/v-map/ol/lib/core/plugins/InteractionHandler.d.ts +230 -0
- package/package/v-map/ol/lib/core/plugins/KrigingHandler.d.ts +18 -0
- package/package/v-map/ol/lib/core/plugins/LayerHandler.d.ts +386 -0
- package/package/v-map/ol/lib/core/plugins/MeasureHandler.d.ts +32 -0
- package/package/v-map/ol/lib/core/plugins/Simplify.d.ts +26 -0
- package/package/v-map/ol/lib/core/plugins/StyleHandler.d.ts +72 -0
- package/package/v-map/ol/lib/core/plugins/TransformHandler.d.ts +35 -0
- package/package/v-map/ol/lib/core/plugins/WMTSExplorer.d.ts +108 -0
- package/package/v-map/ol/lib/core/plugins/WfsHandler.d.ts +66 -0
- package/package/v-map/ol/lib/core/plugins/WktHandler.d.ts +62 -0
- package/package/v-map/ol/lib/core/plugins/WmsHandler.d.ts +32 -0
- package/package/v-map/ol/lib/core/plugins/baidu/BaiduMap.d.ts +3 -0
- package/package/v-map/ol/lib/core/plugins/baidu/bd09.d.ts +2 -0
- package/package/v-map/ol/lib/core/plugins/mapbox-streets-v6-style.d.ts +1 -0
- package/package/v-map/ol/types/types.d.ts +84 -0
- package/package/v-map/public/utils/advanced/GradientColor.d.ts +27 -0
- package/package/v-map/public/utils/base/color.d.ts +17 -0
- package/package/v-map/public/utils/base/common.d.ts +126 -0
- package/package/v-map/public/utils/base/date.d.ts +52 -0
- package/package/v-map/public/utils/base/index.d.ts +340 -0
- package/package/v-map/public/utils/base/number.d.ts +21 -0
- package/package/v-map/public/utils/base/string.d.ts +16 -0
- package/package/v-map/public/utils/base/transform.d.ts +12 -0
- package/package/v-map/public/utils/base/type.d.ts +88 -0
- package/package/v-map/public/utils/base/utils.d.ts +155 -0
- package/package/v-map/public/utils/base/validate.d.ts +54 -0
- package/package/v-map/public/utils/map/index.d.ts +15 -0
- package/package/v-map/public/utils/map/ol.d.ts +7 -0
- package/package/v-map/public/utils/map/transform.d.ts +1 -0
- package/package/v-map/public/utils/map/turf.d.ts +1 -0
- package/package/v-openlayers.css +1 -1
- package/package/v-openlayers.d.ts +35 -9578
- package/package/v-openlayers.mjs +31034 -82215
- package/package.json +3 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Style } from 'ol/style';
|
|
2
|
+
import { StyleLike, StyleFunction } from 'ol/style/Style.js';
|
|
3
|
+
import Feature from 'ol/Feature';
|
|
4
|
+
import { Geometry } from 'ol/geom';
|
|
5
|
+
interface CircleOptions {
|
|
6
|
+
color?: string;
|
|
7
|
+
radius?: number;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
interface IconOptions {
|
|
11
|
+
src?: string;
|
|
12
|
+
fromColor?: string;
|
|
13
|
+
toColor?: string;
|
|
14
|
+
scale?: number;
|
|
15
|
+
color?: string;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
interface StrokeOptions {
|
|
19
|
+
color?: string;
|
|
20
|
+
width?: number;
|
|
21
|
+
lineCap?: CanvasLineCap;
|
|
22
|
+
lineDash?: number[];
|
|
23
|
+
zIndex?: number;
|
|
24
|
+
}
|
|
25
|
+
interface FillOptions {
|
|
26
|
+
color?: string;
|
|
27
|
+
}
|
|
28
|
+
interface TextOptions {
|
|
29
|
+
field?: string;
|
|
30
|
+
color?: string;
|
|
31
|
+
backgroundColor?: string;
|
|
32
|
+
fontSize?: string;
|
|
33
|
+
padding?: number[];
|
|
34
|
+
offsetX?: number;
|
|
35
|
+
offsetY?: number;
|
|
36
|
+
rotation?: number;
|
|
37
|
+
textAlign?: 'left' | 'center' | 'right' | 'start' | 'end';
|
|
38
|
+
justify?: 'left' | 'center' | 'right';
|
|
39
|
+
textFormatter?: (feature: Feature<Geometry>, resolution: number) => string;
|
|
40
|
+
}
|
|
41
|
+
export interface StyleOptions {
|
|
42
|
+
circle?: CircleOptions;
|
|
43
|
+
icon?: IconOptions;
|
|
44
|
+
text?: TextOptions;
|
|
45
|
+
stroke?: StrokeOptions | StrokeOptions[];
|
|
46
|
+
fill?: FillOptions;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 获取SVG图标(支持颜色替换)
|
|
50
|
+
* @param url SVG图标URL
|
|
51
|
+
* @param toColor 目标颜色 十六进制格式
|
|
52
|
+
* @param fromColor 原始颜色 默认值为'currentColor'
|
|
53
|
+
* @returns 处理后的SVG数据URL
|
|
54
|
+
*/
|
|
55
|
+
export declare function getSvg(url: string, toColor: string, fromColor?: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* 获取样式对象
|
|
58
|
+
* @param options 样式选项
|
|
59
|
+
* @param options.stroke 描边选项
|
|
60
|
+
* @param options.fill 填充选项
|
|
61
|
+
* @param options.text 文本选项
|
|
62
|
+
* @param options.circle 圆形选项
|
|
63
|
+
* @param options.icon 图标选项
|
|
64
|
+
* @returns 样式对象或样式函数
|
|
65
|
+
*/
|
|
66
|
+
export declare function getStyle(options?: StyleOptions): StyleLike | Style | Style[] | StyleFunction | null;
|
|
67
|
+
/**
|
|
68
|
+
* 获取默认图标样式
|
|
69
|
+
* @returns 图标样式
|
|
70
|
+
*/
|
|
71
|
+
export declare function getIconStyle(): Style;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Map from 'ol/Map';
|
|
2
|
+
import { Circle } from 'ol/geom';
|
|
3
|
+
/**
|
|
4
|
+
* 将米转换为半径(基于地图投影单位)
|
|
5
|
+
* @param map 地图实例
|
|
6
|
+
* @param metersValue 米值
|
|
7
|
+
* @returns 半径值(地图投影单位)
|
|
8
|
+
*/
|
|
9
|
+
export declare function tranMeters2Radius(map: Map, metersValue: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* 将半径(地图投影单位)转换为米
|
|
12
|
+
* @param map 地图实例
|
|
13
|
+
* @param radius 半径值(地图投影单位)
|
|
14
|
+
* @returns 米值
|
|
15
|
+
*/
|
|
16
|
+
export declare function tranRadius2Meters(map: Map, radius: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* 将圆的半径转换为米(基于地理坐标计算)
|
|
19
|
+
* @param map 地图实例
|
|
20
|
+
* @param circle 圆几何对象
|
|
21
|
+
* @returns 米值
|
|
22
|
+
*/
|
|
23
|
+
export declare function tranRadius2Meters2(map: Map, circle: Circle): number;
|
|
24
|
+
/**
|
|
25
|
+
* GeoJSON转换为WKT格式
|
|
26
|
+
* @param geojson GeoJSON对象
|
|
27
|
+
* @returns WKT字符串
|
|
28
|
+
*/
|
|
29
|
+
export declare const geojsonToWkt: (geojson: object) => string;
|
|
30
|
+
/**
|
|
31
|
+
* WKT格式转换为GeoJSON
|
|
32
|
+
* @param wkt WKT字符串
|
|
33
|
+
* @returns GeoJSON对象
|
|
34
|
+
*/
|
|
35
|
+
export declare const wktToGeojson: (wkt: string) => object;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
interface IWMTSExplorerOptions {
|
|
2
|
+
serviceUrl: string;
|
|
3
|
+
version: string;
|
|
4
|
+
timeout: number;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @description WMTS服务探索器类
|
|
9
|
+
* 提供 WMTS 服务的 capabilities 加载、图层信息提取等功能
|
|
10
|
+
*/
|
|
11
|
+
export default class WMTSExplorer {
|
|
12
|
+
options: IWMTSExplorerOptions;
|
|
13
|
+
capabilities: any;
|
|
14
|
+
layers: any;
|
|
15
|
+
constructor(options: IWMTSExplorerOptions);
|
|
16
|
+
/**
|
|
17
|
+
* 获取并解析 WMTS 服务的 capabilities
|
|
18
|
+
*/
|
|
19
|
+
loadCapabilities(): Promise<any>;
|
|
20
|
+
loadLayerInfoByName(layerName: any): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* 提取所有图层信息
|
|
23
|
+
*/
|
|
24
|
+
extractLayersInfo(): any;
|
|
25
|
+
/**
|
|
26
|
+
* 解析单个图层信息
|
|
27
|
+
*/
|
|
28
|
+
parseLayerInfo(layerData: any): {
|
|
29
|
+
identifier: any;
|
|
30
|
+
title: any;
|
|
31
|
+
abstract: any;
|
|
32
|
+
format: any;
|
|
33
|
+
styles: any;
|
|
34
|
+
tileMatrixSetLinks: any;
|
|
35
|
+
wgs84Extent: any;
|
|
36
|
+
crs: any;
|
|
37
|
+
extent: any;
|
|
38
|
+
tileMatrixSets: any[];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* 查找指定的矩阵集
|
|
42
|
+
*/
|
|
43
|
+
findTileMatrixSet(identifier: any): any;
|
|
44
|
+
/**
|
|
45
|
+
* 获取图层的 extent
|
|
46
|
+
*/
|
|
47
|
+
getLayerExtent(layerIdentifier: any, targetCrs?: string): {
|
|
48
|
+
extent: import("ol/extent").Extent;
|
|
49
|
+
crs: string;
|
|
50
|
+
originalExtent: any;
|
|
51
|
+
originalCrs: any;
|
|
52
|
+
center: import("ol/coordinate").Coordinate;
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
} | {
|
|
56
|
+
extent: any;
|
|
57
|
+
crs: any;
|
|
58
|
+
center: import("ol/coordinate").Coordinate;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
originalExtent?: undefined;
|
|
62
|
+
originalCrs?: undefined;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* 获取所有图层信息
|
|
66
|
+
*/
|
|
67
|
+
getAllLayers(): any;
|
|
68
|
+
/**
|
|
69
|
+
* 搜索图层
|
|
70
|
+
*/
|
|
71
|
+
searchLayers(keyword: any): any[];
|
|
72
|
+
/**
|
|
73
|
+
* 创建 WMTS 图层配置
|
|
74
|
+
*/
|
|
75
|
+
createWMTSSourceConfig(layerIdentifier: any, matrixSetIdentifier: any, options?: any): {
|
|
76
|
+
url: string;
|
|
77
|
+
layer: any;
|
|
78
|
+
matrixSet: any;
|
|
79
|
+
format: any;
|
|
80
|
+
projection: any;
|
|
81
|
+
style: any;
|
|
82
|
+
extent: any;
|
|
83
|
+
crossOrigin: any;
|
|
84
|
+
wrapX: any;
|
|
85
|
+
metadata: {
|
|
86
|
+
extent: {
|
|
87
|
+
extent: import("ol/extent").Extent;
|
|
88
|
+
crs: string;
|
|
89
|
+
originalExtent: any;
|
|
90
|
+
originalCrs: any;
|
|
91
|
+
center: import("ol/coordinate").Coordinate;
|
|
92
|
+
width: number;
|
|
93
|
+
height: number;
|
|
94
|
+
} | {
|
|
95
|
+
extent: any;
|
|
96
|
+
crs: any;
|
|
97
|
+
center: import("ol/coordinate").Coordinate;
|
|
98
|
+
width: number;
|
|
99
|
+
height: number;
|
|
100
|
+
originalExtent?: undefined;
|
|
101
|
+
originalCrs?: undefined;
|
|
102
|
+
};
|
|
103
|
+
tileMatrixSet: any;
|
|
104
|
+
tileMatrixSetLimits: any;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import Filter from 'ol/format/filter/Filter.js';
|
|
2
|
+
interface RequestFeaturesByFilterOptions {
|
|
3
|
+
filter: Filter;
|
|
4
|
+
featureNS: string;
|
|
5
|
+
featurePrefix: string;
|
|
6
|
+
featureTypes: string[];
|
|
7
|
+
projection: string;
|
|
8
|
+
}
|
|
9
|
+
interface ITensactOptions {
|
|
10
|
+
featureType: string;
|
|
11
|
+
srsName: string;
|
|
12
|
+
featureNS: string;
|
|
13
|
+
transactType: string;
|
|
14
|
+
features: any[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @description: wfs工具类
|
|
18
|
+
*/
|
|
19
|
+
declare class WfsHandler {
|
|
20
|
+
constructor();
|
|
21
|
+
queryByCondition(url: any, options: any): Promise<any>;
|
|
22
|
+
handleGeometry(feature: any, geomName?: string): void;
|
|
23
|
+
transact(url: any, options: ITensactOptions): Promise<unknown>;
|
|
24
|
+
applyTransform(geometry: any): any;
|
|
25
|
+
/**
|
|
26
|
+
* 点查询(弃用)
|
|
27
|
+
* @param {*} param0 {featureNS,featurePrefix,featureTypes,coordinate,projection}
|
|
28
|
+
* @returns geojson
|
|
29
|
+
*/
|
|
30
|
+
requestFeatureByPoint({ featureNS, featurePrefix, featureTypes, coordinate, projection, }: {
|
|
31
|
+
featureNS?: string;
|
|
32
|
+
featurePrefix?: string;
|
|
33
|
+
featureTypes?: any[];
|
|
34
|
+
coordinate: any;
|
|
35
|
+
projection?: string;
|
|
36
|
+
}): Promise<any>;
|
|
37
|
+
/**
|
|
38
|
+
* 点查询
|
|
39
|
+
* @param {*} params
|
|
40
|
+
* @param {*} params.coordinate 坐标 [x,y]
|
|
41
|
+
* @param {*} params.featureNS 服务地址 http://ip/geoserver/
|
|
42
|
+
* @param {*} params.featurePrefix 工作空间
|
|
43
|
+
* @param {*} params.featureTypes 特征类型 [表名]
|
|
44
|
+
* @param {*} params.projection 投影 默认为EPSG:4326
|
|
45
|
+
* @returns promise
|
|
46
|
+
*/
|
|
47
|
+
requestFeaturesByPoint({ coordinate, featureNS, featurePrefix, featureTypes, projection, }: {
|
|
48
|
+
coordinate: any;
|
|
49
|
+
featureNS?: string;
|
|
50
|
+
featurePrefix?: string;
|
|
51
|
+
featureTypes?: any[];
|
|
52
|
+
projection?: string;
|
|
53
|
+
}): Promise<any>;
|
|
54
|
+
/**
|
|
55
|
+
* 自定义filter查询
|
|
56
|
+
* @param {Object} params
|
|
57
|
+
* @param {*} params.filter 自定义filter
|
|
58
|
+
* @param {*} params.featureNS 服务地址 http://ip/geoserver/
|
|
59
|
+
* @param {*} params.featurePrefix 工作空间
|
|
60
|
+
* @param {*} params.featureTypes 特征类型 [表名]
|
|
61
|
+
* @param {*} params.projection 投影 默认为EPSG:4326
|
|
62
|
+
* @returns promise
|
|
63
|
+
*/
|
|
64
|
+
requestFeaturesByFilter({ filter, featureNS, featurePrefix, featureTypes, projection, }: RequestFeaturesByFilterOptions): Promise<any>;
|
|
65
|
+
}
|
|
66
|
+
export default WfsHandler;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import WKT from 'ol/format/WKT';
|
|
2
|
+
import VectorLayer from 'ol/layer/Vector';
|
|
3
|
+
import Feature from 'ol/Feature';
|
|
4
|
+
import { Geometry } from 'ol/geom';
|
|
5
|
+
import { Style } from 'ol/style';
|
|
6
|
+
interface WktLayerOptions {
|
|
7
|
+
id?: string;
|
|
8
|
+
style?: Style;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @description WKT处理工具类
|
|
12
|
+
* 提供WKT与GeoJSON之间的相互转换功能
|
|
13
|
+
*/
|
|
14
|
+
export default class WktHandler extends WKT {
|
|
15
|
+
defaultStyle: Style;
|
|
16
|
+
constructor();
|
|
17
|
+
/**
|
|
18
|
+
* 将Feature转换为WKT格式
|
|
19
|
+
* @param feature Feature对象
|
|
20
|
+
* @returns WKT字符串
|
|
21
|
+
*/
|
|
22
|
+
feature2wkt(feature: Feature<Geometry>): string;
|
|
23
|
+
/**
|
|
24
|
+
* 将WKT转换为Feature对象
|
|
25
|
+
* @param wkt WKT字符串
|
|
26
|
+
* @returns Feature对象
|
|
27
|
+
*/
|
|
28
|
+
wkt2feature(wkt: string): Feature<Geometry>;
|
|
29
|
+
/**
|
|
30
|
+
* 将GeoJSON转换为WKT格式
|
|
31
|
+
* @param geojson GeoJSON对象
|
|
32
|
+
* @returns WKT字符串
|
|
33
|
+
*/
|
|
34
|
+
geojson2wkt(geojson: object): string;
|
|
35
|
+
/**
|
|
36
|
+
* 将WKT转换为GeoJSON格式
|
|
37
|
+
* @param wkt WKT字符串
|
|
38
|
+
* @returns GeoJSON对象
|
|
39
|
+
*/
|
|
40
|
+
wkt2geojson(wkt: string): object;
|
|
41
|
+
/**
|
|
42
|
+
* 将VectorLayer转换为WKT格式
|
|
43
|
+
* @param layer VectorLayer对象
|
|
44
|
+
* @returns WKT字符串
|
|
45
|
+
*/
|
|
46
|
+
layer2wkt(layer: VectorLayer<Feature<Geometry>> | null): string;
|
|
47
|
+
/**
|
|
48
|
+
* 将WKT转换为VectorLayer
|
|
49
|
+
* @param wkt WKT字符串
|
|
50
|
+
* @param options 图层选项
|
|
51
|
+
* @returns VectorLayer对象
|
|
52
|
+
*/
|
|
53
|
+
wkt2layer(wkt: string, options?: WktLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
54
|
+
/**
|
|
55
|
+
* 将GeoJSON转换为VectorLayer
|
|
56
|
+
* @param geojson GeoJSON对象
|
|
57
|
+
* @param options 图层选项
|
|
58
|
+
* @returns VectorLayer对象
|
|
59
|
+
*/
|
|
60
|
+
geojson2layer(geojson: object, options?: WktLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Map from 'ol/Map';
|
|
2
|
+
import TileLayer from 'ol/layer/Tile';
|
|
3
|
+
import TileWMS from 'ol/source/TileWMS';
|
|
4
|
+
/**
|
|
5
|
+
* @description: wms工具类
|
|
6
|
+
*/
|
|
7
|
+
interface RequestFeatureByPointParams {
|
|
8
|
+
layer: TileLayer<TileWMS>;
|
|
9
|
+
coordinate: [number, number];
|
|
10
|
+
projection?: string;
|
|
11
|
+
options?: Record<string, any>;
|
|
12
|
+
}
|
|
13
|
+
interface WmsRequestOptions {
|
|
14
|
+
INFO_FORMAT?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
declare class WmsHandler {
|
|
18
|
+
private map;
|
|
19
|
+
constructor(map: Map);
|
|
20
|
+
requestWmsFeature(map: Map, wmsLayer: TileLayer<TileWMS>, coordinate: [number, number], projection?: string, options?: WmsRequestOptions): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* 点查询
|
|
23
|
+
* @param params 参数
|
|
24
|
+
* @param params.layer wms layer 实例
|
|
25
|
+
* @param params.coordinate 点坐标 [x,y]
|
|
26
|
+
* @param params.projection 投影 默认为EPSG:4326
|
|
27
|
+
* @param params.options wms参数 默认为{ INFO_FORMAT: 'application/json' }
|
|
28
|
+
* @returns Promise<geojson>
|
|
29
|
+
*/
|
|
30
|
+
requestFeatureByPoint({ layer, coordinate, projection, options, }: RequestFeatureByPointParams): Promise<any>;
|
|
31
|
+
}
|
|
32
|
+
export default WmsHandler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createMapboxStreetsV6Style(e: any, t: any, o: any, a: any, r: any): (e: any, t: any) => any[];
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export interface IDefaultView {
|
|
2
|
+
center: number[]
|
|
3
|
+
zoom: number
|
|
4
|
+
minZoom?: number
|
|
5
|
+
maxZoom?: number
|
|
6
|
+
extent?: number[]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ILayerParams {
|
|
10
|
+
layer?: string
|
|
11
|
+
tilematrixset?: string
|
|
12
|
+
matrixSetPrefix?: string
|
|
13
|
+
format?: string
|
|
14
|
+
k?: string
|
|
15
|
+
[key: string]: any
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ILayerConfig {
|
|
19
|
+
id: string
|
|
20
|
+
label: string
|
|
21
|
+
visible?: boolean
|
|
22
|
+
opacity?: number
|
|
23
|
+
type?: string
|
|
24
|
+
image?: string
|
|
25
|
+
url?: string
|
|
26
|
+
order?: string | number
|
|
27
|
+
children?: ILayerConfig[]
|
|
28
|
+
minZoom?: number
|
|
29
|
+
extent?: number[]
|
|
30
|
+
params?: ILayerParams
|
|
31
|
+
requestParams?: ILayerParams
|
|
32
|
+
origin?: number[]
|
|
33
|
+
[key: string]: any
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface IMaskLayerStyleFill {
|
|
37
|
+
color: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface IMaskLayerStyleStroke {
|
|
41
|
+
color: string
|
|
42
|
+
width: number
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface IMaskLayerStyle {
|
|
46
|
+
fill?: IMaskLayerStyleFill
|
|
47
|
+
stroke?: IMaskLayerStyleStroke
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface IMaskLayer {
|
|
51
|
+
id: string
|
|
52
|
+
label: string
|
|
53
|
+
visible: boolean
|
|
54
|
+
zIndex: number
|
|
55
|
+
style: IMaskLayerStyle
|
|
56
|
+
outerPolygon: number[][]
|
|
57
|
+
innerPolygons: number[][][]
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ILayerTreeItem {
|
|
61
|
+
id: string | number
|
|
62
|
+
label: string
|
|
63
|
+
visible?: boolean
|
|
64
|
+
type?: string
|
|
65
|
+
children?: ILayerTreeItem[]
|
|
66
|
+
url?: string
|
|
67
|
+
minZoom?: number
|
|
68
|
+
opacity?: number
|
|
69
|
+
params?: ILayerParams
|
|
70
|
+
extent?: number[]
|
|
71
|
+
[key: string]: any
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface IMapConfig {
|
|
75
|
+
prj: string
|
|
76
|
+
defaultView: IDefaultView
|
|
77
|
+
fullExtent?: number[]
|
|
78
|
+
tdtToken?: string
|
|
79
|
+
defaultBaseLayerId?: string
|
|
80
|
+
baseLayers?: ILayerConfig[]
|
|
81
|
+
businessLayers?: ILayerTreeItem[]
|
|
82
|
+
maskLayer?: IMaskLayer
|
|
83
|
+
[key: string]: any
|
|
84
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default class GradientColor {
|
|
2
|
+
/**
|
|
3
|
+
* @description: 创建渐变颜色
|
|
4
|
+
* @param {string} startColor 开始颜色
|
|
5
|
+
* @param {string} endColor 结束颜色
|
|
6
|
+
* @param {number} step 步数
|
|
7
|
+
* @param {number} opacity 透明度,默认1 可选0-1
|
|
8
|
+
* @param {string} format 格式,默认rgba,可选rgba,array,hex
|
|
9
|
+
* @return {Array} 颜色数组
|
|
10
|
+
*/
|
|
11
|
+
create(startColor: any, endColor: any, step: any, opacity?: number, format?: string): any[];
|
|
12
|
+
colorRgb(sColor: any): any;
|
|
13
|
+
colorHex(rgb: any): any;
|
|
14
|
+
rgbaToArray(rgbaString: any): number[];
|
|
15
|
+
/**
|
|
16
|
+
* @description: 将rgba字符串转换为hex字符串
|
|
17
|
+
* @param {string} rgbaString rgba字符串
|
|
18
|
+
* @return {string} hex字符串
|
|
19
|
+
*/
|
|
20
|
+
rgbaToHex(rgbaString?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* @description: 将hex字符串转换为rgba数组
|
|
23
|
+
* @param {string} hexString hex字符串
|
|
24
|
+
* @return {array} rgba数组
|
|
25
|
+
*/
|
|
26
|
+
hexToRgba(hexString: any): number[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 获取随机rgb颜色
|
|
3
|
+
* @returns 随机rgba颜色字符串
|
|
4
|
+
*/
|
|
5
|
+
export declare function getRandomRgb(): string;
|
|
6
|
+
/**
|
|
7
|
+
* @description: 获取随机rgba颜色
|
|
8
|
+
* @param {*} a 透明度
|
|
9
|
+
* @returns 随机rgba颜色字符串
|
|
10
|
+
*/
|
|
11
|
+
export declare function getRandomRgba(a?: number): string;
|
|
12
|
+
/**
|
|
13
|
+
* @description: 获取随机颜色
|
|
14
|
+
* @param {*} bHex true为16进制格式,false为rgb格式
|
|
15
|
+
* @returns 随机颜色字符串
|
|
16
|
+
*/
|
|
17
|
+
export declare function getRandomColor(bHex?: boolean): string;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 加载样式文件
|
|
3
|
+
* @param {*} url 样式地址
|
|
4
|
+
*/
|
|
5
|
+
export declare function loadStyles(url: any): void;
|
|
6
|
+
/**
|
|
7
|
+
* @description: 获取请求地址指定参数值
|
|
8
|
+
* @param {*} url 地址
|
|
9
|
+
* @param {*} name 查询参数
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare function getQueryValueByUrl(url: any, name: any): string;
|
|
13
|
+
/**
|
|
14
|
+
* @description: 按指定属性分组
|
|
15
|
+
* @param {*} arr 数组
|
|
16
|
+
* @param {*} groupId 分组id
|
|
17
|
+
* @returns 数组
|
|
18
|
+
*/
|
|
19
|
+
export declare function groupBy(arr?: any[], groupId?: string): any[];
|
|
20
|
+
/**
|
|
21
|
+
* @description: 树结构转换为列表结构
|
|
22
|
+
* @param {*} treeList tree
|
|
23
|
+
* @param {*} list list
|
|
24
|
+
* @returns 数组
|
|
25
|
+
*/
|
|
26
|
+
export declare function tree2list(treeList: any, list: any): void;
|
|
27
|
+
/**
|
|
28
|
+
* @description: 获取request地址请求参数对象转换
|
|
29
|
+
* @param {*} url request地址
|
|
30
|
+
* @returns 对象
|
|
31
|
+
*/
|
|
32
|
+
export declare function parasUrlParams2Obj(url: any): {};
|
|
33
|
+
/**
|
|
34
|
+
* @description: 获取随机整数
|
|
35
|
+
* @param {*} start 开始值
|
|
36
|
+
* @param {*} end 结束值
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
export declare function getRandomIntNumberByRange(start: any, end: any): number;
|
|
40
|
+
/**
|
|
41
|
+
* @description: 获取随机小数
|
|
42
|
+
* @param {*} start 开始值
|
|
43
|
+
* @param {*} end 结束值
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
export declare function getRandomFloatNumberByRange(start: any, end: any): any;
|
|
47
|
+
/**
|
|
48
|
+
* @description: csv字符串转换为数组
|
|
49
|
+
* @param {*} str csv字符串
|
|
50
|
+
* @returns 数组
|
|
51
|
+
*/
|
|
52
|
+
export declare function csv2Array(str: any): any;
|
|
53
|
+
/**
|
|
54
|
+
* @description: 对象转换为数组
|
|
55
|
+
* @param {*} properties 对象
|
|
56
|
+
* @returns 数组
|
|
57
|
+
*/
|
|
58
|
+
export declare function object2Array(properties: any): any[];
|
|
59
|
+
/**
|
|
60
|
+
* @description: 拷贝对象(深度)
|
|
61
|
+
* @param {*} obj 拷贝的对象
|
|
62
|
+
* @returns 拷贝后的对象
|
|
63
|
+
*/
|
|
64
|
+
export declare function deepClone(obj?: {}): any;
|
|
65
|
+
/**
|
|
66
|
+
* @description: 为树结构设置随机id
|
|
67
|
+
* @param {*} treeList 树结构
|
|
68
|
+
* @param {*} idStr id字段名
|
|
69
|
+
* @param {*} childStr 子字段名
|
|
70
|
+
*/
|
|
71
|
+
export declare function setUuidForTree(treeList: any, idStr?: string, childStr?: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* @description: 获取随机数
|
|
74
|
+
* @param {*} min 开始值
|
|
75
|
+
* @param {*} max 结束值
|
|
76
|
+
* @returns
|
|
77
|
+
*/
|
|
78
|
+
export declare function getRandomNum(min?: number, max?: number): number;
|
|
79
|
+
/**
|
|
80
|
+
* @description: 判断对象是否为空null或undefined
|
|
81
|
+
* @param {*} obj 对象
|
|
82
|
+
* @returns
|
|
83
|
+
*/
|
|
84
|
+
export declare function isNullOrUndifiend(obj: any): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* @description: 数组添加元素(不重复 )
|
|
87
|
+
* @param {*} arr 数组
|
|
88
|
+
* @param {*} item 元素
|
|
89
|
+
* @param {*} isAdd 是否添加
|
|
90
|
+
*/
|
|
91
|
+
export declare function pushNoReapeat(arr: any, item: any, isAdd: any): void;
|
|
92
|
+
/**
|
|
93
|
+
* @description: 数组删除元素
|
|
94
|
+
* @param {*} arr 数组
|
|
95
|
+
* @param {*} item 元素
|
|
96
|
+
*/
|
|
97
|
+
export declare function removeArrayItem(arr: any, item: any): any;
|
|
98
|
+
/**
|
|
99
|
+
* @description: 数组去重
|
|
100
|
+
* @param {*} arr 数组
|
|
101
|
+
* @returns 去重后的数组
|
|
102
|
+
*/
|
|
103
|
+
export declare function removeRepeat(arr: any): any[];
|
|
104
|
+
/**
|
|
105
|
+
* @description: 获取随机rgb颜色
|
|
106
|
+
* @returns 随机rgba颜色字符串
|
|
107
|
+
*/
|
|
108
|
+
export declare function getRandomRgb(): string;
|
|
109
|
+
/**
|
|
110
|
+
* @description: 获取随机rgba颜色
|
|
111
|
+
* @param {*} a 透明度
|
|
112
|
+
* @returns 随机rgba颜色字符串
|
|
113
|
+
*/
|
|
114
|
+
export declare function getRandomRgba(a?: number): string;
|
|
115
|
+
/**
|
|
116
|
+
* @description: 获取随机颜色
|
|
117
|
+
* @param {*} bHex true为16进制格式,false为rgb格式
|
|
118
|
+
* @returns 随机颜色字符串
|
|
119
|
+
*/
|
|
120
|
+
export declare function getRandomColor(bHex?: boolean): string;
|
|
121
|
+
/**
|
|
122
|
+
* @description: 复制字符串到剪贴板
|
|
123
|
+
* @param {*} str 要复制的字符串
|
|
124
|
+
* @param {*} callback 回调函数 参数为复制结果
|
|
125
|
+
*/
|
|
126
|
+
export declare function copy(str: any, callback?: any): Promise<void>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 根据指定时间间隔划分指定时间范围
|
|
3
|
+
* @param {*} interval 时间间隔
|
|
4
|
+
* @param {*} timeList 时间范围
|
|
5
|
+
* @returns 时间数组
|
|
6
|
+
*/
|
|
7
|
+
export declare function CustomTimeSegment(interval?: number, timeList?: string[]): any[];
|
|
8
|
+
export declare function dateFormat(dateObj: any, formatStr: any): any;
|
|
9
|
+
/**
|
|
10
|
+
* @description: 将任意格式的日期转换为Date类型(推荐)
|
|
11
|
+
* @param {*} date 日期
|
|
12
|
+
* @param {boolean} allowNull 转换结果是否允许为null
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare function convertAnyToDate(date: any, allowNull?: boolean): any;
|
|
16
|
+
/**
|
|
17
|
+
* @description: 时间戳转换为时间字符串
|
|
18
|
+
* @param {*} timeStamp 时间戳
|
|
19
|
+
* @param {*} format 格式
|
|
20
|
+
* @returns 时间字符串
|
|
21
|
+
*/
|
|
22
|
+
export declare function timestamp2String(timeStamp: any, format: any): any;
|
|
23
|
+
/**
|
|
24
|
+
* @description: 后count天D,小时H,默认D
|
|
25
|
+
* @param {*} count 间隔
|
|
26
|
+
* @param {*} data 传入的时间
|
|
27
|
+
* @param {*} type 类型 D,H
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatDateTimeCount(count: any, data: any, countType: any, formatType: any): string;
|
|
31
|
+
/**
|
|
32
|
+
* @description: 日期格式化(推荐)
|
|
33
|
+
* @param {*} date 日期
|
|
34
|
+
* @param {*} day 间隔天数
|
|
35
|
+
* @param {*} hours 间隔小时数
|
|
36
|
+
* @param {*} minutes 间隔分钟数
|
|
37
|
+
* @param {*} seconds 间隔秒数
|
|
38
|
+
* @param {*} endWithDay 是否只返回日期
|
|
39
|
+
* @param {*} endWithHour 是否只返回小时
|
|
40
|
+
* @param {*} endWithMinute 是否只返回分钟
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
export declare function dateFormatterA({ date, day, hours, minutes, seconds, endWithDay, endWithHour, endWithMinute, }?: {
|
|
44
|
+
date?: any;
|
|
45
|
+
day?: number;
|
|
46
|
+
hours?: number;
|
|
47
|
+
minutes?: number;
|
|
48
|
+
seconds?: number;
|
|
49
|
+
endWithDay?: boolean;
|
|
50
|
+
endWithHour?: boolean;
|
|
51
|
+
endWithMinute?: boolean;
|
|
52
|
+
}): string;
|