cd-mapgis 1.0.43 → 1.0.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cd-mapgis",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "main": "./src/index.js",
5
5
  "types": "./src/index.d.ts",
6
6
  "type": "module",
package/src/MapView.js CHANGED
@@ -179,6 +179,7 @@ export default class MapView {
179
179
  //地图工具 len、area
180
180
  tool(type) {
181
181
  this.clearDraw();
182
+ if (type == 'clear') return;
182
183
  let dic = { len: 'LineString', area: 'Polygon' };
183
184
  this.mapDrawUtil = new MapDrawUtil({ map: this.map });
184
185
  let t = dic[type];
@@ -198,7 +199,7 @@ export default class MapView {
198
199
  }
199
200
  //将视图调整到一个指定的图层显示范围,并返回是否调整成功.只对矢量图层有效,瓦片图层无效
200
201
  viewToLayer(layer) {
201
- let source = layer.getSource();
202
+ let source = layer.getSource();
202
203
  if (source.getFeatures().length === 0) return false;
203
204
  var extent = source.getExtent();
204
205
  let view = this.map.getView();
package/test-om.js CHANGED
@@ -1,11 +1,11 @@
1
- // 导入 OM 类
2
- import { OM } from './src/index.js';
3
-
4
- // 打印 OM 类,检查是否为类而不是字符串
5
- console.log('OM 类型:', typeof OM);
6
- console.log('OM 类定义:', OM);
7
-
8
- // 测试调用静态方法(不执行实际初始化,只检查方法是否存在)
9
- console.log('OM.initMap 存在:', typeof OM.initMap === 'function');
10
-
11
- console.log('测试完成,请检查输出结果。');
1
+ // 导入 OM 类
2
+ import { OM } from './src/index.js';
3
+
4
+ // 打印 OM 类,检查是否为类而不是字符串
5
+ console.log('OM 类型:', typeof OM);
6
+ console.log('OM 类定义:', OM);
7
+
8
+ // 测试调用静态方法(不执行实际初始化,只检查方法是否存在)
9
+ console.log('OM.initMap 存在:', typeof OM.initMap === 'function');
10
+
11
+ console.log('测试完成,请检查输出结果。');