@vtx/map 1.1.24 → 1.1.26
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/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",
|