my-openlayer 1.0.13 → 1.0.14

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.
@@ -43,9 +43,7 @@ export default class MapBaseLayers {
43
43
  this.map = map;
44
44
  this.options = this.mergeDefaultOptions(options);
45
45
  // 初始化图层
46
- if (this.options?.token) {
47
- this.initializeLayers();
48
- }
46
+ this.initializeLayers();
49
47
  if (this.layers && Object.keys(this.layers).length > 0) {
50
48
  this.addMapLayer();
51
49
  const firstLayerType = Object.keys(this.layers)[0];
@@ -90,10 +88,9 @@ export default class MapBaseLayers {
90
88
  // 如果没有配置底图,则默认使用天地图底图
91
89
  if (!Array.isArray(this.options.layers)) {
92
90
  this.layers = this.options.layers || {};
93
- if (!this.options.token) {
94
- throw new Error('请配置token后才能使用天地图底图');
91
+ if (this.options.token) {
92
+ this.initTiandituLayers();
95
93
  }
96
- this.initTiandituLayers();
97
94
  }
98
95
  // 添加注记图层
99
96
  if (this.options.annotation) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "my-openlayer",
3
3
  "private": false,
4
- "version": "1.0.13",
4
+ "version": "1.0.14",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "types": "index.d.ts",