@vtx/map 1.1.54 → 1.2.2

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.
@@ -597,6 +597,10 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
597
597
  value: function initPropsForUser() {
598
598
  var t = this;
599
599
 
600
+ t.state.gis["fitView"] = function (arr) {
601
+ t.fitView(arr);
602
+ };
603
+
600
604
  t.state.gis["frameSelect"] = function () {
601
605
  var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
602
606
  var callback = arguments.length > 1 ? arguments[1] : undefined;
@@ -864,6 +868,21 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
864
868
 
865
869
  break;
866
870
  }
871
+ } // 设置最佳视野
872
+
873
+ }, {
874
+ key: "fitView",
875
+ value: function fitView() {
876
+ var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
877
+ var t = this;
878
+
879
+ if ((arr === null || arr === void 0 ? void 0 : arr.length) > 0) {
880
+ t.state.gis.setFitView(arr.map(function (item) {
881
+ return new AMap.Marker({
882
+ position: item
883
+ });
884
+ }));
885
+ }
867
886
  } //设置地图比例尺
868
887
 
869
888
  }, {