@vtx/ol-map 1.0.162 → 1.0.164
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 +205 -205
- package/lib/_util/EventEmitter.js.map +1 -1
- package/lib/_util/StyleCache.js.map +1 -1
- package/lib/_util/encryptParams.js +10 -10
- package/lib/_util/encryptParams.js.map +1 -1
- package/lib/_util/filterSpecialCharacters.js +6 -6
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getCookie.js +4 -4
- package/lib/_util/getCookie.js.map +1 -1
- package/lib/_util/getDefaultMapInfo.js.map +1 -1
- package/lib/_util/getSystemInfo.js.map +1 -1
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/http.js +18 -18
- 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 +21 -21
- package/lib/_util/layer.js.map +1 -1
- package/lib/_util/mapTool.js +35 -35
- package/lib/_util/mapTool.js.map +1 -1
- package/lib/_util/projzh/datum/bd-09.js.map +1 -1
- package/lib/_util/projzh/datum/gcj-02.js.map +1 -1
- package/lib/_util/projzh/datum/index.js.map +1 -1
- package/lib/_util/projzh/index.js.map +1 -1
- package/lib/_util/projzh/projection/baidu-mercator.js.map +1 -1
- package/lib/_util/projzh/projection/index.js.map +1 -1
- package/lib/_util/projzh/projection/spherical-mercator.js.map +1 -1
- package/lib/_util/projzh/util.js.map +1 -1
- package/lib/_util/search.js.map +1 -1
- package/lib/_util/setCookie.js +4 -4
- package/lib/_util/setCookie.js.map +1 -1
- package/lib/_util/stringToFun.js.map +1 -1
- package/lib/_util/transform.js.map +1 -1
- package/lib/_util/useColSize.js.map +1 -1
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js.map +1 -1
- package/lib/analysis-layer/index.js +20 -20
- package/lib/analysis-layer/index.js.map +1 -1
- package/lib/buffer-draw/BufferDraw.js.map +1 -1
- package/lib/buffer-draw/index.js.map +1 -1
- package/lib/config.js.map +1 -1
- package/lib/convertCamelToCSS.js.map +1 -1
- package/lib/dom/Dom.js.map +1 -1
- package/lib/dom/index.js.map +1 -1
- package/lib/dom-layer/index.js.map +1 -1
- package/lib/dom-layer/style/css.js.map +1 -1
- package/lib/dom-layer/style/index.js.map +1 -1
- package/lib/dom-layer/style/index.less +3 -3
- package/lib/events/index.js.map +1 -1
- package/lib/feature-draw/FeatureDraw.js +4 -4
- package/lib/feature-draw/FeatureDraw.js.map +1 -1
- package/lib/feature-draw/index.js.map +1 -1
- package/lib/feature-layer/FeatureLayer.js.map +1 -1
- package/lib/feature-layer/MyCluster.js +7 -7
- package/lib/feature-layer/MyCluster.js.map +1 -1
- package/lib/feature-layer/createFeatureCollection.js +11 -11
- 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/flow-line-layer/FlowLineLayer.js.map +1 -1
- package/lib/flow-line-layer/index.js.map +1 -1
- package/lib/flow-line-layer/style/css.js.map +1 -1
- package/lib/flow-line-layer/style/index.js.map +1 -1
- package/lib/fly-line-layer/FlyLineLayer.js.map +1 -1
- package/lib/fly-line-layer/index.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/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/HeatmapLayer.js.map +1 -1
- package/lib/heatmap-layer/index.js.map +1 -1
- package/lib/heatmap-layer/style/css.js.map +1 -1
- package/lib/heatmap-layer/style/index.js.map +1 -1
- package/lib/high-layer/HighLayer.js +2 -2
- package/lib/high-layer/HighLayer.js.map +1 -1
- package/lib/high-layer/index.js.map +1 -1
- package/lib/image-layer/ImageLayer.js.map +1 -1
- package/lib/image-layer/ImageTileLayer.js.map +1 -1
- package/lib/image-layer/index.js.map +1 -1
- package/lib/image-layer/style/css.js.map +1 -1
- package/lib/image-layer/style/index.js.map +1 -1
- package/lib/index.js.map +1 -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 +100 -100
- package/lib/map/Analysis.js.map +1 -1
- package/lib/map/Layers.js.map +1 -1
- package/lib/map/Popup.js.map +1 -1
- package/lib/map/ScaleDenominator.js.map +1 -1
- package/lib/map/Test.js.map +1 -1
- package/lib/map/defaultTextEnum.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/index.js.map +1 -1
- package/lib/map/index.js +3 -1
- package/lib/map/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 +152 -152
- package/lib/map-icon/svg/index.js.map +1 -1
- package/lib/marker/Marker.js.map +1 -1
- package/lib/marker/index.js.map +1 -1
- package/lib/path-line-layer/PathLineLayer.js.map +1 -1
- package/lib/path-line-layer/getPathLineStyles.js.map +1 -1
- package/lib/path-line-layer/index.js.map +1 -1
- package/lib/path-line-layer/style/css.js.map +1 -1
- package/lib/path-line-layer/style/index.js.map +1 -1
- package/lib/path-play-back/PathPlayBack.js.map +1 -1
- package/lib/poi-search/Location.js.map +1 -1
- package/lib/poi-search/PoiList.js.map +1 -1
- package/lib/poi-search/Search.js.map +1 -1
- package/lib/poi-search/index.js.map +1 -1
- package/lib/poi-search/style/css.js.map +1 -1
- package/lib/poi-search/style/index.js.map +1 -1
- package/lib/poi-search/style/index.less +97 -97
- package/lib/point/Point.js.map +1 -1
- package/lib/point/index.js.map +1 -1
- package/lib/polygon/Polygon.js.map +1 -1
- package/lib/polygon/index.js.map +1 -1
- package/lib/polyline/Polyline.js.map +1 -1
- package/lib/polyline/index.js.map +1 -1
- package/lib/popup/index.js.map +1 -1
- package/lib/popup/style/css.js.map +1 -1
- package/lib/popup/style/index.js.map +1 -1
- package/lib/popup/style/index.less +129 -129
- package/lib/provider/index.js.map +1 -1
- package/lib/renderer/Fill.js.map +1 -1
- package/lib/renderer/Stroke.js.map +1 -1
- 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/renderer/transformRgb.js.map +1 -1
- package/lib/search-map/VtxModal.js.map +1 -1
- package/lib/search-map/index.js +19 -6
- package/lib/search-map/index.js.map +1 -1
- package/lib/search-map/style/css.js.map +1 -1
- package/lib/search-map/style/index.js.map +1 -1
- package/lib/search-map/style/index.less +82 -82
- package/lib/search-map/style/modal.less +58 -58
- 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/tile-layer/TileLayer.js.map +1 -1
- package/lib/tile-layer/index.js.map +1 -1
- package/lib/tile-layer/style/css.js.map +1 -1
- package/lib/tile-layer/style/index.js.map +1 -1
- package/lib/tools/Layer/LayerService.js.map +1 -1
- package/lib/tools/Layer/LayersCheckService.js.map +1 -1
- package/lib/tools/Layer/index.js +2 -2
- package/lib/tools/Layer/index.js.map +1 -1
- package/lib/tools/Layer/index.less +43 -43
- package/lib/tools/Search/index.js +5 -5
- package/lib/tools/Search/index.js.map +1 -1
- package/lib/tools/Toolbox/BoxSelect/index.js +2 -2
- package/lib/tools/Toolbox/BoxSelect/index.js.map +1 -1
- package/lib/tools/Toolbox/CircleSelect/index.js +2 -2
- package/lib/tools/Toolbox/CircleSelect/index.js.map +1 -1
- package/lib/tools/Toolbox/EagleEye/index.js.map +1 -1
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js.map +1 -1
- package/lib/tools/Toolbox/MapBookmark/index.js +2 -2
- package/lib/tools/Toolbox/MapBookmark/index.js.map +1 -1
- package/lib/tools/Toolbox/MapBookmark/index.less +20 -20
- package/lib/tools/Toolbox/MapDownload/index.js.map +1 -1
- package/lib/tools/Toolbox/MapPrint/index.js +4 -4
- package/lib/tools/Toolbox/MapPrint/index.js.map +1 -1
- package/lib/tools/Toolbox/MapPrint/index.less +4 -4
- package/lib/tools/Toolbox/Measure/Area/index.js.map +1 -1
- package/lib/tools/Toolbox/Measure/Distance/index.js.map +1 -1
- package/lib/tools/Toolbox/Measure/Measure.js.map +1 -1
- package/lib/tools/Toolbox/Measure/index.js.map +1 -1
- package/lib/tools/Toolbox/PolygonSelect/index.js +2 -2
- package/lib/tools/Toolbox/PolygonSelect/index.js.map +1 -1
- package/lib/tools/Toolbox/ScaleLine/index.js.map +1 -1
- package/lib/tools/Toolbox/SelectTools/index.js +11 -11
- package/lib/tools/Toolbox/SelectTools/index.js.map +1 -1
- package/lib/tools/Toolbox/SelectTools/index.less +87 -87
- package/lib/tools/Toolbox/SpaceQuery/index.js.map +1 -1
- package/lib/tools/Toolbox/SpaceQuery/index.less +16 -16
- package/lib/tools/Toolbox/ZoomInput/index.js.map +1 -1
- package/lib/tools/Toolbox/ZoomInput/index.less +5 -5
- package/lib/tools/Toolbox/draftingPrint/index.js +2 -2
- package/lib/tools/Toolbox/draftingPrint/index.js.map +1 -1
- package/lib/tools/Toolbox/draftingPrint/index.less +34 -34
- package/lib/tools/Toolbox/index.js.map +1 -1
- package/lib/tools/Toolbox/index.less +2 -2
- package/lib/tools/Utils/CreateOverlay.js +2 -2
- package/lib/tools/Utils/CreateOverlay.js.map +1 -1
- package/lib/tools/Utils/Draw.js +4 -4
- package/lib/tools/Utils/Draw.js.map +1 -1
- package/lib/tools/Utils/HighLayer.js +2 -2
- package/lib/tools/Utils/HighLayer.js.map +1 -1
- package/lib/tools/Utils/measure.js.map +1 -1
- package/lib/tools/Utils/utils.js +17 -17
- package/lib/tools/Utils/utils.js.map +1 -1
- package/lib/tools/View/index.js.map +1 -1
- package/lib/tools/View/index.less +28 -28
- package/lib/tools/analysis-tool/index.js.map +1 -1
- package/lib/tools/base-map-switch/index.js +5 -1
- package/lib/tools/base-map-switch/index.js.map +1 -1
- package/lib/tools/components/Chart/index.js +88 -88
- package/lib/tools/components/Chart/index.js.map +1 -1
- package/lib/tools/components/Icon/index.js.map +1 -1
- package/lib/tools/components/Info/index.js.map +1 -1
- package/lib/tools/components/Info/index.less +26 -26
- package/lib/tools/components/ItemWrap/index.js.map +1 -1
- package/lib/tools/components/ItemWrap/index.less +41 -41
- package/lib/tools/components/Modal/index.js +2 -2
- package/lib/tools/components/Modal/index.js.map +1 -1
- package/lib/tools/components/Modal/index.less +33 -33
- package/lib/tools/components/MyTabs/index.js.map +1 -1
- package/lib/tools/components/RequiredLabel/index.js.map +1 -1
- package/lib/tools/components/RequiredLabel/index.less +5 -5
- package/lib/tools/components/Select/index.js.map +1 -1
- package/lib/tools/components/Table/index.js +2 -2
- package/lib/tools/components/Table/index.js.map +1 -1
- package/lib/tools/components/Table/index.less +13 -13
- package/lib/tools/components/ToolItem/index.js.map +1 -1
- package/lib/tools/components/ToolItem/index.less +27 -27
- package/lib/tools/components/ToolsSelect/index.js.map +1 -1
- package/lib/tools/components/ToolsSelect/index.less +10 -10
- package/lib/tools/full-screen/index.js.map +1 -1
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/layer-control/index.js.map +1 -1
- package/lib/tools/refresh/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 +154 -154
- package/lib/tools-item/index.js.map +1 -1
- package/lib/use-props/index.js.map +1 -1
- package/lib/wms-layer/WmsLayer.js.map +1 -1
- package/lib/wms-layer/index.js.map +1 -1
- package/lib/wms-layer/style/css.js.map +1 -1
- package/lib/wms-layer/style/index.js.map +1 -1
- package/package.json +120 -120
package/README.md
CHANGED
|
@@ -1,205 +1,205 @@
|
|
|
1
|
-
# ol-map
|
|
2
|
-
|
|
3
|
-
基于 openlayers 封装的地图库
|
|
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
|
-
|
|
80
|
-
```jsx
|
|
81
|
-
// 加载 geoserver
|
|
82
|
-
let layer = new FeatureLayer({
|
|
83
|
-
url: '/geoserver/zhsw/wms',
|
|
84
|
-
params: {
|
|
85
|
-
service: 'WFS',
|
|
86
|
-
version: '1.0.0',
|
|
87
|
-
request: 'GetFeature',
|
|
88
|
-
maxFeatures: 99999,
|
|
89
|
-
outputFormat: 'application/json',
|
|
90
|
-
typeName: 'zhsw:putian_network_access_enterprise',
|
|
91
|
-
QUERY_LAYERS: 'zhsw:putian_network_access_enterprise',
|
|
92
|
-
...params,
|
|
93
|
-
},
|
|
94
|
-
style: 'RWQY',
|
|
95
|
-
zIndex: 5,
|
|
96
|
-
key: 'SS_RWQY',
|
|
97
|
-
name: '入网企业',
|
|
98
|
-
autoRefresh: true,
|
|
99
|
-
template: feature => {
|
|
100
|
-
return <div>{feature.values_.name}</div>;
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
map.addLayer(layer);
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
```jsx
|
|
108
|
-
// 加载 接口
|
|
109
|
-
let layer = new FeatureLayer({
|
|
110
|
-
url: '/cloud/zhsw-jcss/api/device/list',
|
|
111
|
-
params: {
|
|
112
|
-
deviceTypeId: 'WATER_METER',
|
|
113
|
-
},
|
|
114
|
-
style: 'YWJ',
|
|
115
|
-
zIndex: 5,
|
|
116
|
-
key: 'SB_YWJ',
|
|
117
|
-
name: '液位计',
|
|
118
|
-
labelField: 'deviceFactoryName',
|
|
119
|
-
autoRefresh: true, // 自动刷新
|
|
120
|
-
template: feature => {
|
|
121
|
-
return <PopupTemplate feature={feature} map={map} />;
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
map.addLayer(layer);
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
```jsx
|
|
129
|
-
// 加载 数据
|
|
130
|
-
let layer = new FeatureLayer({
|
|
131
|
-
data: {
|
|
132
|
-
name: 'xxx液位计',
|
|
133
|
-
geometryInfo: { coordType: 'wgs84', type: 'point', lngLats: '119.0248,25.6389' },
|
|
134
|
-
}, // []
|
|
135
|
-
style: 'YWJ',
|
|
136
|
-
zIndex: 5,
|
|
137
|
-
key: 'SB_YWJ',
|
|
138
|
-
name: '液位计',
|
|
139
|
-
labelField: 'name',
|
|
140
|
-
autoRefresh: true, // 自动刷新
|
|
141
|
-
template: feature => {
|
|
142
|
-
return <PopupTemplate feature={feature} map={map} />;
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
map.addLayer(layer);
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
#### api
|
|
150
|
-
|
|
151
|
-
| 参数 | 说明 | 类型 | 是否必填 |
|
|
152
|
-
| ------------- | ---------------------------------------------------------------------------- | --------- | -------- |
|
|
153
|
-
| url | 图层接口 | string | 否 |
|
|
154
|
-
| method | 请求方式 | string | 否 |
|
|
155
|
-
| params | 请求参数 | object | 否 |
|
|
156
|
-
| sourceOptions | 数据源图层其他参数 | object | 否 |
|
|
157
|
-
| data | 直接通过 json 数据渲染,可忽略上面的请求,但注意必须包含 `geometryInfo` 字段 | object | 否 |
|
|
158
|
-
| features | 直接通过图形数据渲染,可忽略上面的请求 | object | 否 |
|
|
159
|
-
| key | 图层标识 | string | 是 |
|
|
160
|
-
| name | 图层名称 | string | 是 |
|
|
161
|
-
| labelField | 标签取值字段 | string | 是 |
|
|
162
|
-
| style | 图层样式,传入字符串时会直接从 MapIcon 中加载 | string | 是 |
|
|
163
|
-
| template | 缩略看板 | ReactNode | 否 |
|
|
164
|
-
| autoRefresh | 自动刷新标识 | string | 否 |
|
|
165
|
-
|
|
166
|
-
#### method
|
|
167
|
-
|
|
168
|
-
| 方法 | 说明 |
|
|
169
|
-
| ------------------------------------ | ---------------------- |
|
|
170
|
-
| refresh() | 刷新图层 |
|
|
171
|
-
| loadData(data) | 加载数据 |
|
|
172
|
-
| loadUrlData(url, params, method) | 通过接口请求加载数据 |
|
|
173
|
-
| loadFeatures(features) | 加载图形 |
|
|
174
|
-
| getFeatureByFieldValue(field, value) | 通过字段及内容查找图形 |
|
|
175
|
-
|
|
176
|
-
#### geometryInfo 说明
|
|
177
|
-
|
|
178
|
-
| 字段 | 说明 | 类型 | 是否必填 |
|
|
179
|
-
| --------- | :-------------------------------------------------------------------- | ------ | -------- |
|
|
180
|
-
| type | 图形类型: `point`、`polyline`、`polygon` | string | 是 |
|
|
181
|
-
| lngLats | 经纬度: "119.0248,25.6389", 多个: "119.0248,25.6389;119.0248,25.6389" | string | 是 |
|
|
182
|
-
| coordType | 坐标系: `wgs84`、`bmap`、`amap` | string | 是 |
|
|
183
|
-
|
|
184
|
-
### ImageLayer 图像图层
|
|
185
|
-
|
|
186
|
-
#### api
|
|
187
|
-
|
|
188
|
-
| 参数 | 说明 | 类型 | 是否必填 |
|
|
189
|
-
| ------------- | ------------------ | --------- | -------- |
|
|
190
|
-
| url | 图层接口 | string | 否 |
|
|
191
|
-
| method | 请求方式 | string | 否 |
|
|
192
|
-
| params | 请求参数 | object | 否 |
|
|
193
|
-
| sourceOptions | 数据源图层其他参数 | object | 否 |
|
|
194
|
-
| key | 图层标识 | string | 是 |
|
|
195
|
-
| name | 图层名称 | string | 是 |
|
|
196
|
-
| labelField | 标签取值字段 | string | 是 |
|
|
197
|
-
| template | 缩略看板 | ReactNode | 否 |
|
|
198
|
-
|
|
199
|
-
#### method
|
|
200
|
-
|
|
201
|
-
| 方法 | 说明 |
|
|
202
|
-
| -------------------------- | ------------------------ |
|
|
203
|
-
| getFeatureInfo(event, map) | 获取鼠标点击时的图形信息 |
|
|
204
|
-
|
|
205
|
-
### Util 工具类
|
|
1
|
+
# ol-map
|
|
2
|
+
|
|
3
|
+
基于 openlayers 封装的地图库
|
|
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
|
+
|
|
80
|
+
```jsx
|
|
81
|
+
// 加载 geoserver
|
|
82
|
+
let layer = new FeatureLayer({
|
|
83
|
+
url: '/geoserver/zhsw/wms',
|
|
84
|
+
params: {
|
|
85
|
+
service: 'WFS',
|
|
86
|
+
version: '1.0.0',
|
|
87
|
+
request: 'GetFeature',
|
|
88
|
+
maxFeatures: 99999,
|
|
89
|
+
outputFormat: 'application/json',
|
|
90
|
+
typeName: 'zhsw:putian_network_access_enterprise',
|
|
91
|
+
QUERY_LAYERS: 'zhsw:putian_network_access_enterprise',
|
|
92
|
+
...params,
|
|
93
|
+
},
|
|
94
|
+
style: 'RWQY',
|
|
95
|
+
zIndex: 5,
|
|
96
|
+
key: 'SS_RWQY',
|
|
97
|
+
name: '入网企业',
|
|
98
|
+
autoRefresh: true,
|
|
99
|
+
template: feature => {
|
|
100
|
+
return <div>{feature.values_.name}</div>;
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
map.addLayer(layer);
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
```jsx
|
|
108
|
+
// 加载 接口
|
|
109
|
+
let layer = new FeatureLayer({
|
|
110
|
+
url: '/cloud/zhsw-jcss/api/device/list',
|
|
111
|
+
params: {
|
|
112
|
+
deviceTypeId: 'WATER_METER',
|
|
113
|
+
},
|
|
114
|
+
style: 'YWJ',
|
|
115
|
+
zIndex: 5,
|
|
116
|
+
key: 'SB_YWJ',
|
|
117
|
+
name: '液位计',
|
|
118
|
+
labelField: 'deviceFactoryName',
|
|
119
|
+
autoRefresh: true, // 自动刷新
|
|
120
|
+
template: feature => {
|
|
121
|
+
return <PopupTemplate feature={feature} map={map} />;
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
map.addLayer(layer);
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
```jsx
|
|
129
|
+
// 加载 数据
|
|
130
|
+
let layer = new FeatureLayer({
|
|
131
|
+
data: {
|
|
132
|
+
name: 'xxx液位计',
|
|
133
|
+
geometryInfo: { coordType: 'wgs84', type: 'point', lngLats: '119.0248,25.6389' },
|
|
134
|
+
}, // []
|
|
135
|
+
style: 'YWJ',
|
|
136
|
+
zIndex: 5,
|
|
137
|
+
key: 'SB_YWJ',
|
|
138
|
+
name: '液位计',
|
|
139
|
+
labelField: 'name',
|
|
140
|
+
autoRefresh: true, // 自动刷新
|
|
141
|
+
template: feature => {
|
|
142
|
+
return <PopupTemplate feature={feature} map={map} />;
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
map.addLayer(layer);
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
#### api
|
|
150
|
+
|
|
151
|
+
| 参数 | 说明 | 类型 | 是否必填 |
|
|
152
|
+
| ------------- | ---------------------------------------------------------------------------- | --------- | -------- |
|
|
153
|
+
| url | 图层接口 | string | 否 |
|
|
154
|
+
| method | 请求方式 | string | 否 |
|
|
155
|
+
| params | 请求参数 | object | 否 |
|
|
156
|
+
| sourceOptions | 数据源图层其他参数 | object | 否 |
|
|
157
|
+
| data | 直接通过 json 数据渲染,可忽略上面的请求,但注意必须包含 `geometryInfo` 字段 | object | 否 |
|
|
158
|
+
| features | 直接通过图形数据渲染,可忽略上面的请求 | object | 否 |
|
|
159
|
+
| key | 图层标识 | string | 是 |
|
|
160
|
+
| name | 图层名称 | string | 是 |
|
|
161
|
+
| labelField | 标签取值字段 | string | 是 |
|
|
162
|
+
| style | 图层样式,传入字符串时会直接从 MapIcon 中加载 | string | 是 |
|
|
163
|
+
| template | 缩略看板 | ReactNode | 否 |
|
|
164
|
+
| autoRefresh | 自动刷新标识 | string | 否 |
|
|
165
|
+
|
|
166
|
+
#### method
|
|
167
|
+
|
|
168
|
+
| 方法 | 说明 |
|
|
169
|
+
| ------------------------------------ | ---------------------- |
|
|
170
|
+
| refresh() | 刷新图层 |
|
|
171
|
+
| loadData(data) | 加载数据 |
|
|
172
|
+
| loadUrlData(url, params, method) | 通过接口请求加载数据 |
|
|
173
|
+
| loadFeatures(features) | 加载图形 |
|
|
174
|
+
| getFeatureByFieldValue(field, value) | 通过字段及内容查找图形 |
|
|
175
|
+
|
|
176
|
+
#### geometryInfo 说明
|
|
177
|
+
|
|
178
|
+
| 字段 | 说明 | 类型 | 是否必填 |
|
|
179
|
+
| --------- | :-------------------------------------------------------------------- | ------ | -------- |
|
|
180
|
+
| type | 图形类型: `point`、`polyline`、`polygon` | string | 是 |
|
|
181
|
+
| lngLats | 经纬度: "119.0248,25.6389", 多个: "119.0248,25.6389;119.0248,25.6389" | string | 是 |
|
|
182
|
+
| coordType | 坐标系: `wgs84`、`bmap`、`amap` | string | 是 |
|
|
183
|
+
|
|
184
|
+
### ImageLayer 图像图层
|
|
185
|
+
|
|
186
|
+
#### api
|
|
187
|
+
|
|
188
|
+
| 参数 | 说明 | 类型 | 是否必填 |
|
|
189
|
+
| ------------- | ------------------ | --------- | -------- |
|
|
190
|
+
| url | 图层接口 | string | 否 |
|
|
191
|
+
| method | 请求方式 | string | 否 |
|
|
192
|
+
| params | 请求参数 | object | 否 |
|
|
193
|
+
| sourceOptions | 数据源图层其他参数 | object | 否 |
|
|
194
|
+
| key | 图层标识 | string | 是 |
|
|
195
|
+
| name | 图层名称 | string | 是 |
|
|
196
|
+
| labelField | 标签取值字段 | string | 是 |
|
|
197
|
+
| template | 缩略看板 | ReactNode | 否 |
|
|
198
|
+
|
|
199
|
+
#### method
|
|
200
|
+
|
|
201
|
+
| 方法 | 说明 |
|
|
202
|
+
| -------------------------- | ------------------------ |
|
|
203
|
+
| getFeatureInfo(event, map) | 获取鼠标点击时的图形信息 |
|
|
204
|
+
|
|
205
|
+
### 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 // 执行原有的callback\n callback.apply(this, rest);\n\n // 执行移除事件,删除临时方法\n this.un(eventName, fn);\n };\n\n // 执行订阅事件,绑定临时方法\n this.on(eventName, fn);\n }\n}\n\nexport default EventEmitter;\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA,IACMA,YAAY;EACd,SAAAA,aAAA,EAAc;IAAAC,eAAA,OAAAD,YAAA;IACV;IACA,IAAI,CAACE,MAAM,GAAG,CAAC,CAAC;EACpB;;EAEA;EAAA,OAAAC,YAAA,CAAAH,YAAA;IAAAI,GAAA;IAAAC,KAAA,EACA,SAAAC,EAAEA,CAACC,SAAS,EAAEC,QAAQ,EAAE;MACpB,IAAI,CAACN,MAAM,CAACK,SAAS,CAAC,GAAG,IAAI,CAACL,MAAM,CAACK,SAAS,CAAC,IAAI,EAAE;MACrD,IAAI,CAACL,MAAM,CAACK,SAAS,CAAC,CAACE,IAAI,CAACD,QAAQ,CAAC;IACzC;;IAEA;EAAA;IAAAJ,GAAA;IAAAC,KAAA,EACA,SAAAK,IAAIA,CAACH,SAAS,EAAW;MAAA,IAAAI,KAAA;MAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAANC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;QAAJF,IAAI,CAAAE,IAAA,QA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 @@
|
|
|
1
|
-
{"version":3,"file":"StyleCache.js","names":["StyleCache","_classCallCheck","cache","Map","_createClass","key","value","get","set","has","delete","clear","_default","exports"],"sources":["_util/StyleCache.js"],"sourcesContent":["\
|
|
1
|
+
{"version":3,"file":"StyleCache.js","names":["StyleCache","_classCallCheck","cache","Map","_createClass","key","value","get","set","has","delete","clear","_default","exports"],"sources":["_util/StyleCache.js"],"sourcesContent":["\nclass StyleCache {\n constructor() {\n this.cache = new Map();\n }\n\n get(key) {\n return this.cache.get(key);\n }\n\n set(key, value) {\n this.cache.set(key, value)\n }\n\n has(key) {\n return this.cache.has(key)\n }\n\n delete(key) {\n this.cache.delete(key)\n }\n\n clear() {\n this.cache.clear()\n }\n}\n\nexport default StyleCache;\n"],"mappings":";;;;;;;;;;;;IACMA,UAAU;EACZ,SAAAA,WAAA,EAAc;IAAAC,eAAA,OAAAD,UAAA;IACV,IAAI,CAACE,KAAK,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC1B;EAAC,OAAAC,YAAA,CAAAJ,UAAA;IAAAK,GAAA;IAAAC,KAAA,EAED,SAAAC,GAAGA,CAACF,GAAG,EAAE;MACL,OAAO,IAAI,CAACH,KAAK,CAACK,GAAG,CAACF,GAAG,CAAC;IAC9B;EAAC;IAAAA,GAAA;IAAAC,KAAA,EAED,SAAAE,GAAGA,CAACH,GAAG,EAAEC,KAAK,EAAE;MACZ,IAAI,CAACJ,KAAK,CAACM,GAAG,CAACH,GAAG,EAAEC,KAAK,CAAC;IAC9B;EAAC;IAAAD,GAAA;IAAAC,KAAA,EAED,SAAAG,GAAGA,CAACJ,GAAG,EAAE;MACL,OAAO,IAAI,CAACH,KAAK,CAACO,GAAG,CAACJ,GAAG,CAAC;IAC9B;EAAC;IAAAA,GAAA;IAAAC,KAAA,EAED,SAAAI,OAAMA,CAACL,GAAG,EAAE;MACR,IAAI,CAACH,KAAK,UAAO,CAACG,GAAG,CAAC;IAC1B;EAAC;IAAAA,GAAA;IAAAC,KAAA,EAED,SAAAK,KAAKA,CAAA,EAAG;MACJ,IAAI,CAACT,KAAK,CAACS,KAAK,CAAC,CAAC;IACtB;EAAC;AAAA;AAAA,IAAAC,QAAA,GAAAC,OAAA,cAGUb,UAAU","ignoreList":[]}
|
|
@@ -27,11 +27,11 @@ var encrypt = exports.encrypt = function encrypt(data, options) {
|
|
|
27
27
|
}).toString();
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
/**
|
|
31
|
-
* 加密参数
|
|
32
|
-
* @param params
|
|
33
|
-
* @param options
|
|
34
|
-
* @returns {*}
|
|
30
|
+
/**
|
|
31
|
+
* 加密参数
|
|
32
|
+
* @param params
|
|
33
|
+
* @param options
|
|
34
|
+
* @returns {*}
|
|
35
35
|
*/
|
|
36
36
|
var encryptParams = function encryptParams(params, options) {
|
|
37
37
|
var _params;
|
|
@@ -43,11 +43,11 @@ var encryptParams = function encryptParams(params, options) {
|
|
|
43
43
|
return params;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
/**
|
|
47
|
-
* 根据url判断是否加密
|
|
48
|
-
* @param params
|
|
49
|
-
* @param options
|
|
50
|
-
* @returns {*}
|
|
46
|
+
/**
|
|
47
|
+
* 根据url判断是否加密
|
|
48
|
+
* @param params
|
|
49
|
+
* @param options
|
|
50
|
+
* @returns {*}
|
|
51
51
|
*/
|
|
52
52
|
var encryptParamsByUrl = exports.encryptParamsByUrl = function encryptParamsByUrl(params, options) {
|
|
53
53
|
var encryptParam = (0, _getUrlParam["default"])('encrypt');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryptParams.js","names":["_cryptoJs","_interopRequireDefault","require","_getUrlParam","e","__esModule","_typeof","o","Symbol","iterator","constructor","prototype","keyHex","exports","ivHex","encrypt","data","options","_ref","AES_KEY","key","IV","iv","mode","CryptoJS","enc","Utf8","parse","AES","padding","pad","Pkcs7","toString","encryptParams","params","_params","cql_filter","JSON","stringify","CQL_FILTER_ENCRYPT","encodeURIComponent","encryptParamsByUrl","encryptParam","getUrlParam","_default"],"sources":["_util/encryptParams.js"],"sourcesContent":["import CryptoJS from 'crypto-js';\
|
|
1
|
+
{"version":3,"file":"encryptParams.js","names":["_cryptoJs","_interopRequireDefault","require","_getUrlParam","e","__esModule","_typeof","o","Symbol","iterator","constructor","prototype","keyHex","exports","ivHex","encrypt","data","options","_ref","AES_KEY","key","IV","iv","mode","CryptoJS","enc","Utf8","parse","AES","padding","pad","Pkcs7","toString","encryptParams","params","_params","cql_filter","JSON","stringify","CQL_FILTER_ENCRYPT","encodeURIComponent","encryptParamsByUrl","encryptParam","getUrlParam","_default"],"sources":["_util/encryptParams.js"],"sourcesContent":["import CryptoJS from 'crypto-js';\nimport getUrlParam from './getUrlParam';\n\n// 这里是密钥\nexport const keyHex = 'NT9FWl3ze1GJNqpo';\nexport const ivHex = 'vL7iWTTV7RngvKkn';\n\n// 解密 data:要加密解密的数据,AES_KEY:密钥,IV:偏移量\nexport const encrypt = (data, options) => {\n let {key: AES_KEY, iv: IV, mode} = (options && typeof options === 'object') ? options : {};\n const key = CryptoJS.enc.Utf8.parse(AES_KEY || keyHex);\n const iv = CryptoJS.enc.Utf8.parse(IV || ivHex);\n\n return CryptoJS.AES.encrypt(data, key, {\n iv,\n mode: CryptoJS.mode[mode ||'CBC'],\n padding: CryptoJS.pad.Pkcs7\n }).toString()\n}\n\n/**\n * 加密参数\n * @param params\n * @param options\n * @returns {*}\n */\nconst encryptParams = (params, options) => {\n if (params?.cql_filter) {\n params = JSON.parse(JSON.stringify(params));\n params.CQL_FILTER_ENCRYPT = encrypt(encodeURIComponent(params.cql_filter), options);\n\n delete params.cql_filter\n }\n\n return params\n}\n\n/**\n * 根据url判断是否加密\n * @param params\n * @param options\n * @returns {*}\n */\nexport const encryptParamsByUrl = (params, options) => {\n const encryptParam = getUrlParam('encrypt');\n\n if (encryptParam === 'true') {\n return encryptParams(params, options);\n }\n\n return params\n}\n\nexport default encryptParams;\n"],"mappings":";;;;;;AAAA,IAAAA,S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oBAAQ,CAACD,IAAI,CAACA,IAAI,IAAG,KAAK,CAAC;IACjCM,OAAO,EAAEL,oBAAQ,CAACM,GAAG,CAACC;EAC1B,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;AACjB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,MAAM,EAAEjB,OAAO,EAAK;EAAA,IAAAkB,OAAA;EACvC,KAAAA,OAAA,GAAID,MAAM,cAAAC,OAAA,eAANA,OAAA,CAAQC,UAAU,EAAE;IACpBF,MAAM,GAAGG,IAAI,CAACV,KAAK,CAACU,IAAI,CAACC,SAAS,CAACJ,MAAM,CAAC,CAAC;IAC3CA,MAAM,CAACK,kBAAkB,GAAGxB,OAAO,CAACyB,kBAAkB,CAACN,MAAM,CAACE,UAAU,CAAC,EAAEnB,OAAO,CAAC;IAEnF,OAAOiB,MAAM,CAACE,UAAU;EAC5B;EAEA,OAAOF,MAAM;AACjB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACO,IAAMO,kBAAkB,GAAA5B,OAAA,CAAA4B,kBAAA,GAAG,SAArBA,kBAAkBA,CAAIP,MAAM,EAAEjB,OAAO,EAAK;EACnD,IAAMyB,YAAY,GAAG,IAAAC,uBAAW,EAAC,SAAS,CAAC;EAE3C,IAAID,YAAY,KAAK,MAAM,EAAE;IACzB,OAAOT,aAAa,CAACC,MAAM,EAAEjB,OAAO,CAAC;EACzC;EAEA,OAAOiB,MAAM;AACjB,CAAC;AAAA,IAAAU,QAAA,GAAA/B,OAAA,cAEcoB,aAAa","ignoreList":[]}
|
|
@@ -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","e","__esModule","_toConsumableArray","r","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","Symbol","iterator","isArray","length","n","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","e","__esModule","_toConsumableArray","r","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","Symbol","iterator","isArray","length","n","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,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,mBAAAC,CAAA,WAAAC,kBAAA,CAAAD,CAAA,KAAAE,gBAAA,CAAAF,CAAA,KAAAG,2BAAA,CAAAH,CAAA,KAAAI,kBAAA;AAAA,SAAAA,mBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAH,CAAA,EAAAM,CAAA,QAAAN,CAAA,2BAAAA,CAAA,SAAAO,iBAAA,CAAAP,CAAA,EAAAM,CAAA,OAAAE,CAAA,MAAAC,QAAA,CAAAC,IAAA,CAAAV,CAAA,EAAA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AC,EAAE,CAAC,QAAK,GAAG,CAAC,EAAE,EAAE,CAAC;AAC/E","ignoreList":[]}
|
|
@@ -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","ignoreList":[]}
|
package/lib/_util/getCookie.js
CHANGED
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* @name cookie取值
|
|
9
|
-
* @param c_name 要取得的字段名
|
|
10
|
-
* @returns {string} 返回字段对应的值, 若字段不存在则返回空
|
|
7
|
+
/**
|
|
8
|
+
* @name cookie取值
|
|
9
|
+
* @param c_name 要取得的字段名
|
|
10
|
+
* @returns {string} 返回字段对应的值, 若字段不存在则返回空
|
|
11
11
|
*/
|
|
12
12
|
var _default = exports["default"] = function _default(c_name) {
|
|
13
13
|
if (document.cookie.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCookie.js","names":["_default","exports","c_name","document","cookie","length","c_start","indexOf","concat","c_end","unescape","substring"],"sources":["_util/getCookie.js"],"sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"getCookie.js","names":["_default","exports","c_name","document","cookie","length","c_start","indexOf","concat","c_end","unescape","substring"],"sources":["_util/getCookie.js"],"sourcesContent":["/**\n * @name cookie取值\n * @param c_name 要取得的字段名\n * @returns {string} 返回字段对应的值, 若字段不存在则返回空\n */\nexport default c_name => {\n if (document.cookie.length > 0) {\n let c_start = document.cookie.indexOf(`${c_name}=`);\n if (c_start !== -1) {\n c_start = c_start + c_name.length + 1;\n let c_end = document.cookie.indexOf(';', c_start);\n if (c_end == -1) c_end = document.cookie.length;\n return unescape(document.cookie.substring(c_start, c_end));\n }\n }\n return '';\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAJA,IAAAA,QAAA,GAAAC,OAAA,cAKe,SAAAD,SAAAE,MAAM,EAAI;EACrB,IAAIC,QAAQ,CAACC,MAAM,CAACC,MAAM,GAAG,CAAC,EAAE;IAC5B,IAAIC,OAAO,GAAGH,QAAQ,CAACC,MAAM,CAACG,OAAO,IAAAC,MAAA,CAAIN,MAAM,MAAG,CAAC;IACnD,IAAII,OAAO,KAAK,CAAC,CAAC,EAAE;MAChBA,OAAO,GAAGA,OAAO,GAAGJ,MAAM,CAACG,MAAM,GAAG,CAAC;MACrC,IAAII,KAAK,GAAGN,QAAQ,CAACC,MAAM,CAACG,OAAO,CAAC,GAAG,EAAED,OAAO,CAAC;MACjD,IAAIG,KAAK,IAAI,CAAC,CAAC,EAAEA,KAAK,GAAGN,QAAQ,CAACC,MAAM,CAACC,MAAM;MAC/C,OAAOK,QAAQ,CAACP,QAAQ,CAACC,MAAM,CAACO,SAAS,CAACL,OAAO,EAAEG,KAAK,CAAC,CAAC;IAC9D;EACJ;EACA,OAAO,EAAE;AACb,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultMapInfo.js","names":["_default","val","systemInfo","window","sessionStorage","getItem","_systemInfo2","JSON","parse","_systemInfo","longitude","latitude","mapType","mapDefJson","defaultMap","find","v","_objectSpread","coordinate","menuConfig","_menuConfig","baseMapStyle"],"sources":["_util/getDefaultMapInfo.js"],"sourcesContent":["export default () => {\
|
|
1
|
+
{"version":3,"file":"getDefaultMapInfo.js","names":["_default","val","systemInfo","window","sessionStorage","getItem","_systemInfo2","JSON","parse","_systemInfo","longitude","latitude","mapType","mapDefJson","defaultMap","find","v","_objectSpread","coordinate","menuConfig","_menuConfig","baseMapStyle"],"sources":["_util/getDefaultMapInfo.js"],"sourcesContent":["export default () => {\n let val = {};\n\n let systemInfo = window.sessionStorage.getItem('systemInfo');\n if (systemInfo) {\n systemInfo = (systemInfo && JSON.parse(systemInfo)) || {};\n\n const {longitude, latitude} = systemInfo;\n val.longitude = longitude;\n val.latitude = latitude;\n val.mapType = 'wgs84';\n\n if (systemInfo?.mapDefJson) {\n let mapDefJson = JSON.parse(systemInfo.mapDefJson);\n let defaultMap = mapDefJson.find(v => v.defaultMap) || {};\n val = {\n ...val,\n ...defaultMap,\n mapType: defaultMap.coordinate || 'wgs84',\n };\n }\n }\n\n // 获取其他配置\n let menuConfig = window.sessionStorage.getItem('menuConfig');\n if (menuConfig) {\n menuConfig = JSON.parse(menuConfig);\n if (menuConfig) {\n const {baseMapStyle} = menuConfig;\n if (baseMapStyle) {\n val.baseMapStyle = baseMapStyle;\n }\n }\n }\n\n return val;\n};\n"],"mappings":";;;;;;;;;;;;oCAAe,SAAAA,SAAA,EAAM;EACjB,IAAIC,GAAG,GAAG,CAAC,CAAC;EAEZ,IAAIC,UAAU,GAAGC,MAAM,CAACC,cAAc,CAACC,OAAO,CAAC,YAAY,CAAC;EAC5D,IAAIH,UAAU,EAAE;IAAA,IAAAI,YAAA;IACZJ,UAAU,GAAIA,UAAU,IAAIK,IAAI,CAACC,KAAK,CAACN,UAAU,CAAC,IAAK,CAAC,CAAC;IAEzD,IAAAO,WAAA,GAA8BP,UAAU;MAAjCQ,SAAS,GAAAD,WAAA,CAATC,SAAS;MAAEC,QAAQ,GAAAF,WAAA,CAARE,QAAQ;IAC1BV,GAAG,CAACS,SAAS,GAAGA,SAAS;IACzBT,GAAG,CAACU,QAAQ,GAAGA,QAAQ;IACvBV,GAAG,CAACW,OAAO,GAAG,OAAO;IAErB,KAAAN,YAAA,GAAIJ,UAAU,cAAAI,YAAA,eAAVA,YAAA,CAAYO,UAAU,EAAE;MACxB,IAAIA,UAAU,GAAGN,IAAI,CAACC,KAAK,CAACN,UAAU,CAACW,UAAU,CAAC;MAClD,IAAIC,UAAU,GAAGD,UAAU,CAACE,IAAI,CAAC,UAAAC,CAAC;QAAA,OAAIA,CAAC,CAACF,UAAU;MAAA,EAAC,IAAI,CAAC,CAAC;MACzDb,GAAG,GAAAgB,aAAA,CAAAA,aAAA,CAAAA,aAAA,KACIhB,GAAG,GACHa,UAAU;QACbF,OAAO,EAAEE,UAAU,CAACI,UAAU,IAAI;MAAO,EAC5C;IACL;EACJ;;EAEA;EACA,IAAIC,UAAU,GAAGhB,MAAM,CAACC,cAAc,CAACC,OAAO,CAAC,YAAY,CAAC;EAC5D,IAAIc,UAAU,EAAE;IACZA,UAAU,GAAGZ,IAAI,CAACC,KAAK,CAACW,UAAU,CAAC;IACnC,IAAIA,UAAU,EAAE;MACZ,IAAAC,WAAA,GAAuBD,UAAU;QAA1BE,YAAY,GAAAD,WAAA,CAAZC,YAAY;MACnB,IAAIA,YAAY,EAAE;QACdpB,GAAG,CAACoB,YAAY,GAAGA,YAAY;MACnC;IACJ;EACJ;EAEA,OAAOpB,GAAG;AACd,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSystemInfo.js","names":["_default","key","systemInfo","localStorage","getItem","system","JSON","parse","decodeURIComponent","_objectSpread","access_token","token"],"sources":["_util/getSystemInfo.js"],"sourcesContent":["export default key => {\
|
|
1
|
+
{"version":3,"file":"getSystemInfo.js","names":["_default","key","systemInfo","localStorage","getItem","system","JSON","parse","decodeURIComponent","_objectSpread","access_token","token"],"sources":["_util/getSystemInfo.js"],"sourcesContent":["export default key => {\n const systemInfo = localStorage.getItem('systemInfo');\n let system = {};\n if (systemInfo && systemInfo !== '[object Object]') {\n system = JSON.parse(decodeURIComponent(decodeURIComponent(systemInfo)));\n system = {\n ...system,\n access_token: system.token,\n };\n }\n if (key) {\n return system[key];\n }\n};\n"],"mappings":";;;;;;;;;;;;oCAAe,SAAAA,SAAAC,GAAG,EAAI;EAClB,IAAMC,UAAU,GAAGC,YAAY,CAACC,OAAO,CAAC,YAAY,CAAC;EACrD,IAAIC,MAAM,GAAG,CAAC,CAAC;EACf,IAAIH,UAAU,IAAIA,UAAU,KAAK,iBAAiB,EAAE;IAChDG,MAAM,GAAGC,IAAI,CAACC,KAAK,CAACC,kBAAkB,CAACA,kBAAkB,CAACN,UAAU,CAAC,CAAC,CAAC;IACvEG,MAAM,GAAAI,aAAA,CAAAA,aAAA,KACCJ,MAAM;MACTK,YAAY,EAAEL,MAAM,CAACM;IAAK,EAC7B;EACL;EACA,IAAIV,GAAG,EAAE;IACL,OAAOI,MAAM,CAACJ,GAAG,CAAC;EACtB;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getToken.js","names":["_utils","require","getToken","getVtxToken","imageLoadFunction","exports","image","src","xhr","XMLHttpRequest","responseType","open","setRequestHeader","concat","onload","url","URL","createObjectURL","response","img","getImage","addEventListener","revokeObjectURL","send","_default"],"sources":["_util/getToken.js"],"sourcesContent":["import { getVtxToken } from '@vtx/utils';\
|
|
1
|
+
{"version":3,"file":"getToken.js","names":["_utils","require","getToken","getVtxToken","imageLoadFunction","exports","image","src","xhr","XMLHttpRequest","responseType","open","setRequestHeader","concat","onload","url","URL","createObjectURL","response","img","getImage","addEventListener","revokeObjectURL","send","_default"],"sources":["_util/getToken.js"],"sourcesContent":["import { getVtxToken } from '@vtx/utils';\n\nconst getToken = () => {\n return getVtxToken('token');\n};\n\nexport const imageLoadFunction = (image, src) => {\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.open('GET', src);\n xhr.setRequestHeader('Authorization', `Bearer ${getToken()}`);\n xhr.onload = function() {\n const url = URL.createObjectURL(xhr.response);\n const img = image.getImage();\n img.addEventListener('load', function() {\n URL.revokeObjectURL(url);\n });\n img.src = url;\n };\n xhr.send();\n}\n\nexport default getToken;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAA,EAAS;EACnB,OAAO,IAAAC,kBAAW,EAAC,OAAO,CAAC;AAC/B,CAAC;AAEM,IAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,SAApBA,iBAAiBA,CAAIE,KAAK,EAAEC,GAAG,EAAK;EAC7C,IAAMC,GAAG,GAAG,IAAIC,cAAc,CAAC,CAAC;EAChCD,GAAG,CAACE,YAAY,GAAG,MAAM;EACzBF,GAAG,CAACG,IAAI,CAAC,KAAK,EAAEJ,GAAG,CAAC;EACpBC,GAAG,CAACI,gBAAgB,CAAC,eAAe,YAAAC,MAAA,CAAYX,QAAQ,CAAC,CAAC,CAAE,CAAC;EAC7DM,GAAG,CAACM,MAAM,GAAG,YAAW;IACpB,IAAMC,GAAG,GAAGC,GAAG,CAACC,eAAe,CAACT,GAAG,CAACU,QAAQ,CAAC;IAC7C,IAAMC,GAAG,GAAGb,KAAK,CAACc,QAAQ,CAAC,CAAC;IAC5BD,GAAG,CAACE,gBAAgB,CAAC,MAAM,EAAE,YAAW;MACpCL,GAAG,CAACM,eAAe,CAACP,GAAG,CAAC;IAC5B,CAAC,CAAC;IACFI,GAAG,CAACZ,GAAG,GAAGQ,GAAG;EACjB,CAAC;EACDP,GAAG,CAACe,IAAI,CAAC,CAAC;AACd,CAAC;AAAA,IAAAC,QAAA,GAAAnB,OAAA,cAEcH,QAAQ","ignoreList":[]}
|