@vtx/map 1.1.23 → 1.1.25

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 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)
@@ -1963,16 +1963,25 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1963
1963
  for (var i = 0; i < ids.length; i++) {
1964
1964
  switch ((t.GM.getGraphicParam(ids[i]) || {}).geometryType) {
1965
1965
  case 'point':
1966
- allLayers.push(t.GM.getGraphic(ids[i]).getPosition());
1966
+ if (t.GM.getGraphic(ids[i])) {
1967
+ allLayers.push(t.GM.getGraphic(ids[i]).getPosition());
1968
+ }
1969
+
1967
1970
  break;
1968
1971
 
1969
1972
  case 'polyline':
1970
1973
  case 'polygon':
1971
- allLayers = [].concat(_toConsumableArray(allLayers), _toConsumableArray(t.GM.getGraphic(ids[i]).getPath()));
1974
+ if (t.GM.getGraphic(ids[i])) {
1975
+ allLayers = [].concat(_toConsumableArray(allLayers), _toConsumableArray(t.GM.getGraphic(ids[i]).getPath()));
1976
+ }
1977
+
1972
1978
  break;
1973
1979
 
1974
1980
  case 'circle':
1975
- allLayers.push(t.GM.getGraphic(ids[i]).getCenter());
1981
+ if (t.GM.getGraphic(ids[i])) {
1982
+ allLayers.push(t.GM.getGraphic(ids[i]).getCenter());
1983
+ }
1984
+
1976
1985
  break;
1977
1986
  }
1978
1987
  }