@vtx/map 1.2.12 → 1.2.13

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.
@@ -159,9 +159,15 @@ var OlMap = /*#__PURE__*/function (_React$Component) {
159
159
  });
160
160
  } else {
161
161
  if (first) {
162
- var _layer = eval(OL_SCREEN.tmap_normal.initLayer);
162
+ var layers = eval(OL_SCREEN.tmap_normal.initLayer);
163
163
 
164
- t.state.gis.addLayer(_layer);
164
+ if ((0, _lodash.isArray)(layers)) {
165
+ layers.map(function (layer) {
166
+ t.state.gis.addLayer(layer);
167
+ });
168
+ } else {
169
+ t.state.gis.addLayer(layers);
170
+ }
165
171
  }
166
172
  }
167
173
  });
@@ -662,15 +668,15 @@ var OlMap = /*#__PURE__*/function (_React$Component) {
662
668
  url: url
663
669
  }, sourceOptions)));
664
670
 
665
- var _layer2 = new ol.layer.Tile({
671
+ var _layer = new ol.layer.Tile({
666
672
  source: layerSource
667
673
  }); // 将图层添加到地图上
668
674
 
669
675
 
670
- this.state.gis.addLayer(_layer2);
676
+ this.state.gis.addLayer(_layer);
671
677
  this.olLayers.push({
672
678
  address: url,
673
- layer: _layer2
679
+ layer: _layer
674
680
  });
675
681
  }
676
682
  } // 添加超图图层