@vtx/map 1.2.37 → 1.2.39
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/OlMap/Map.js
CHANGED
|
@@ -478,13 +478,13 @@ var OlMap = /*#__PURE__*/function (_React$Component) {
|
|
|
478
478
|
maxZoom = 19;
|
|
479
479
|
}
|
|
480
480
|
if (epsg) {
|
|
481
|
-
console.log('epsg', epsg, proj4);
|
|
482
481
|
projection = "EPSG:".concat(epsg);
|
|
483
482
|
_proj["default"].defs("EPSG:".concat(epsg), proj4);
|
|
484
483
|
ol.proj.proj4.register(_proj["default"]);
|
|
485
484
|
} else {
|
|
486
485
|
projection = projection || 'EPSG:4326';
|
|
487
486
|
}
|
|
487
|
+
|
|
488
488
|
//中心点
|
|
489
489
|
var center = mapCenter && mapCenter instanceof Array && mapCenter.length == 2 ? mapCenter : [116.400433, 39.906705];
|
|
490
490
|
center = [parseFloat(center[0]), parseFloat(center[1])];
|
|
@@ -521,7 +521,11 @@ var OlMap = /*#__PURE__*/function (_React$Component) {
|
|
|
521
521
|
value: function projectToWGS84(point, eg) {
|
|
522
522
|
var t = this;
|
|
523
523
|
var epsg = t.props.olProps.epsg;
|
|
524
|
-
|
|
524
|
+
if (eg || epsg) {
|
|
525
|
+
return (0, _proj["default"])("EPSG:".concat(eg || epsg), 'EPSG:4326', point);
|
|
526
|
+
} else {
|
|
527
|
+
return point;
|
|
528
|
+
}
|
|
525
529
|
}
|
|
526
530
|
|
|
527
531
|
// 计算面积
|
|
@@ -2523,7 +2527,6 @@ var OlMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2523
2527
|
});
|
|
2524
2528
|
if (t.pointFeatureLayer) {
|
|
2525
2529
|
var source = t.pointFeatureLayer.getSource();
|
|
2526
|
-
console.log(source);
|
|
2527
2530
|
var oldFeatures = source.getFeatures();
|
|
2528
2531
|
var newFeatures = [],
|
|
2529
2532
|
updateFeatureIds = [];
|