@vtx/map 1.2.33 → 1.2.34
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.
|
@@ -434,7 +434,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
434
434
|
longitude = _t$state$searchValue$2[0],
|
|
435
435
|
latitude = _t$state$searchValue$2[1];
|
|
436
436
|
t.setState({
|
|
437
|
-
mapCenter: [longitude, latitude],
|
|
437
|
+
mapCenter: [Number(longitude), Number(latitude)],
|
|
438
438
|
setCenter: true
|
|
439
439
|
}, function () {
|
|
440
440
|
t.setState({
|
|
@@ -1319,11 +1319,10 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1319
1319
|
}, {
|
|
1320
1320
|
key: "UNSAFE_componentWillReceiveProps",
|
|
1321
1321
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
1322
|
-
var _this0 = this;
|
|
1323
1322
|
var t = this;
|
|
1324
|
-
|
|
1325
|
-
if (t.state.graphicType !== nextProps.graphicType && !!
|
|
1326
|
-
|
|
1323
|
+
t.isClickMap = false;
|
|
1324
|
+
if (t.state.graphicType !== nextProps.graphicType && !!t.map) {
|
|
1325
|
+
t.map.clearAll();
|
|
1327
1326
|
t.mapLoaded = false;
|
|
1328
1327
|
t.isinit = true;
|
|
1329
1328
|
}
|
|
@@ -1331,7 +1330,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1331
1330
|
t.mapLoaded = false;
|
|
1332
1331
|
}
|
|
1333
1332
|
t.isDrawStatus = nextProps.graphicType !== 'point' && !nextProps.editParam;
|
|
1334
|
-
|
|
1333
|
+
t.setState({
|
|
1335
1334
|
modal1Visible: nextProps.modal1Visible,
|
|
1336
1335
|
maxZoom: nextProps.maxZoom,
|
|
1337
1336
|
minZoom: nextProps.minZoom,
|
|
@@ -1354,36 +1353,38 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1354
1353
|
setTimeout(function () {
|
|
1355
1354
|
//实现2+次进入时,清理数据
|
|
1356
1355
|
if (nextProps.modal1Visible) {
|
|
1357
|
-
|
|
1358
|
-
|
|
1356
|
+
t.clearList();
|
|
1357
|
+
t.setState({
|
|
1359
1358
|
setZoomLevel: true
|
|
1360
1359
|
}, function () {
|
|
1361
|
-
|
|
1360
|
+
t.setState({
|
|
1362
1361
|
setZoomLevel: false
|
|
1363
1362
|
});
|
|
1364
1363
|
});
|
|
1365
|
-
if (!!
|
|
1366
|
-
if (
|
|
1364
|
+
if (!!t.map && !!t.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
|
|
1365
|
+
if (t.map.getGraphic('locationPoint')) {
|
|
1367
1366
|
switch (nextProps.mapType) {
|
|
1368
1367
|
case 'bmap':
|
|
1369
|
-
|
|
1368
|
+
t.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1370
1369
|
break;
|
|
1371
1370
|
case 'amap':
|
|
1372
|
-
|
|
1371
|
+
t.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1373
1372
|
break;
|
|
1374
1373
|
case 'tmap':
|
|
1375
|
-
|
|
1374
|
+
t.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1376
1375
|
break;
|
|
1377
1376
|
case 'gmap':
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1377
|
+
if (t.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude) {
|
|
1378
|
+
t.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
|
|
1379
|
+
t.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
|
|
1380
|
+
t.map.state.gis.graphics.refresh();
|
|
1381
|
+
}
|
|
1381
1382
|
case 'olMap':
|
|
1382
|
-
window.ol &&
|
|
1383
|
+
window.ol && t.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
|
|
1383
1384
|
break;
|
|
1384
1385
|
}
|
|
1385
1386
|
}
|
|
1386
|
-
|
|
1387
|
+
t.map.setCenter(nextProps.mapCenter);
|
|
1387
1388
|
}
|
|
1388
1389
|
}
|
|
1389
1390
|
}, 100);
|