@vtx/map 1.2.5 → 1.2.7

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.
@@ -156,6 +156,7 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
156
156
  bl: 'LB',
157
157
  br: 'RB'
158
158
  };
159
+ _this.language = props.language || 'zh_cn';
159
160
  _this.frameSelectProps = {};
160
161
 
161
162
  _this.loadMapJs();
@@ -372,7 +373,8 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
372
373
  zoom: mapZoomLevel || 10,
373
374
  //不传中心点,高德地图默认使用用户所在地的城市为中心点
374
375
  center: mapCenter && mapCenter instanceof Array && mapCenter.length == 2 ? mapCenter : [116.400433, 39.906705],
375
- zooms: [minZoom || 3, maxZoom || 18]
376
+ zooms: [minZoom || 3, maxZoom || 18],
377
+ lang: t.language
376
378
  });
377
379
 
378
380
  if (mapStyle) {
@@ -614,6 +616,10 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
614
616
  t.state.gis["clearFrameSelectById"] = function (id) {
615
617
  return t.clearFrameSelectById(id);
616
618
  };
619
+
620
+ t.state.gis["setLanguage"] = function (type) {
621
+ return t.setLanguage(type);
622
+ };
617
623
  } // 框选
618
624
 
619
625
  }, {
@@ -700,6 +706,12 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
700
706
  break;
701
707
  }
702
708
  }
709
+ } // 设置底图语言
710
+
711
+ }, {
712
+ key: "setLanguage",
713
+ value: function setLanguage(type) {
714
+ this.state.gis.setLang(type || this.language);
703
715
  } //增加图片图层
704
716
 
705
717
  }, {
@@ -3139,8 +3151,14 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
3139
3151
  isClearAreaRestriction = nextProps.isClearAreaRestriction,
3140
3152
  mapStyle = nextProps.mapStyle,
3141
3153
  coverageType = nextProps.coverageType,
3142
- infoWindowData = nextProps.infoWindowData;
3143
- var props = t.props; // 设置地图样式
3154
+ infoWindowData = nextProps.infoWindowData,
3155
+ language = nextProps.language;
3156
+ var props = t.props;
3157
+
3158
+ if (language && !t.deepEqual(language, t.props.language)) {
3159
+ t.setLanguage(language);
3160
+ } // 设置地图样式
3161
+
3144
3162
 
3145
3163
  if (mapStyle && !t.deepEqual(mapStyle, t.props.mapStyle)) {
3146
3164
  t.state.gis.setMapStyle(mapStyle);