@kimap/indoor-positioning-sdk-vue2 3.1.1 → 3.1.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.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "Vue2自包含室内定位SDK - 完全兼容Webpack3+Babel6 | Vue2 Self-Contained Indoor Positioning SDK",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -829,7 +829,10 @@
829
829
 
830
830
  this.customDOMs[config.id] = {
831
831
  element: el,
832
- position: config.position.clone ? config.position.clone() : config.position,
832
+ // 兼容 THREE.Vector3 和普通 {x,y,z} 对象
833
+ position: config.position.clone
834
+ ? config.position.clone()
835
+ : new THREE.Vector3(config.position.x, config.position.y, config.position.z),
833
836
  offset: config.offset || { x: 0, y: 0 }
834
837
  };
835
838
 
@@ -918,7 +921,10 @@
918
921
  };
919
922
 
920
923
  KimapSDK.prototype.worldToScreen = function(position) {
921
- var vector = position.clone();
924
+ // 兼容 THREE.Vector3 和普通 {x,y,z} 对象
925
+ var vector = position.clone
926
+ ? position.clone()
927
+ : new THREE.Vector3(position.x, position.y, position.z);
922
928
  vector.project(this.core.camera);
923
929
 
924
930
  var rect = this.core.renderer.domElement.getBoundingClientRect();