@kimap/indoor-positioning-sdk-vue2 3.3.0 → 3.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kimap/indoor-positioning-sdk-vue2",
3
- "version": "3.3.0",
3
+ "version": "3.4.2",
4
4
  "description": "Vue2自包含室内定位SDK - 完全兼容Webpack3+Babel6 | Vue2 Self-Contained Indoor Positioning SDK",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -159,7 +159,10 @@
159
159
  config.modelToRealScale = parseFloat(line.split(' ')[2]);
160
160
  }
161
161
 
162
- if (line.indexOf('End Config Info') !== -1) break;
162
+ // 只在遇到 End Config Info 时停止(不要在 End Border Info 时停止)
163
+ if (line.indexOf('End Config Info') !== -1) {
164
+ break;
165
+ }
163
166
  }
164
167
 
165
168
  return foundConfig ? config : null;
package/src/KimapCore.js CHANGED
@@ -252,8 +252,8 @@ function extractMapConfigFromOBJ(objContent) {
252
252
  config.modelToRealScale = parseFloat(line.split(' ')[2]);
253
253
  }
254
254
 
255
- // 如果遇到 End Config Info 或其他结束标记,停止解析
256
- if (line.indexOf('End Config Info') !== -1 || line.indexOf('===== End Border Info =====') !== -1) {
255
+ // 只在遇到 End Config Info 时停止(不要在 End Border Info 时停止)
256
+ if (line.indexOf('End Config Info') !== -1) {
257
257
  break;
258
258
  }
259
259
  }
@@ -523,19 +523,16 @@ SceneCore.prototype.loadMap = function(OBJLoader, MTLLoader) {
523
523
  var borderInfo = extractBorderFromOBJ(objContent);
524
524
  if (borderInfo) {
525
525
  console.log('✅ 提取到边界信息:', borderInfo);
526
- // 存储到SDK实例中(需要通过回调或全局引用)
527
- if (self.sdk && self.sdk._setBorderInfo) {
528
- self.sdk._setBorderInfo(borderInfo);
529
- }
526
+ // 保存到SceneCore实例
527
+ self._borderInfo = borderInfo;
530
528
  }
531
529
 
532
530
  // 提取地图配置信息(校准数据)
533
531
  var mapConfig = extractMapConfigFromOBJ(objContent);
534
532
  if (mapConfig && mapConfig.isCalibrated) {
535
533
  console.log('✅ 提取到校准数据:', mapConfig);
536
- if (self.sdk && self.sdk._setMapConfig) {
537
- self.sdk._setMapConfig(mapConfig);
538
- }
534
+ // 保存到SceneCore实例
535
+ self._mapConfig = mapConfig;
539
536
  }
540
537
 
541
538
  // 提取颜色信息(作为备用)
@@ -941,6 +938,14 @@ KimapSDK.prototype.init = function() {
941
938
  return self.core.init();
942
939
  })
943
940
  .then(function() {
941
+ // 从SceneCore传递边界和配置信息到KimapSDK
942
+ if (self.core._borderInfo) {
943
+ self._borderInfo = self.core._borderInfo;
944
+ }
945
+ if (self.core._mapConfig) {
946
+ self._mapConfig = self.core._mapConfig;
947
+ }
948
+
944
949
  // 加载模块
945
950
  var TrackingModule = require('./modules/TrackingModule.js');
946
951
  var DrawingModule = require('./modules/DrawingModule.js');