@vtx/cs-map 1.0.34 → 1.0.36
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/README.md +202 -202
- package/lib/_util/EventEmitter.js +2 -1
- package/lib/_util/EventEmitter.js.map +1 -1
- package/lib/_util/Provider.js +4 -2
- package/lib/_util/Provider.js.map +1 -1
- package/lib/_util/filterSpecialCharacters.js +6 -6
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/generateRandomPosition.js +7 -6
- package/lib/_util/generateRandomPosition.js.map +1 -1
- package/lib/_util/getBBoxFromGeojson.js +68 -0
- package/lib/_util/getBBoxFromGeojson.js.map +1 -0
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getCookie.js +6 -5
- package/lib/_util/getCookie.js.map +1 -1
- package/lib/_util/getDefaultMapInfo.js +2 -1
- package/lib/_util/getDefaultMapInfo.js.map +1 -1
- package/lib/_util/getSystemInfo.js +2 -1
- package/lib/_util/getSystemInfo.js.map +1 -1
- package/lib/_util/getToken.js +2 -1
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js +2 -1
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/http.js +20 -19
- package/lib/_util/http.js.map +1 -1
- package/lib/_util/isFunction.js.map +1 -1
- package/lib/_util/isObject.js.map +1 -1
- package/lib/_util/layer.js +28 -24
- package/lib/_util/layer.js.map +1 -1
- package/lib/_util/mapTool.js +36 -35
- package/lib/_util/mapTool.js.map +1 -1
- package/lib/_util/setCookie.js +6 -5
- package/lib/_util/setCookie.js.map +1 -1
- package/lib/_util/transformRgb.js +2 -1
- package/lib/_util/transformRgb.js.map +1 -1
- package/lib/_util/useColSize.js +2 -1
- package/lib/_util/useColSize.js.map +1 -1
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useProps.js +2 -1
- package/lib/_util/useProps.js.map +1 -1
- package/lib/_util/useSet.js +2 -1
- package/lib/_util/useSet.js.map +1 -1
- package/lib/cesium-tiles-layer/CesiumTilesLayer.js +2 -1
- package/lib/cesium-tiles-layer/CesiumTilesLayer.js.map +1 -1
- package/lib/cesium-tiles-layer/style/css.js.map +1 -1
- package/lib/cesium-tiles-layer/style/index.js.map +1 -1
- package/lib/circle/circle.js +2 -1
- package/lib/circle/circle.js.map +1 -1
- package/lib/circle/index.js.map +1 -1
- package/lib/config.js +2 -1
- package/lib/config.js.map +1 -1
- package/lib/demand-layer/DemandLayer.js +410 -0
- package/lib/demand-layer/DemandLayer.js.map +1 -0
- package/lib/demand-layer/index.js +104 -0
- package/lib/demand-layer/index.js.map +1 -0
- package/lib/demand-layer/style/css.js +4 -0
- package/lib/demand-layer/style/css.js.map +1 -0
- package/lib/demand-layer/style/index.css +0 -0
- package/lib/demand-layer/style/index.js +4 -0
- package/lib/demand-layer/style/index.js.map +1 -0
- package/lib/demand-layer/style/index.less +0 -0
- package/lib/events/index.js +4 -2
- package/lib/events/index.js.map +1 -1
- package/lib/feature-layer/FeatureLayer.js +2 -1
- package/lib/feature-layer/FeatureLayer.js.map +1 -1
- package/lib/feature-layer/createFeatureCollection.js +23 -17
- package/lib/feature-layer/createFeatureCollection.js.map +1 -1
- package/lib/feature-layer/index.js.map +1 -1
- package/lib/feature-layer/style/css.js.map +1 -1
- package/lib/feature-layer/style/index.js.map +1 -1
- package/lib/fly-line-layer/FlyLineLayer.js +2 -1
- package/lib/fly-line-layer/FlyLineLayer.js.map +1 -1
- package/lib/fly-line-layer/lineFlowMaterialProperty.js +2 -1
- package/lib/fly-line-layer/lineFlowMaterialProperty.js.map +1 -1
- package/lib/fly-line-layer/style/css.js.map +1 -1
- package/lib/fly-line-layer/style/index.js.map +1 -1
- package/lib/gif-dom-layer/GifDomLayer.js +2 -1
- package/lib/gif-dom-layer/GifDomLayer.js.map +1 -1
- package/lib/gif-dom-layer/index.js.map +1 -1
- package/lib/gif-dom-layer/style/css.js.map +1 -1
- package/lib/gif-dom-layer/style/index.js.map +1 -1
- package/lib/gradation-line-layer/GradationLineLayer.js +2 -1
- package/lib/gradation-line-layer/GradationLineLayer.js.map +1 -1
- package/lib/gradation-line-layer/index.js.map +1 -1
- package/lib/gradation-line-layer/style/css.js.map +1 -1
- package/lib/gradation-line-layer/style/index.js.map +1 -1
- package/lib/group-layer/GroupLayer.js +2 -1
- package/lib/group-layer/GroupLayer.js.map +1 -1
- package/lib/group-layer/index.js.map +1 -1
- package/lib/group-layer/style/css.js.map +1 -1
- package/lib/group-layer/style/index.js.map +1 -1
- package/lib/heatmap-layer/CesiumHeatmap.js +2 -1
- package/lib/heatmap-layer/CesiumHeatmap.js.map +1 -1
- package/lib/heatmap-layer/HeatmapLayer.js +2 -1
- package/lib/heatmap-layer/HeatmapLayer.js.map +1 -1
- package/lib/heatmap-layer/heatmap.js +43 -42
- package/lib/heatmap-layer/heatmap.js.map +1 -1
- package/lib/highlight-layer/HighlightLayer.js +2 -1
- package/lib/highlight-layer/HighlightLayer.js.map +1 -1
- package/lib/highlight-layer/index.js.map +1 -1
- package/lib/highlight-layer/style/css.js.map +1 -1
- package/lib/highlight-layer/style/index.js.map +1 -1
- package/lib/image-layer/ImageLayer.js +4 -2
- package/lib/image-layer/ImageLayer.js.map +1 -1
- package/lib/image-layer/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/label/Label.js +2 -1
- package/lib/label/Label.js.map +1 -1
- package/lib/label/index.js.map +1 -1
- package/lib/legend/index.js +2 -1
- package/lib/legend/index.js.map +1 -1
- package/lib/legend/style/css.js.map +1 -1
- package/lib/legend/style/index.js.map +1 -1
- package/lib/legend/style/index.less +63 -63
- package/lib/line-flow-layer/LineFlowLayer.js +2 -1
- package/lib/line-flow-layer/LineFlowLayer.js.map +1 -1
- package/lib/line-flow-layer/style/css.js.map +1 -1
- package/lib/line-flow-layer/style/index.js.map +1 -1
- package/lib/map/InfoTool/index.js +45 -44
- package/lib/map/InfoTool/index.js.map +1 -1
- package/lib/map/InfoTool/index.less +46 -46
- package/lib/map/InfoTool/util.js +25 -24
- package/lib/map/InfoTool/util.js.map +1 -1
- package/lib/map/InfoWindow.js.map +1 -1
- package/lib/map/Layers.js +2 -1
- package/lib/map/Layers.js.map +1 -1
- package/lib/map/Popup.js +10 -7
- package/lib/map/Popup.js.map +1 -1
- package/lib/map/base/imagery/amap/AmapImageryProvider.js +2 -1
- package/lib/map/base/imagery/amap/AmapImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/amap/AmapMercatorTilingScheme.js +2 -1
- package/lib/map/base/imagery/amap/AmapMercatorTilingScheme.js.map +1 -1
- package/lib/map/base/imagery/baidu/BaiduImageryProvider.js +2 -1
- package/lib/map/base/imagery/baidu/BaiduImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/baidu/BaiduMercatorProjection.js +79 -78
- package/lib/map/base/imagery/baidu/BaiduMercatorProjection.js.map +1 -1
- package/lib/map/base/imagery/baidu/BaiduMercatorTilingScheme.js +15 -14
- package/lib/map/base/imagery/baidu/BaiduMercatorTilingScheme.js.map +1 -1
- package/lib/map/base/imagery/geoq/GeoQImageryProvider.js +2 -1
- package/lib/map/base/imagery/geoq/GeoQImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/google/GoogleImageryProvider.js +2 -1
- package/lib/map/base/imagery/google/GoogleImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/tdt/TdtImageryProvider.js +2 -1
- package/lib/map/base/imagery/tdt/TdtImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/tencent/TencentImageryProvider.js +2 -1
- package/lib/map/base/imagery/tencent/TencentImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/transform/AmapMercatorTilingScheme.js +2 -1
- package/lib/map/base/imagery/transform/AmapMercatorTilingScheme.js.map +1 -1
- package/lib/map/base/imagery/transform/CoordTransform.js +44 -43
- package/lib/map/base/imagery/transform/CoordTransform.js.map +1 -1
- package/lib/map/base/index.js +6 -3
- package/lib/map/base/index.js.map +1 -1
- package/lib/map/hooks/useGetMapFeatureInfoByText.js +4 -2
- package/lib/map/hooks/useGetMapFeatureInfoByText.js.map +1 -1
- package/lib/map/index.js +35 -3
- package/lib/map/index.js.map +1 -1
- package/lib/map/material/AroundPoint.js +2 -1
- package/lib/map/material/AroundPoint.js.map +1 -1
- package/lib/map/material/CircleRippleMaterialProperty.js +7 -6
- package/lib/map/material/CircleRippleMaterialProperty.js.map +1 -1
- package/lib/map/material/ODLineLayer.js +2 -1
- package/lib/map/material/ODLineLayer.js.map +1 -1
- package/lib/map/material/PolylineTrailLinkMaterialProperty.js +2 -1
- package/lib/map/material/PolylineTrailLinkMaterialProperty.js.map +1 -1
- package/lib/map/material/PolylineTrailMaterialProperty.js +2 -1
- package/lib/map/material/PolylineTrailMaterialProperty.js.map +1 -1
- package/lib/map/material/TilesBuilding.js +2 -1
- package/lib/map/material/TilesBuilding.js.map +1 -1
- package/lib/map/material/index.js +2 -1
- package/lib/map/material/index.js.map +1 -1
- package/lib/map/style/css.js.map +1 -1
- package/lib/map/style/index.js.map +1 -1
- package/lib/map/style/index.less +149 -149
- package/lib/marker/Marker.js +2 -1
- package/lib/marker/Marker.js.map +1 -1
- package/lib/marker/index.js.map +1 -1
- package/lib/point/Point.js +2 -1
- package/lib/point/Point.js.map +1 -1
- package/lib/point/index.js.map +1 -1
- package/lib/polygon/Polygon.js +2 -1
- package/lib/polygon/Polygon.js.map +1 -1
- package/lib/polygon/index.js.map +1 -1
- package/lib/polyline/Polyline.js +2 -1
- package/lib/polyline/Polyline.js.map +1 -1
- package/lib/polyline/index.js.map +1 -1
- package/lib/renderer/index.js +33 -16
- package/lib/renderer/index.js.map +1 -1
- package/lib/renderer/style/css.js.map +1 -1
- package/lib/renderer/style/index.js.map +1 -1
- package/lib/style/index.less +2 -2
- package/lib/style/themes/compact.less +1 -1
- package/lib/style/themes/dark.less +9 -9
- package/lib/style/themes/default.less +7 -7
- package/lib/style/themes/index.less +1 -1
- package/lib/style/themes/variable.less +5 -5
- package/lib/tools/base-map-switch/index.js.map +1 -1
- package/lib/tools/dimension-switch/index.js.map +1 -1
- package/lib/tools/index.js +2 -1
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/layer-control/index.js +6 -3
- package/lib/tools/layer-control/index.js.map +1 -1
- package/lib/tools/map-search/Select/index.js +7 -6
- package/lib/tools/map-search/Select/index.js.map +1 -1
- package/lib/tools/map-search/Select/style/css.js.map +1 -1
- package/lib/tools/map-search/Select/style/index.js.map +1 -1
- package/lib/tools/map-search/Select/style/index.less +47 -47
- package/lib/tools/map-search/index.js +3 -3
- package/lib/tools/map-search/index.js.map +1 -1
- package/lib/tools/style/css.js.map +1 -1
- package/lib/tools/style/index.js.map +1 -1
- package/lib/tools/style/index.less +213 -213
- package/lib/tools/tools-item/index.js +2 -1
- package/lib/tools/tools-item/index.js.map +1 -1
- package/lib/trail-polyline-layer/TrailPolylineLayer.js +2 -1
- package/lib/trail-polyline-layer/TrailPolylineLayer.js.map +1 -1
- package/lib/trail-polyline-layer/TrailPolylineMaterial.js +2 -1
- package/lib/trail-polyline-layer/TrailPolylineMaterial.js.map +1 -1
- package/lib/trail-polyline-layer/style/css.js.map +1 -1
- package/lib/trail-polyline-layer/style/index.js.map +1 -1
- package/lib/water-surface-layer/WaterSurfaceLayer.js +2 -1
- package/lib/water-surface-layer/WaterSurfaceLayer.js.map +1 -1
- package/lib/water-surface-layer/index.js.map +1 -1
- package/lib/water-surface-layer/style/css.js.map +1 -1
- package/lib/water-surface-layer/style/index.js.map +1 -1
- package/lib/weather/Weather.js +30 -29
- package/lib/weather/Weather.js.map +1 -1
- package/lib/weather/index.js +2 -1
- package/lib/weather/index.js.map +1 -1
- package/lib/weather/style/css.js.map +1 -1
- package/lib/weather/style/index.js.map +1 -1
- package/lib/weather/style/index.less +63 -63
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,202 +1,202 @@
|
|
|
1
|
-
# cs-map
|
|
2
|
-
|
|
3
|
-
基于 cesium 封装的地图库
|
|
4
|
-
|
|
5
|
-
## 整体思路
|
|
6
|
-
|
|
7
|
-
## 组件列表
|
|
8
|
-
|
|
9
|
-
- 地图 Map
|
|
10
|
-
- 底图切换
|
|
11
|
-
- 天地图-矢量
|
|
12
|
-
- 天地图-卫星
|
|
13
|
-
- 绘制 Draw
|
|
14
|
-
- 点
|
|
15
|
-
- 线
|
|
16
|
-
- 面
|
|
17
|
-
- 圆
|
|
18
|
-
- 图层 Layer
|
|
19
|
-
- 图形图层
|
|
20
|
-
- 影像图层
|
|
21
|
-
- 工具栏
|
|
22
|
-
- 搜索
|
|
23
|
-
- 工具
|
|
24
|
-
- 测距
|
|
25
|
-
- 测面
|
|
26
|
-
- 框选
|
|
27
|
-
- 圈选
|
|
28
|
-
- 多边形选择
|
|
29
|
-
- 地图书签
|
|
30
|
-
- 地图下载
|
|
31
|
-
- 地图打印
|
|
32
|
-
- 空间定位查询
|
|
33
|
-
- 比例尺
|
|
34
|
-
- 鹰眼
|
|
35
|
-
- 视图
|
|
36
|
-
- 默认视角
|
|
37
|
-
- 放大
|
|
38
|
-
- 缩小
|
|
39
|
-
- 分析
|
|
40
|
-
- 管网基础分析
|
|
41
|
-
- 缓冲区分析
|
|
42
|
-
- 联通性分析
|
|
43
|
-
- 流向性分析
|
|
44
|
-
- 横截面分析
|
|
45
|
-
- 纵断面分析
|
|
46
|
-
- 管网结构智能诊断
|
|
47
|
-
- 爆管关阀分析
|
|
48
|
-
- 消防栓分析
|
|
49
|
-
- 纳污范围分析
|
|
50
|
-
- 污染源分析
|
|
51
|
-
- 大口径分析
|
|
52
|
-
- 管网智能分析
|
|
53
|
-
- 孤立区域诊断
|
|
54
|
-
- 环状管网诊断
|
|
55
|
-
- 逆坡识别诊断
|
|
56
|
-
- 流向异常诊断
|
|
57
|
-
- 大管套小管诊断
|
|
58
|
-
- 图层
|
|
59
|
-
- 全选
|
|
60
|
-
- 行政区划
|
|
61
|
-
- ......
|
|
62
|
-
|
|
63
|
-
### 地图
|
|
64
|
-
|
|
65
|
-
#### method
|
|
66
|
-
|
|
67
|
-
| 方法 | 作用 |
|
|
68
|
-
|-----------------------------|-----------------|
|
|
69
|
-
| getLayerByFeature(feature) | 通过图形查询所属图层 |
|
|
70
|
-
| getLayerByKey(keys) | 根据 keys 查找展示的图层 |
|
|
71
|
-
| getVisibleLayersByKeys(key) | 根据 keys 查找展示的图层 |
|
|
72
|
-
| showTip(content) | 展示提示 |
|
|
73
|
-
| hideTip() | 隐藏提示 |
|
|
74
|
-
| showModal(params) | 展示弹窗 |
|
|
75
|
-
|
|
76
|
-
### FeatureLayer 图形图层
|
|
77
|
-
|
|
78
|
-
#### 示例
|
|
79
|
-
```jsx
|
|
80
|
-
// 加载 geoserver
|
|
81
|
-
let layer = new FeatureLayer({
|
|
82
|
-
url: '/geoserver/zhsw/wms',
|
|
83
|
-
params: {
|
|
84
|
-
service: 'WFS',
|
|
85
|
-
version: '1.0.0',
|
|
86
|
-
request: 'GetFeature',
|
|
87
|
-
maxFeatures: 99999,
|
|
88
|
-
outputFormat: 'application/json',
|
|
89
|
-
typeName: 'zhsw:putian_network_access_enterprise',
|
|
90
|
-
QUERY_LAYERS: 'zhsw:putian_network_access_enterprise',
|
|
91
|
-
...params,
|
|
92
|
-
},
|
|
93
|
-
style: 'RWQY',
|
|
94
|
-
zIndex: 5,
|
|
95
|
-
key: 'SS_RWQY',
|
|
96
|
-
name: '入网企业',
|
|
97
|
-
autoRefresh: true,
|
|
98
|
-
template: feature => {
|
|
99
|
-
return <div>{feature.values_.name}</div>;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
map.addLayer(layer);
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
```jsx
|
|
107
|
-
// 加载 接口
|
|
108
|
-
let layer = new FeatureLayer({
|
|
109
|
-
url: '/cloud/zhsw-jcss/api/device/list',
|
|
110
|
-
params: {
|
|
111
|
-
deviceTypeId: 'WATER_METER',
|
|
112
|
-
},
|
|
113
|
-
style: 'YWJ',
|
|
114
|
-
zIndex: 5,
|
|
115
|
-
key: 'SB_YWJ',
|
|
116
|
-
name: '液位计',
|
|
117
|
-
labelField: 'deviceFactoryName',
|
|
118
|
-
autoRefresh: true, // 自动刷新
|
|
119
|
-
template: feature => {
|
|
120
|
-
return <PopupTemplate feature={feature} map={map} />;
|
|
121
|
-
},
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
map.addLayer(layer);
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
```jsx
|
|
128
|
-
// 加载 数据
|
|
129
|
-
let layer = new FeatureLayer({
|
|
130
|
-
data: {name: 'xxx液位计', geometryInfo: {coordType: "wgs84", type: 'point', lngLats: '119.0248,25.6389'}}, // []
|
|
131
|
-
style: 'YWJ',
|
|
132
|
-
zIndex: 5,
|
|
133
|
-
key: 'SB_YWJ',
|
|
134
|
-
name: '液位计',
|
|
135
|
-
labelField: 'name',
|
|
136
|
-
autoRefresh: true, // 自动刷新
|
|
137
|
-
template: feature => {
|
|
138
|
-
return <PopupTemplate feature={feature} map={map} />;
|
|
139
|
-
},
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
map.addLayer(layer);
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
#### api
|
|
146
|
-
|
|
147
|
-
| 参数 | 说明 | 类型 | 是否必填 |
|
|
148
|
-
|---------------|---------------------------------------------------|-----------|------|
|
|
149
|
-
| url | 图层接口 | string | 否 |
|
|
150
|
-
| method | 请求方式 | string | 否 |
|
|
151
|
-
| params | 请求参数 | object | 否 |
|
|
152
|
-
| sourceOptions | 数据源图层其他参数 | object | 否 |
|
|
153
|
-
| data | 直接通过 json 数据渲染,可忽略上面的请求,但注意必须包含 `geometryInfo` 字段 | object | 否 |
|
|
154
|
-
| features | 直接通过图形数据渲染,可忽略上面的请求 | object | 否 |
|
|
155
|
-
| key | 图层标识 | string | 是 |
|
|
156
|
-
| name | 图层名称 | string | 是 |
|
|
157
|
-
| labelField | 标签取值字段 | string | 是 |
|
|
158
|
-
| style | 图层样式,传入字符串时会直接从 MapIcon 中加载 | string | 是 |
|
|
159
|
-
| template | 缩略看板 | ReactNode | 否 |
|
|
160
|
-
| autoRefresh | 自动刷新标识 | string | 否 |
|
|
161
|
-
|
|
162
|
-
#### method
|
|
163
|
-
|
|
164
|
-
| 方法 | 说明 |
|
|
165
|
-
|--------------------------------------|-------------|
|
|
166
|
-
| refresh() | 刷新图层 |
|
|
167
|
-
| loadData(data) | 加载数据 |
|
|
168
|
-
| loadUrlData(url, params, method) | 通过接口请求加载数据 |
|
|
169
|
-
| loadFeatures(features) | 加载图形 |
|
|
170
|
-
| getFeatureByFieldValue(field, value) | 通过字段及内容查找图形 |
|
|
171
|
-
|
|
172
|
-
#### geometryInfo 说明
|
|
173
|
-
|
|
174
|
-
| 字段 | 说明 | 类型 | 是否必填 |
|
|
175
|
-
|-----------|:-----------------------------------------------------------------|--------|------|
|
|
176
|
-
| type | 图形类型: `point`、`polyline`、`polygon` | string | 是 |
|
|
177
|
-
| lngLats | 经纬度: "119.0248,25.6389", 多个: "119.0248,25.6389;119.0248,25.6389" | string | 是 |
|
|
178
|
-
| coordType | 坐标系: `wgs84`、`bmap`、`amap` | string | 是 |
|
|
179
|
-
|
|
180
|
-
### ImageLayer 图像图层
|
|
181
|
-
|
|
182
|
-
#### api
|
|
183
|
-
|
|
184
|
-
| 参数 | 说明 | 类型 | 是否必填 |
|
|
185
|
-
|---------------|-----------|-----------|------|
|
|
186
|
-
| url | 图层接口 | string | 否 |
|
|
187
|
-
| method | 请求方式 | string | 否 |
|
|
188
|
-
| params | 请求参数 | object | 否 |
|
|
189
|
-
| sourceOptions | 数据源图层其他参数 | object | 否 |
|
|
190
|
-
| key | 图层标识 | string | 是 |
|
|
191
|
-
| name | 图层名称 | string | 是 |
|
|
192
|
-
| labelField | 标签取值字段 | string | 是 |
|
|
193
|
-
| template | 缩略看板 | ReactNode | 否 |
|
|
194
|
-
|
|
195
|
-
#### method
|
|
196
|
-
|
|
197
|
-
| 方法 | 说明 |
|
|
198
|
-
|----------------------------|--------------|
|
|
199
|
-
| getFeatureInfo(event, map) | 获取鼠标点击时的图形信息 |
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
### Util 工具类
|
|
1
|
+
# cs-map
|
|
2
|
+
|
|
3
|
+
基于 cesium 封装的地图库
|
|
4
|
+
|
|
5
|
+
## 整体思路
|
|
6
|
+
|
|
7
|
+
## 组件列表
|
|
8
|
+
|
|
9
|
+
- 地图 Map
|
|
10
|
+
- 底图切换
|
|
11
|
+
- 天地图-矢量
|
|
12
|
+
- 天地图-卫星
|
|
13
|
+
- 绘制 Draw
|
|
14
|
+
- 点
|
|
15
|
+
- 线
|
|
16
|
+
- 面
|
|
17
|
+
- 圆
|
|
18
|
+
- 图层 Layer
|
|
19
|
+
- 图形图层
|
|
20
|
+
- 影像图层
|
|
21
|
+
- 工具栏
|
|
22
|
+
- 搜索
|
|
23
|
+
- 工具
|
|
24
|
+
- 测距
|
|
25
|
+
- 测面
|
|
26
|
+
- 框选
|
|
27
|
+
- 圈选
|
|
28
|
+
- 多边形选择
|
|
29
|
+
- 地图书签
|
|
30
|
+
- 地图下载
|
|
31
|
+
- 地图打印
|
|
32
|
+
- 空间定位查询
|
|
33
|
+
- 比例尺
|
|
34
|
+
- 鹰眼
|
|
35
|
+
- 视图
|
|
36
|
+
- 默认视角
|
|
37
|
+
- 放大
|
|
38
|
+
- 缩小
|
|
39
|
+
- 分析
|
|
40
|
+
- 管网基础分析
|
|
41
|
+
- 缓冲区分析
|
|
42
|
+
- 联通性分析
|
|
43
|
+
- 流向性分析
|
|
44
|
+
- 横截面分析
|
|
45
|
+
- 纵断面分析
|
|
46
|
+
- 管网结构智能诊断
|
|
47
|
+
- 爆管关阀分析
|
|
48
|
+
- 消防栓分析
|
|
49
|
+
- 纳污范围分析
|
|
50
|
+
- 污染源分析
|
|
51
|
+
- 大口径分析
|
|
52
|
+
- 管网智能分析
|
|
53
|
+
- 孤立区域诊断
|
|
54
|
+
- 环状管网诊断
|
|
55
|
+
- 逆坡识别诊断
|
|
56
|
+
- 流向异常诊断
|
|
57
|
+
- 大管套小管诊断
|
|
58
|
+
- 图层
|
|
59
|
+
- 全选
|
|
60
|
+
- 行政区划
|
|
61
|
+
- ......
|
|
62
|
+
|
|
63
|
+
### 地图
|
|
64
|
+
|
|
65
|
+
#### method
|
|
66
|
+
|
|
67
|
+
| 方法 | 作用 |
|
|
68
|
+
|-----------------------------|-----------------|
|
|
69
|
+
| getLayerByFeature(feature) | 通过图形查询所属图层 |
|
|
70
|
+
| getLayerByKey(keys) | 根据 keys 查找展示的图层 |
|
|
71
|
+
| getVisibleLayersByKeys(key) | 根据 keys 查找展示的图层 |
|
|
72
|
+
| showTip(content) | 展示提示 |
|
|
73
|
+
| hideTip() | 隐藏提示 |
|
|
74
|
+
| showModal(params) | 展示弹窗 |
|
|
75
|
+
|
|
76
|
+
### FeatureLayer 图形图层
|
|
77
|
+
|
|
78
|
+
#### 示例
|
|
79
|
+
```jsx
|
|
80
|
+
// 加载 geoserver
|
|
81
|
+
let layer = new FeatureLayer({
|
|
82
|
+
url: '/geoserver/zhsw/wms',
|
|
83
|
+
params: {
|
|
84
|
+
service: 'WFS',
|
|
85
|
+
version: '1.0.0',
|
|
86
|
+
request: 'GetFeature',
|
|
87
|
+
maxFeatures: 99999,
|
|
88
|
+
outputFormat: 'application/json',
|
|
89
|
+
typeName: 'zhsw:putian_network_access_enterprise',
|
|
90
|
+
QUERY_LAYERS: 'zhsw:putian_network_access_enterprise',
|
|
91
|
+
...params,
|
|
92
|
+
},
|
|
93
|
+
style: 'RWQY',
|
|
94
|
+
zIndex: 5,
|
|
95
|
+
key: 'SS_RWQY',
|
|
96
|
+
name: '入网企业',
|
|
97
|
+
autoRefresh: true,
|
|
98
|
+
template: feature => {
|
|
99
|
+
return <div>{feature.values_.name}</div>;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
map.addLayer(layer);
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```jsx
|
|
107
|
+
// 加载 接口
|
|
108
|
+
let layer = new FeatureLayer({
|
|
109
|
+
url: '/cloud/zhsw-jcss/api/device/list',
|
|
110
|
+
params: {
|
|
111
|
+
deviceTypeId: 'WATER_METER',
|
|
112
|
+
},
|
|
113
|
+
style: 'YWJ',
|
|
114
|
+
zIndex: 5,
|
|
115
|
+
key: 'SB_YWJ',
|
|
116
|
+
name: '液位计',
|
|
117
|
+
labelField: 'deviceFactoryName',
|
|
118
|
+
autoRefresh: true, // 自动刷新
|
|
119
|
+
template: feature => {
|
|
120
|
+
return <PopupTemplate feature={feature} map={map} />;
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
map.addLayer(layer);
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```jsx
|
|
128
|
+
// 加载 数据
|
|
129
|
+
let layer = new FeatureLayer({
|
|
130
|
+
data: {name: 'xxx液位计', geometryInfo: {coordType: "wgs84", type: 'point', lngLats: '119.0248,25.6389'}}, // []
|
|
131
|
+
style: 'YWJ',
|
|
132
|
+
zIndex: 5,
|
|
133
|
+
key: 'SB_YWJ',
|
|
134
|
+
name: '液位计',
|
|
135
|
+
labelField: 'name',
|
|
136
|
+
autoRefresh: true, // 自动刷新
|
|
137
|
+
template: feature => {
|
|
138
|
+
return <PopupTemplate feature={feature} map={map} />;
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
map.addLayer(layer);
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### api
|
|
146
|
+
|
|
147
|
+
| 参数 | 说明 | 类型 | 是否必填 |
|
|
148
|
+
|---------------|---------------------------------------------------|-----------|------|
|
|
149
|
+
| url | 图层接口 | string | 否 |
|
|
150
|
+
| method | 请求方式 | string | 否 |
|
|
151
|
+
| params | 请求参数 | object | 否 |
|
|
152
|
+
| sourceOptions | 数据源图层其他参数 | object | 否 |
|
|
153
|
+
| data | 直接通过 json 数据渲染,可忽略上面的请求,但注意必须包含 `geometryInfo` 字段 | object | 否 |
|
|
154
|
+
| features | 直接通过图形数据渲染,可忽略上面的请求 | object | 否 |
|
|
155
|
+
| key | 图层标识 | string | 是 |
|
|
156
|
+
| name | 图层名称 | string | 是 |
|
|
157
|
+
| labelField | 标签取值字段 | string | 是 |
|
|
158
|
+
| style | 图层样式,传入字符串时会直接从 MapIcon 中加载 | string | 是 |
|
|
159
|
+
| template | 缩略看板 | ReactNode | 否 |
|
|
160
|
+
| autoRefresh | 自动刷新标识 | string | 否 |
|
|
161
|
+
|
|
162
|
+
#### method
|
|
163
|
+
|
|
164
|
+
| 方法 | 说明 |
|
|
165
|
+
|--------------------------------------|-------------|
|
|
166
|
+
| refresh() | 刷新图层 |
|
|
167
|
+
| loadData(data) | 加载数据 |
|
|
168
|
+
| loadUrlData(url, params, method) | 通过接口请求加载数据 |
|
|
169
|
+
| loadFeatures(features) | 加载图形 |
|
|
170
|
+
| getFeatureByFieldValue(field, value) | 通过字段及内容查找图形 |
|
|
171
|
+
|
|
172
|
+
#### geometryInfo 说明
|
|
173
|
+
|
|
174
|
+
| 字段 | 说明 | 类型 | 是否必填 |
|
|
175
|
+
|-----------|:-----------------------------------------------------------------|--------|------|
|
|
176
|
+
| type | 图形类型: `point`、`polyline`、`polygon` | string | 是 |
|
|
177
|
+
| lngLats | 经纬度: "119.0248,25.6389", 多个: "119.0248,25.6389;119.0248,25.6389" | string | 是 |
|
|
178
|
+
| coordType | 坐标系: `wgs84`、`bmap`、`amap` | string | 是 |
|
|
179
|
+
|
|
180
|
+
### ImageLayer 图像图层
|
|
181
|
+
|
|
182
|
+
#### api
|
|
183
|
+
|
|
184
|
+
| 参数 | 说明 | 类型 | 是否必填 |
|
|
185
|
+
|---------------|-----------|-----------|------|
|
|
186
|
+
| url | 图层接口 | string | 否 |
|
|
187
|
+
| method | 请求方式 | string | 否 |
|
|
188
|
+
| params | 请求参数 | object | 否 |
|
|
189
|
+
| sourceOptions | 数据源图层其他参数 | object | 否 |
|
|
190
|
+
| key | 图层标识 | string | 是 |
|
|
191
|
+
| name | 图层名称 | string | 是 |
|
|
192
|
+
| labelField | 标签取值字段 | string | 是 |
|
|
193
|
+
| template | 缩略看板 | ReactNode | 否 |
|
|
194
|
+
|
|
195
|
+
#### method
|
|
196
|
+
|
|
197
|
+
| 方法 | 说明 |
|
|
198
|
+
|----------------------------|--------------|
|
|
199
|
+
| getFeatureInfo(event, map) | 获取鼠标点击时的图形信息 |
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
### Util 工具类
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventEmitter.js","names":["EventEmitter","_classCallCheck","events","_createClass","key","value","on","eventName","callback","push","emit","_this","_len","arguments","length","rest","Array","_key","forEach","f","apply","un","filter","once","_this2","fn","_len2","_key2","_default","exports"],"sources":["_util/EventEmitter.js"],"sourcesContent":["// 发布订阅模式\
|
|
1
|
+
{"version":3,"file":"EventEmitter.js","names":["EventEmitter","_classCallCheck","events","_createClass","key","value","on","eventName","callback","push","emit","_this","_len","arguments","length","rest","Array","_key","forEach","f","apply","un","filter","once","_this2","fn","_len2","_key2","_default","exports"],"sources":["_util/EventEmitter.js"],"sourcesContent":["// 发布订阅模式\nclass EventEmitter {\n constructor() {\n // 事件对象,存放订阅的名字和事件 如:{'click': [handle, handle2]}\n this.events = {};\n }\n\n // 订阅事件方法\n on(eventName, callback) {\n this.events[eventName] = this.events[eventName] || [];\n this.events[eventName].push(callback);\n }\n\n // 触发事件方法\n emit(eventName, ...rest) {\n if (this.events[eventName]) {\n this.events[eventName].forEach(f => f.apply(this, rest))\n }\n }\n\n // 移除订阅事件\n un(eventName, callback) {\n if (this.events[eventName]) {\n this.events[eventName] = this.events[eventName].filter(f => f !== callback)\n }\n }\n\n // 只执行一次订阅的事件\n once(eventName, callback) {\n //创建临时方法\n const fn = (...rest) => {\n\n // 执行原有的callback\n callback.apply(this, rest)\n\n // 执行移除事件,删除临时方法\n this.un(eventName, fn)\n }\n\n // 执行订阅事件,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e,MAAM,CAAC,UAAAH,CAAC;UAAA,OAAIA,CAAC,KAAKX,QAAQ;QAAA,EAAC;MAC7E;IACF;;IAEA;EAAA;IAAAJ,GAAA;IAAAC,KAAA,EACA,SAAAkB,KAAKhB,SAAS,EAAEC,QAAQ,EAAE;MAAA,IAAAgB,MAAA;MACxB;MACA,IAAMC,EAAE,GAAG,SAALA,EAAEA,CAAA,EAAgB;QAAA,SAAAC,KAAA,GAAAb,SAAA,CAAAC,MAAA,EAATC,IAAI,OAAAC,KAAA,CAAAU,KAAA,GAAAC,KAAA,MAAAA,KAAA,GAAAD,KAAA,EAAAC,KAAA;UAAJZ,IAAI,CAAAY,KAAA,IAAAd,SAAA,CAAAc,KAAA;QAAA;QAEjB;QACAnB,QAAQ,CAACY,KAAK,CAACI,MAAI,EAAET,IAAI,CAAC;;QAE1B;QACAS,MAAI,CAACH,EAAE,CAACd,SAAS,EAAEkB,EAAE,CAAC;MACxB,CAAC;;MAED;MACA,IAAI,CAACnB,EAAE,CAACC,SAAS,EAAEkB,EAAE,CAAC;IACxB;EAAC;EAAA,OAAAzB,YAAA;AAAA;AAAA,IAAA4B,QAAA,GAGY5B,YAAY;AAAA6B,OAAA,cAAAD,QAAA"}
|
package/lib/_util/Provider.js
CHANGED
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = exports.Context = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
|
-
var Context =
|
|
9
|
+
var Context = /*#__PURE__*/_react["default"].createContext({});
|
|
10
|
+
exports.Context = Context;
|
|
10
11
|
var Provider = Context.Provider;
|
|
11
|
-
var _default =
|
|
12
|
+
var _default = Provider;
|
|
13
|
+
exports["default"] = _default;
|
|
12
14
|
//# sourceMappingURL=Provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","names":["_react","_interopRequireDefault","require","obj","__esModule","Context","
|
|
1
|
+
{"version":3,"file":"Provider.js","names":["_react","_interopRequireDefault","require","obj","__esModule","Context","React","createContext","exports","Provider","_default"],"sources":["_util/Provider.js"],"sourcesContent":["import React from 'react';\nconst Context = React.createContext({});\nconst Provider = Context.Provider;\nexport { Context };\nexport default Provider;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAC1B,IAAME,OAAO,gBAAGC,iBAAK,CAACC,aAAa,CAAC,CAAC,CAAC,CAAC;AAACC,OAAA,CAAAH,OAAA,GAAAA,OAAA;AACxC,IAAMI,QAAQ,GAAGJ,OAAO,CAACI,QAAQ;AAAC,IAAAC,QAAA,GAEnBD,QAAQ;AAAAD,OAAA,cAAAE,QAAA"}
|
|
@@ -16,12 +16,12 @@ function isNotEmpty(value) {
|
|
|
16
16
|
return Array.isArray(value) && value.length > 0;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* 过滤特殊字符
|
|
21
|
-
* @param {String} value 值
|
|
22
|
-
* @param {Object} option
|
|
23
|
-
* @param {Array} [option.include] 新增
|
|
24
|
-
* @param {Array} [option.exclude] 排除
|
|
19
|
+
/**
|
|
20
|
+
* 过滤特殊字符
|
|
21
|
+
* @param {String} value 值
|
|
22
|
+
* @param {Object} option
|
|
23
|
+
* @param {Array} [option.include] 新增
|
|
24
|
+
* @param {Array} [option.exclude] 排除
|
|
25
25
|
*/
|
|
26
26
|
function filterSpecialCharacters(value) {
|
|
27
27
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterSpecialCharacters.js","names":["_lodash","_interopRequireDefault","require","obj","__esModule","_toConsumableArray","arr","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","o","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","Array","from","test","iter","Symbol","iterator","isArray","len","length","i","arr2","isNotEmpty","value","filterSpecialCharacters","_ref","arguments","undefined","_ref$include","include","_ref$exclude","exclude","specialCharacter","Set","concat","difference","replace","RegExp","join"],"sources":["_util/filterSpecialCharacters.js"],"sourcesContent":["import difference from 'lodash.difference';\
|
|
1
|
+
{"version":3,"file":"filterSpecialCharacters.js","names":["_lodash","_interopRequireDefault","require","obj","__esModule","_toConsumableArray","arr","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","o","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","Array","from","test","iter","Symbol","iterator","isArray","len","length","i","arr2","isNotEmpty","value","filterSpecialCharacters","_ref","arguments","undefined","_ref$include","include","_ref$exclude","exclude","specialCharacter","Set","concat","difference","replace","RegExp","join"],"sources":["_util/filterSpecialCharacters.js"],"sourcesContent":["import difference from 'lodash.difference';\n\nfunction isNotEmpty(value) {\n return Array.isArray(value) && value.length > 0;\n}\n\n/**\n * 过滤特殊字符\n * @param {String} value 值\n * @param {Object} option\n * @param {Array} [option.include] 新增\n * @param {Array} [option.exclude] 排除\n */\nexport default function filterSpecialCharacters(value, { include = [], exclude = [] } = {}) {\n // 特殊符号,- _ 排除\n let specialCharacter = [\n // 小括号\n '(',\n ')',\n '(',\n ')',\n // 中括号\n '\\\\[',\n '\\\\]',\n '[',\n ']',\n // 大括号\n '{',\n '}',\n '{',\n '}',\n // 方头括号\n '【',\n '】',\n // 尖括号\n '<',\n '>',\n // 书名号\n '《',\n '》',\n // 斜杠\n '/',\n // 反斜杠\n '\\\\\\\\',\n // 逗号\n ',',\n ',',\n // 句号\n '.',\n '。',\n // 冒号\n ':',\n ':',\n // 分号\n ';',\n ';',\n // 顿号\n '、',\n // 破折号\n '——',\n // 感叹号\n '!',\n '!',\n // 问号\n '?',\n '?',\n // 加减等于\n '+',\n '=',\n // 单引号\n \"'\",\n '‘',\n '’',\n // 双引号\n '\"',\n '“',\n '”',\n // 金钱\n '$',\n '¥',\n // 百分号\n '%',\n '%',\n // 其它\n '@',\n '#',\n '`',\n '~',\n '*',\n '^',\n '……',\n '|',\n '&',\n ];\n\n // 新增\n if (isNotEmpty(include)) {\n specialCharacter = Array.from(new Set([...specialCharacter, ...include]));\n }\n\n // 移除\n if (isNotEmpty(exclude)) {\n specialCharacter = difference(specialCharacter, exclude);\n }\n\n return value.replace(new RegExp(`[${specialCharacter.join('')}]`, 'g'), '');\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,mBAAAC,GAAA,WAAAC,kBAAA,CAAAD,GAAA,KAAAE,gBAAA,CAAAF,GAAA,KAAAG,2BAAA,CAAAH,GAAA,KAAAI,kBAAA;AAAA,SAAAA,mBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAG,CAAA,EAAAC,MAAA,SAAAD,CAAA,qBAAAA,CAAA,sBAAAE,iBAAA,CAAAF,CAAA,EAAAC,MAAA,OAAAE,CAAA,GAAAC,MAAA,CAAAC,SAAA,CAAAC,QAAA,CAAAC,IAAA,CAAAP,CAAA,EAAAQ,KAAA,aAAAL,CAAA,iBAAAH,CAAA,CAAAS,WAAA,EAAAN,CAAA,GAAAH,CAAA,CAAAS,WAAA,CAAAC,IAAA,MAAAP,CAAA,cAAAA,CAAA,mBAAAQ,KAAA,CAAAC,IAAA,CAAAZ,CAAA,OAAAG,CAAA,+DAAAU,IAAA,CAAAV,CAAA,UAAAD,iBAAA,CAAAF,CAAA,EAAAC,MAAA;AAAA,SAAAL,iBAAAkB,IAAA,eAAAC,MAAA,oBAAAD,IAAA,CAAAC,MAAA,CAAAC,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G;EACH;EACA,MAAM;EACN;EACA,GAAG,EACH,GAAG;EACH;EACA,GAAG,EACH,GAAG;EACH;EACA,GAAG,EACH,GAAG;EACH;EACA,GAAG,EACH,GAAG;EACH;EACA,GAAG;EACH;EACA,IAAI;EACJ;EACA,GAAG,EACH,GAAG;EACH;EACA,GAAG,EACH,GAAG;EACH;EACA,GAAG,EACH,GAAG;EACH;EACA,GAAG,EACH,GAAG,EACH,GAAG;EACH;EACA,GAAG,EACH,GAAG,EACH,GAAG;EACH;EACA,GAAG,EACH,GAAG;EACH;EACA,GAAG,EACH,GAAG;EACH;EACA,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG,EACH,GAAG,CACN;;EAED;EACA,IAAIV,UAAU,CAACO,OAAO,CAAC,EAAE;IACrBG,gBAAgB,GAAGrB,KAAK,CAACC,IAAI,CAAC,IAAIqB,GAAG,IAAAC,MAAA,CAAAzC,kBAAA,CAAKuC,gBAAgB,GAAAvC,kBAAA,CAAKoC,OAAO,EAAC,CAAC,CAAC;EAC7E;;EAEA;EACA,IAAIP,UAAU,CAACS,OAAO,CAAC,EAAE;IACrBC,gBAAgB,GAAG,IAAAG,kBAAU,EAACH,gBAAgB,EAAED,OAAO,CAAC;EAC5D;EAEA,OAAOR,KAAK,CAACa,OAAO,CAAC,IAAIC,MAAM,KAAAH,MAAA,CAAKF,gBAAgB,CAACM,IAAI,CAAC,EAAE,CAAC,QAAK,GAAG,CAAC,EAAE,EAAE,CAAC;AAC/E"}
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* @description: 产生随机点
|
|
9
|
-
* @param {*} position:中心点坐标
|
|
10
|
-
* @param {*} num:随机点数量
|
|
11
|
-
* @return {*}
|
|
7
|
+
/**
|
|
8
|
+
* @description: 产生随机点
|
|
9
|
+
* @param {*} position:中心点坐标
|
|
10
|
+
* @param {*} num:随机点数量
|
|
11
|
+
* @return {*}
|
|
12
12
|
*/
|
|
13
13
|
function generateRandomPosition(position, num) {
|
|
14
14
|
var list = [];
|
|
@@ -20,5 +20,6 @@ function generateRandomPosition(position, num) {
|
|
|
20
20
|
}
|
|
21
21
|
return list;
|
|
22
22
|
}
|
|
23
|
-
var _default =
|
|
23
|
+
var _default = generateRandomPosition;
|
|
24
|
+
exports["default"] = _default;
|
|
24
25
|
//# sourceMappingURL=generateRandomPosition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateRandomPosition.js","names":["generateRandomPosition","position","num","list","i","lon","Math","random","lat","push","_default","exports"],"sources":["_util/generateRandomPosition.js"],"sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"generateRandomPosition.js","names":["generateRandomPosition","position","num","list","i","lon","Math","random","lat","push","_default","exports"],"sources":["_util/generateRandomPosition.js"],"sourcesContent":["/**\n * @description: 产生随机点\n * @param {*} position:中心点坐标\n * @param {*} num:随机点数量\n * @return {*}\n */\nfunction generateRandomPosition(position, num) {\n let list = []\n for (let i = 0; i < num; i++) {\n // random产生的随机数范围是0-1,需要加上正负模拟\n let lon = position[0] + Math.random() * 0.04 * (i % 2 === 0 ? 1 : -1);\n let lat = position[1] + Math.random() * 0.04 * (i % 2 === 0 ? 1 : -1);\n list.push([lon, lat])\n }\n return list\n}\n\nexport default generateRandomPosition;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,sBAAsBA,CAACC,QAAQ,EAAEC,GAAG,EAAE;EAC3C,IAAIC,IAAI,GAAG,EAAE;EACb,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,GAAG,EAAEE,CAAC,EAAE,EAAE;IAC1B;IACA,IAAIC,GAAG,GAAGJ,QAAQ,CAAC,CAAC,CAAC,GAAGK,IAAI,CAACC,MAAM,CAAC,CAAC,GAAG,IAAI,IAAIH,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACrE,IAAII,GAAG,GAAGP,QAAQ,CAAC,CAAC,CAAC,GAAGK,IAAI,CAACC,MAAM,CAAC,CAAC,GAAG,IAAI,IAAIH,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACrED,IAAI,CAACM,IAAI,CAAC,CAACJ,GAAG,EAAEG,GAAG,CAAC,CAAC;EACzB;EACA,OAAOL,IAAI;AACf;AAAC,IAAAO,QAAA,GAEcV,sBAAsB;AAAAW,OAAA,cAAAD,QAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getBox = exports["default"] = exports.computeMinMax = void 0;
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
+
/**
|
|
14
|
+
* 兼容最小最大值
|
|
15
|
+
* @param minCoordinate
|
|
16
|
+
* @param maxCoordinate
|
|
17
|
+
* @param gutter
|
|
18
|
+
* @returns {[*,*,*,*]}
|
|
19
|
+
*/
|
|
20
|
+
var computeMinMax = function computeMinMax(minCoordinate, maxCoordinate) {
|
|
21
|
+
var gutter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.035;
|
|
22
|
+
maxCoordinate[0] = maxCoordinate[0] + gutter;
|
|
23
|
+
minCoordinate[0] = minCoordinate[0] - gutter;
|
|
24
|
+
maxCoordinate[1] = maxCoordinate[1] + gutter;
|
|
25
|
+
minCoordinate[1] = minCoordinate[1] - gutter;
|
|
26
|
+
return [minCoordinate[0], minCoordinate[1], maxCoordinate[0], maxCoordinate[1]];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 获取边界
|
|
31
|
+
* @param coordinates
|
|
32
|
+
* @returns {[*,*,*,*]}
|
|
33
|
+
*/
|
|
34
|
+
exports.computeMinMax = computeMinMax;
|
|
35
|
+
var getBox = function getBox(coordinates, gutter) {
|
|
36
|
+
var minCoordinate = [];
|
|
37
|
+
var maxCoordinate = [];
|
|
38
|
+
coordinates.forEach(function (c, index) {
|
|
39
|
+
var i = index % 2;
|
|
40
|
+
if (i === 0) {
|
|
41
|
+
if (minCoordinate[0] === undefined || c < minCoordinate[0]) {
|
|
42
|
+
minCoordinate[0] = c;
|
|
43
|
+
}
|
|
44
|
+
if (maxCoordinate[0] === undefined || c > maxCoordinate[0]) {
|
|
45
|
+
maxCoordinate[0] = c;
|
|
46
|
+
}
|
|
47
|
+
} else if (i === 1) {
|
|
48
|
+
if (minCoordinate[1] === undefined || c < minCoordinate[1]) {
|
|
49
|
+
minCoordinate[1] = c;
|
|
50
|
+
}
|
|
51
|
+
if (maxCoordinate[1] === undefined || c > maxCoordinate[1]) {
|
|
52
|
+
maxCoordinate[1] = c;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return computeMinMax(minCoordinate, maxCoordinate, gutter);
|
|
57
|
+
};
|
|
58
|
+
exports.getBox = getBox;
|
|
59
|
+
var _default = function _default(geoJson) {
|
|
60
|
+
var coordinates = [];
|
|
61
|
+
geoJson.features.map(function (feature) {
|
|
62
|
+
var c = feature.geometry.coordinates.flat(Infinity);
|
|
63
|
+
coordinates.push.apply(coordinates, _toConsumableArray(c));
|
|
64
|
+
});
|
|
65
|
+
return getBox(coordinates, 0.035);
|
|
66
|
+
};
|
|
67
|
+
exports["default"] = _default;
|
|
68
|
+
//# sourceMappingURL=getBBoxFromGeojson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBBoxFromGeojson.js","names":["computeMinMax","minCoordinate","maxCoordinate","gutter","arguments","length","undefined","exports","getBox","coordinates","forEach","c","index","i","_default","geoJson","features","map","feature","geometry","flat","Infinity","push","apply","_toConsumableArray"],"sources":["_util/getBBoxFromGeojson.js"],"sourcesContent":["/**\n * 兼容最小最大值\n * @param minCoordinate\n * @param maxCoordinate\n * @param gutter\n * @returns {[*,*,*,*]}\n */\nexport const computeMinMax = (minCoordinate, maxCoordinate, gutter = 0.035) => {\n maxCoordinate[0] = maxCoordinate[0] + gutter;\n minCoordinate[0] = minCoordinate[0] - gutter;\n\n maxCoordinate[1] = maxCoordinate[1] + gutter;\n minCoordinate[1] = minCoordinate[1] - gutter;\n\n return [minCoordinate[0], minCoordinate[1], maxCoordinate[0], maxCoordinate[1]]\n}\n\n/**\n * 获取边界\n * @param coordinates\n * @returns {[*,*,*,*]}\n */\nexport const getBox = (coordinates, gutter) => {\n let minCoordinate = [];\n let maxCoordinate = [];\n\n coordinates.forEach((c, index) => {\n let i = index%2;\n if (i === 0) {\n if (minCoordinate[0] === undefined || c < minCoordinate[0]) {\n minCoordinate[0] = c;\n }\n\n if (maxCoordinate[0] === undefined || c > maxCoordinate[0]) {\n maxCoordinate[0] = c;\n }\n } else if (i === 1) {\n if (minCoordinate[1] === undefined || c < minCoordinate[1]) {\n minCoordinate[1] = c;\n }\n\n if (maxCoordinate[1] === undefined || c > maxCoordinate[1]) {\n maxCoordinate[1] = c;\n }\n }\n })\n\n return computeMinMax(minCoordinate, maxCoordinate, gutter)\n}\n\nexport default (geoJson) => {\n const coordinates = [];\n\n geoJson.features.map(feature => {\n let c = feature.geometry.coordinates.flat(Infinity);\n coordinates.push(...c)\n });\n\n return getBox(coordinates, 0.035)\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,aAAa,EAAEC,aAAa,EAAqB;EAAA,IAAnBC,MAAM,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EACtEF,aAAa,CAAC,CAAC,CAAC,GAAGA,aAAa,CAAC,CAAC,CAAC,GAAGC,MAAM;EAC5CF,aAAa,CAAC,CAAC,CAAC,GAAGA,aAAa,CAAC,CAAC,CAAC,GAAGE,MAAM;EAE5CD,aAAa,CAAC,CAAC,CAAC,GAAGA,aAAa,CAAC,CAAC,CAAC,GAAGC,MAAM;EAC5CF,aAAa,CAAC,CAAC,CAAC,GAAGA,aAAa,CAAC,CAAC,CAAC,GAAGE,MAAM;EAE5C,OAAO,CAACF,aAAa,CAAC,CAAC,CAAC,EAAEA,aAAa,CAAC,CAAC,CAAC,EAAEC,aAAa,CAAC,CAAC,CAAC,EAAEA,aAAa,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJAK,OAAA,CAAAP,aAAA,GAAAA,aAAA;AAKO,IAAMQ,MAAM,GAAG,SAATA,MAAMA,CAAIC,WAAW,EAAEN,MAAM,EAAK;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AAQ,CAAC;IACnDZ,WAAW,CAACa,IAAI,CAAAC,KAAA,CAAhBd,WAAW,EAAAe,kBAAA,CAASb,CAAC,EAAC;EAC1B,CAAC,CAAC;EAEF,OAAOH,MAAM,CAACC,WAAW,EAAE,KAAK,CAAC;AACrC,CAAC;AAAAF,OAAA,cAAAO,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getComponentProps.js","names":["getComponentProps","prop","_typeof"],"sources":["_util/getComponentProps.js"],"sourcesContent":["export default function getComponentProps(prop) {\
|
|
1
|
+
{"version":3,"file":"getComponentProps.js","names":["getComponentProps","prop","_typeof"],"sources":["_util/getComponentProps.js"],"sourcesContent":["export default function getComponentProps(prop) {\n if (prop && typeof prop === 'object') {\n return prop;\n }\n return {};\n}\n"],"mappings":";;;;;;;AAAe,SAASA,iBAAiBA,CAACC,IAAI,EAAE;EAC5C,IAAIA,IAAI,IAAIC,OAAA,CAAOD,IAAI,MAAK,QAAQ,EAAE;IAClC,OAAOA,IAAI;EACf;EACA,OAAO,CAAC,CAAC;AACb"}
|