@vtx/map 1.1.25 → 1.1.27
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 +44 -44
- package/lib/VtxMap/BMap/Map.js +75 -0
- package/lib/VtxMap/BMap/Map.js.map +1 -1
- package/lib/VtxMap/OMap/Map.js +43 -43
- package/lib/VtxMap/OMap/Map.js.map +1 -1
- package/lib/VtxMap/OMap/Map.less +70 -70
- package/lib/VtxMap/OlMap/Map.js +23 -23
- package/lib/VtxMap/OlMap/Map.js.map +1 -1
- package/lib/VtxMap/OlMap/Map.less +230 -230
- package/lib/VtxMap/TMap/TMap.js +18 -18
- package/lib/VtxMap/TMap/TMap.js.map +1 -1
- package/lib/VtxMap/images/close.png +0 -0
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.css +10 -0
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js +84 -4
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js.map +1 -1
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.less +10 -0
- package/lib/VtxSearchCheckMap/index.js.map +1 -1
- package/lib/VtxSearchCheckMap/mapping.js.map +1 -1
- package/lib/VtxSearchMap/VtxSearchMap.css +14 -0
- package/lib/VtxSearchMap/VtxSearchMap.js +84 -4
- package/lib/VtxSearchMap/VtxSearchMap.js.map +1 -1
- package/lib/VtxSearchMap/VtxSearchMap.less +14 -0
- package/lib/VtxSearchMap/index.js.map +1 -1
- package/lib/VtxSearchMap/mapping.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
# map
|
|
2
|
-
|
|
3
|
-
> 地图控件
|
|
4
|
-
|
|
5
|
-
## 安装
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# Install
|
|
9
|
-
$ npm install @vtx/map
|
|
10
|
-
#或者
|
|
11
|
-
$ yarn add @vtx/map
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## 文档
|
|
15
|
-
|
|
16
|
-
- [VtxMap](/docs/VtxMap.md)
|
|
17
|
-
- [MapPlayer](/docs/MapPlayer.md)
|
|
18
|
-
- [VtxSearchMap](/docs/VtxSearchMap.md)
|
|
19
|
-
- [VtxOptMap](/docs/VtxOptMap.md)
|
|
20
|
-
|
|
21
|
-
### 全量导入引用方式(==不推荐==):
|
|
22
|
-
|
|
23
|
-
```js
|
|
24
|
-
# 地图组件(地图组件的ref函数现在改为getMapInstance)
|
|
25
|
-
$ import { VtxMap, VtxOptMap, VtxZoomMap } from '@vtx/map';
|
|
26
|
-
|
|
27
|
-
# 地图弹出框组件
|
|
28
|
-
$ import { VtxSearchMap } from '@vtx/map';
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### 使用 babel-plugin-import 动态加载引用方式(==推荐==):
|
|
32
|
-
|
|
33
|
-
```js
|
|
34
|
-
# 地图组件(地图组件的ref函数现在改为getMapInstance)
|
|
35
|
-
$ import { VtxMap } from '@vtx/map';
|
|
36
|
-
$ const { VtxOptMap, VtxZoomMap, MapPlayer } = VtxMap;
|
|
37
|
-
|
|
38
|
-
# 地图弹出框组件
|
|
39
|
-
$ import { VtxSearchMap } from '@vtx/map';
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## License
|
|
43
|
-
|
|
44
|
-
[MIT](https://tldrlegal.com/license/mit-license)
|
|
1
|
+
# map
|
|
2
|
+
|
|
3
|
+
> 地图控件
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install
|
|
9
|
+
$ npm install @vtx/map
|
|
10
|
+
#或者
|
|
11
|
+
$ yarn add @vtx/map
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 文档
|
|
15
|
+
|
|
16
|
+
- [VtxMap](/docs/VtxMap.md)
|
|
17
|
+
- [MapPlayer](/docs/MapPlayer.md)
|
|
18
|
+
- [VtxSearchMap](/docs/VtxSearchMap.md)
|
|
19
|
+
- [VtxOptMap](/docs/VtxOptMap.md)
|
|
20
|
+
|
|
21
|
+
### 全量导入引用方式(==不推荐==):
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
# 地图组件(地图组件的ref函数现在改为getMapInstance)
|
|
25
|
+
$ import { VtxMap, VtxOptMap, VtxZoomMap } from '@vtx/map';
|
|
26
|
+
|
|
27
|
+
# 地图弹出框组件
|
|
28
|
+
$ import { VtxSearchMap } from '@vtx/map';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 使用 babel-plugin-import 动态加载引用方式(==推荐==):
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
# 地图组件(地图组件的ref函数现在改为getMapInstance)
|
|
35
|
+
$ import { VtxMap } from '@vtx/map';
|
|
36
|
+
$ const { VtxOptMap, VtxZoomMap, MapPlayer } = VtxMap;
|
|
37
|
+
|
|
38
|
+
# 地图弹出框组件
|
|
39
|
+
$ import { VtxSearchMap } from '@vtx/map';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
[MIT](https://tldrlegal.com/license/mit-license)
|
package/lib/VtxMap/BMap/Map.js
CHANGED
|
@@ -135,6 +135,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
135
135
|
|
|
136
136
|
_this.movePoints = []; //移动点的动画集合
|
|
137
137
|
|
|
138
|
+
_this.popupWindow = null;
|
|
138
139
|
_this.state = {
|
|
139
140
|
gis: null,
|
|
140
141
|
//地图对象
|
|
@@ -238,6 +239,15 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
238
239
|
}));
|
|
239
240
|
}
|
|
240
241
|
|
|
242
|
+
if (!window.BMapLib || !window.BMapLib.InfoBox) {
|
|
243
|
+
loadList.push(new Promise(function (resolve, reject) {
|
|
244
|
+
$.getScript("".concat(_default2["default"].mapServerURL, "/InfoBox_min.js"), function () {
|
|
245
|
+
resolve();
|
|
246
|
+
});
|
|
247
|
+
}));
|
|
248
|
+
loadList.push();
|
|
249
|
+
}
|
|
250
|
+
|
|
241
251
|
loadList.push(new Promise(function (resolve, reject) {
|
|
242
252
|
$.getScript("".concat(_default2["default"].mapServerURL, "/TextIconOverlay_min.js"), function () {
|
|
243
253
|
resolve();
|
|
@@ -591,6 +601,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
591
601
|
}
|
|
592
602
|
});
|
|
593
603
|
}
|
|
604
|
+
|
|
605
|
+
t.initPropsForUser();
|
|
594
606
|
}
|
|
595
607
|
/*
|
|
596
608
|
切换地图矢量图和卫星图背景
|
|
@@ -3101,6 +3113,39 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3101
3113
|
upds: upds,
|
|
3102
3114
|
otherads: otherads
|
|
3103
3115
|
};
|
|
3116
|
+
} // 信息窗口
|
|
3117
|
+
|
|
3118
|
+
}, {
|
|
3119
|
+
key: "showInfoWindow",
|
|
3120
|
+
value: function showInfoWindow(params) {
|
|
3121
|
+
var t = this;
|
|
3122
|
+
|
|
3123
|
+
if (t.popupWindow) {
|
|
3124
|
+
t.hideInfoWindow();
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
var poi = new BMap.Point(params.position[0], params.position[1]);
|
|
3128
|
+
t.popupWindow = new BMapLib.InfoBox(t.state.gis, params.content, {
|
|
3129
|
+
boxStyle: params.boxStyle,
|
|
3130
|
+
closeIconMargin: "1px 1px 0 0",
|
|
3131
|
+
enableAutoPan: true,
|
|
3132
|
+
align: 1,
|
|
3133
|
+
closeIconUrl: params.closeIconUrl || "".concat(_default2["default"].mapServerURL, "/images/close.png")
|
|
3134
|
+
});
|
|
3135
|
+
var marker = new BMap.Marker(poi);
|
|
3136
|
+
t.popupWindow.open(marker);
|
|
3137
|
+
} // 关闭信息窗口
|
|
3138
|
+
|
|
3139
|
+
}, {
|
|
3140
|
+
key: "hideInfoWindow",
|
|
3141
|
+
value: function hideInfoWindow() {
|
|
3142
|
+
var t = this;
|
|
3143
|
+
|
|
3144
|
+
if (t.popupWindow) {
|
|
3145
|
+
t.popupWindow.close();
|
|
3146
|
+
}
|
|
3147
|
+
|
|
3148
|
+
t.popupWindow = null;
|
|
3104
3149
|
} //百度搜索功能
|
|
3105
3150
|
|
|
3106
3151
|
}, {
|
|
@@ -3605,6 +3650,36 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3605
3650
|
if (nextProps.satelliteSwitch && JSON.stringify(nextProps.satelliteSwitch) != JSON.stringify(t.props.satelliteSwitch)) {
|
|
3606
3651
|
t.showMapTypeControl(nextProps);
|
|
3607
3652
|
}
|
|
3653
|
+
} // 初始化对外方法
|
|
3654
|
+
|
|
3655
|
+
}, {
|
|
3656
|
+
key: "initPropsForUser",
|
|
3657
|
+
value: function initPropsForUser() {
|
|
3658
|
+
var t = this;
|
|
3659
|
+
|
|
3660
|
+
t.state.gis["getCenter"] = function () {
|
|
3661
|
+
return t.getCenter();
|
|
3662
|
+
};
|
|
3663
|
+
|
|
3664
|
+
t.state.gis["setCenter"] = function (gt) {
|
|
3665
|
+
t.setCenter(gt);
|
|
3666
|
+
};
|
|
3667
|
+
|
|
3668
|
+
t.state.gis["getZoomLevel"] = function () {
|
|
3669
|
+
return t.getZoomLevel();
|
|
3670
|
+
};
|
|
3671
|
+
|
|
3672
|
+
t.state.gis["showInfoWindow"] = function (obj) {
|
|
3673
|
+
return t.showInfoWindow(obj);
|
|
3674
|
+
};
|
|
3675
|
+
|
|
3676
|
+
t.state.gis["hideInfoWindow"] = function () {
|
|
3677
|
+
return t.hideInfoWindow();
|
|
3678
|
+
};
|
|
3679
|
+
|
|
3680
|
+
t.state.gis["refresh"] = function () {
|
|
3681
|
+
t.refresh();
|
|
3682
|
+
};
|
|
3608
3683
|
}
|
|
3609
3684
|
}, {
|
|
3610
3685
|
key: "componentWillUnmount",
|