cd-mapgis 1.1.28 → 1.1.30
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.json +1 -1
- package/src/HttpUtil.js +0 -4
- package/src/OM.js +2 -2
- package/src/index.d.ts +64 -23
package/package.json
CHANGED
package/src/HttpUtil.js
CHANGED
|
@@ -63,8 +63,6 @@ export default class httpUtil {
|
|
|
63
63
|
xhr.setRequestHeader(h.key, h.value)
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
66
|
xhr.onreadystatechange = function () {
|
|
69
67
|
if (xhr.status === 200) {
|
|
70
68
|
if (xhr.readyState == 4) {
|
|
@@ -74,8 +72,6 @@ export default class httpUtil {
|
|
|
74
72
|
resolve(xhr.responseText)
|
|
75
73
|
}
|
|
76
74
|
} else {
|
|
77
|
-
console.log('post请求错误,url::', url);
|
|
78
|
-
//console.log('params:', data);
|
|
79
75
|
console.error('post请求错误:', xhr)
|
|
80
76
|
reject({
|
|
81
77
|
status: xhr.status,
|
package/src/OM.js
CHANGED
|
@@ -237,9 +237,9 @@ export default class OM {
|
|
|
237
237
|
}
|
|
238
238
|
//直接加载固定的geoServer图层
|
|
239
239
|
if (p.geoLayers && p.geoLayers.length > 0) {
|
|
240
|
-
postRes = await OM.getDic("
|
|
240
|
+
postRes = await OM.getDic("geoserverRead");
|
|
241
241
|
if (!postRes.data) {
|
|
242
|
-
throw new Error("未配置
|
|
242
|
+
throw new Error("未配置geoserverRead");
|
|
243
243
|
}
|
|
244
244
|
let geoserverDic = JSON.parse(postRes.data);
|
|
245
245
|
let wmsUrl = geoserverDic.url + '/' + geoserverDic.workspace + '/wms';
|
package/src/index.d.ts
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
declare module 'cd-mapgis' {
|
|
2
2
|
export class MapView {
|
|
3
|
+
static Instance: MapView | null;
|
|
4
|
+
static CHINA_EXTENT: [number, number, number, number];
|
|
3
5
|
constructor(p: any);
|
|
4
6
|
layerGroupViewOne(group: string, key: string): void;
|
|
5
7
|
viewOnTemplayer(p: any): void;
|
|
6
8
|
clearTemplayer(): void;
|
|
7
|
-
expandExtent():
|
|
9
|
+
expandExtent(extent: number[]): number[];
|
|
8
10
|
setCenter(center: [number, number], useAnimation?: boolean): void;
|
|
9
11
|
setZoom(zoom: number): void;
|
|
10
12
|
addEvent(name: string, fun: any): any;
|
|
11
13
|
addEventOnce(name: string, fun: any): void;
|
|
12
14
|
removeEvent(key: any): void;
|
|
13
15
|
viewMousePoint(call: any): void;
|
|
14
|
-
startDraw(type:
|
|
16
|
+
startDraw(type: 'Polygon' | 'Point' | 'LineString', fun: any): void;
|
|
15
17
|
tool(type: string): void;
|
|
16
18
|
clearDraw(): void;
|
|
17
|
-
viewToLayer(layer: any):
|
|
19
|
+
viewToLayer(layer: any): boolean;
|
|
20
|
+
dragPan(flag: boolean): void;
|
|
21
|
+
startSwipe(layer: any, model: number): void;
|
|
22
|
+
closeSwipe(): void;
|
|
23
|
+
reSet(): void;
|
|
24
|
+
getVisiblePolygon(): number[][];
|
|
18
25
|
}
|
|
19
26
|
export class OM {
|
|
20
|
-
static map: any;
|
|
21
|
-
static view: any;
|
|
22
|
-
static initMap(p: {
|
|
23
|
-
target?: string;
|
|
24
|
-
center?: [number, number];
|
|
25
|
-
zoom?: number;
|
|
26
|
-
projection?: string;
|
|
27
|
-
layers?: any[];
|
|
28
|
-
}): void;
|
|
29
|
-
static viewOnTemplayer(p: {
|
|
30
|
-
data: string;
|
|
31
|
-
}): void;
|
|
32
|
-
static expandExtent(extent: number[]): number[];
|
|
33
|
-
static addOverlay(p: { html: string, point: number[], positioning?: string }): void;
|
|
34
27
|
static initParam(params: any): void;
|
|
35
28
|
static post(url: string, data: any): Promise<any>;
|
|
29
|
+
static getIp(text: string): string;
|
|
36
30
|
static getDic(key: string): Promise<any>;
|
|
31
|
+
static getPushLayer(p: any): Promise<any>;
|
|
32
|
+
static getBound(p: any): Promise<any>;
|
|
33
|
+
static queryByPoint(p: any): Promise<any>;
|
|
34
|
+
static updateLayerAttr(p: any): Promise<any>;
|
|
35
|
+
static saveGeometryAndAttr(p: any): Promise<any>;
|
|
36
|
+
static removeGeometry(p: any): Promise<any>;
|
|
37
37
|
static getLayerAttrPage(p: any): Promise<any>;
|
|
38
38
|
static clip(p: any): Promise<any>;
|
|
39
39
|
static overlaps(p: any): Promise<any>;
|
|
40
40
|
static total(p: any): Promise<any>;
|
|
41
41
|
static buffer(p: any): Promise<any>;
|
|
42
|
-
static getBound(p: any): Promise<any>;
|
|
43
42
|
static checkPushLayers(p: any): Promise<any>;
|
|
44
|
-
static getLayerAttr(p: any): Promise<any>;
|
|
45
43
|
static getAddressByPoint(p: any): Promise<any>;
|
|
44
|
+
static getFields(p: any): Promise<any>;
|
|
45
|
+
static exportLayerAttr(p: { tableName: string }): void;
|
|
46
46
|
static viewLayers(p: any): Promise<any>;
|
|
47
|
-
static
|
|
47
|
+
static fitToLayer(p: any): Promise<void>;
|
|
48
48
|
}
|
|
49
49
|
export class LayerUtil {
|
|
50
50
|
static _tdt_map: {
|
|
@@ -75,20 +75,61 @@ declare module 'cd-mapgis' {
|
|
|
75
75
|
};
|
|
76
76
|
}): any;
|
|
77
77
|
static getWmtsLayer(p: {
|
|
78
|
-
|
|
78
|
+
urlPre: string;
|
|
79
|
+
urlNext?: string;
|
|
79
80
|
}): Promise<any>;
|
|
80
81
|
static getJsonLayer(p: any): any;
|
|
82
|
+
static getWktLayer(p: any): any;
|
|
83
|
+
static getTracePointsLayer(p: any): any;
|
|
81
84
|
static getJsonPointsLayer(p: any): any;
|
|
82
85
|
static getJsonPolygonsLayer(p: any): any;
|
|
86
|
+
static getPolygonsLayer(p: any): any;
|
|
87
|
+
static getPolygonLayerByRect(p: any): any;
|
|
88
|
+
static getPolygonLayerByPoints(p: any): any;
|
|
83
89
|
}
|
|
84
90
|
export class Overlay {
|
|
85
91
|
constructor(data: any);
|
|
86
92
|
addToMap(map: any): void;
|
|
87
93
|
remove(map: any): void;
|
|
88
94
|
}
|
|
89
|
-
export class
|
|
95
|
+
export class HttpUtil {
|
|
90
96
|
static get(url: string): Promise<any>;
|
|
91
|
-
static post(url: string, data?: any, headers?:
|
|
97
|
+
static post(url: string, data?: any, headers?: any[]): Promise<any>;
|
|
98
|
+
}
|
|
99
|
+
export class InnerUtil {
|
|
100
|
+
static getGeoServerUrl(url: string, host?: string): string;
|
|
101
|
+
static getWktByRect(rect: number[]): string;
|
|
102
|
+
static getWktByPoints(data: number[][]): string;
|
|
103
|
+
static registCompass(p: any): void;
|
|
104
|
+
}
|
|
105
|
+
export class StyleUtil {
|
|
106
|
+
static getViewOnTemplayerStyle(): any;
|
|
107
|
+
static getMapDrawStyle(): any;
|
|
108
|
+
static getInteractionStyle(): any;
|
|
109
|
+
static getIcon(p: any): any;
|
|
110
|
+
static getText(p: any): any;
|
|
111
|
+
static getPointStyle(p: any): any;
|
|
112
|
+
static getPolygonStyle(p: any): any;
|
|
113
|
+
static getCommStyle(p: any): any;
|
|
114
|
+
}
|
|
115
|
+
export class Location {
|
|
116
|
+
constructor(p: any);
|
|
117
|
+
mark(point: [number, number]): void;
|
|
118
|
+
}
|
|
119
|
+
export class PointLayer {
|
|
120
|
+
constructor(p: any);
|
|
121
|
+
addPoint(p: any): void;
|
|
122
|
+
addPoints(points: any[]): void;
|
|
123
|
+
clearAll(): void;
|
|
124
|
+
onClick(callback: (feature: any, event: any) => void): void;
|
|
125
|
+
fitToLayer(p?: any): void;
|
|
126
|
+
}
|
|
127
|
+
export class LineLayer {
|
|
128
|
+
constructor(p: any);
|
|
129
|
+
addLine(p: any): void;
|
|
130
|
+
addLines(lines: any[]): void;
|
|
131
|
+
onClick(callback: (feature: any, event: any) => void): void;
|
|
132
|
+
fitToLayer(p?: any): void;
|
|
92
133
|
}
|
|
93
134
|
}
|
|
94
135
|
|