cd-mapgis 1.1.32 → 1.1.34
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/StyleUtil.js +2 -0
- package/src/index.d.ts +27 -0
- package/src/index.js +3 -1
package/package.json
CHANGED
package/src/StyleUtil.js
CHANGED
|
@@ -223,6 +223,7 @@ export default class StyleUtil {
|
|
|
223
223
|
case 'LineString':
|
|
224
224
|
case 'MultiLineString':
|
|
225
225
|
styleParam.stroke = StyleUtil._getStyle_stroke(style);
|
|
226
|
+
styleParam.text = StyleUtil._getStyle_text(style);
|
|
226
227
|
break;
|
|
227
228
|
// 面 / 多面 / 圆
|
|
228
229
|
case 'Polygon':
|
|
@@ -230,6 +231,7 @@ export default class StyleUtil {
|
|
|
230
231
|
case 'Circle':
|
|
231
232
|
styleParam.stroke = StyleUtil._getStyle_stroke(style);
|
|
232
233
|
styleParam.fill = StyleUtil._getStyle_fill(style);
|
|
234
|
+
styleParam.text = StyleUtil._getStyle_text(style);
|
|
233
235
|
break;
|
|
234
236
|
default:
|
|
235
237
|
console.error("获取样式不支持的几何类型:" + geoType);
|
package/src/index.d.ts
CHANGED
|
@@ -128,4 +128,31 @@ declare module 'cd-mapgis' {
|
|
|
128
128
|
onClick(callback: (feature: any, event: any) => void): void;
|
|
129
129
|
fitToLayer(p?: any): void;
|
|
130
130
|
}
|
|
131
|
+
export type DataLayerDataType =
|
|
132
|
+
| 'geometry'
|
|
133
|
+
| 'geoJson'
|
|
134
|
+
| 'LinePoints'
|
|
135
|
+
| 'PolygonPoints'
|
|
136
|
+
| 'point';
|
|
137
|
+
export interface DataLayerData {
|
|
138
|
+
data: any;
|
|
139
|
+
dataType?: DataLayerDataType;
|
|
140
|
+
style?: any;
|
|
141
|
+
attr?: any;
|
|
142
|
+
}
|
|
143
|
+
export interface DataLayerOptions {
|
|
144
|
+
mapView?: MapView | null;
|
|
145
|
+
style?: any;
|
|
146
|
+
click?: (feature: any, event: any) => void;
|
|
147
|
+
dataType?: DataLayerDataType;
|
|
148
|
+
}
|
|
149
|
+
export interface DataLayerFitOptions {
|
|
150
|
+
zoom?: number;
|
|
151
|
+
}
|
|
152
|
+
export class DataLayer {
|
|
153
|
+
constructor(p: DataLayerOptions);
|
|
154
|
+
add(data: DataLayerData | DataLayerData[]): void;
|
|
155
|
+
onClick(callback: (feature: any, event: any) => void): void;
|
|
156
|
+
fitToLayer(p?: DataLayerFitOptions): void;
|
|
157
|
+
}
|
|
131
158
|
}
|
package/src/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import StyleUtil from './StyleUtil.js';
|
|
|
9
9
|
import Location from './Location.js';
|
|
10
10
|
import PointLayer from './PointLayer.js';
|
|
11
11
|
import LineLayer from './LineLayer.js';
|
|
12
|
+
import DataLayer from './DataLayer.js';
|
|
12
13
|
|
|
13
14
|
// 导出模块
|
|
14
15
|
export {
|
|
@@ -21,5 +22,6 @@ export {
|
|
|
21
22
|
StyleUtil,
|
|
22
23
|
Location,
|
|
23
24
|
PointLayer,
|
|
24
|
-
LineLayer
|
|
25
|
+
LineLayer,
|
|
26
|
+
DataLayer
|
|
25
27
|
};
|