@kimap/indoor-positioning-sdk-vue2 5.5.1 → 5.6.0

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.
@@ -1,189 +1,189 @@
1
- <template>
2
- <div ref="mapContainer" class="kimap-container"></div>
3
- </template>
4
-
5
- <script>
6
- // 使用本地KimapCore
7
- var KimapCore = require('./src/KimapCore.js');
8
- var KimapSDK = KimapCore.KimapSDK;
9
-
10
- export default {
11
- name: 'KimapComponent',
12
-
13
- props: {
14
- // OBJ模型文件URL(支持单文件string或多文件string[])
15
- objUrl: {
16
- type: [String, Array],
17
- required: true
18
- },
19
-
20
- // 3D模型数据服务器URL(用于加载kidata文件)
21
- dataUrl: {
22
- type: String,
23
- default: ''
24
- },
25
-
26
- // 原点坐标
27
- origin: {
28
- type: Object,
29
- default: function() {
30
- return { x: 0, y: 0, z: 0 };
31
- }
32
- },
33
-
34
- // X轴最大坐标
35
- maxX: {
36
- type: Number,
37
- default: 100
38
- },
39
-
40
- // Y轴最大坐标(高度)
41
- maxY: {
42
- type: Number,
43
- default: 50
44
- },
45
-
46
- // 是否显示网格
47
- showGrid: {
48
- type: Boolean,
49
- default: true
50
- },
51
-
52
- // 是否显示坐标轴
53
- showAxes: {
54
- type: Boolean,
55
- default: true
56
- },
57
-
58
- // 背景颜色
59
- backgroundColor: {
60
- type: Number,
61
- default: 0xf0f0f0
62
- }
63
- },
64
-
65
- data: function() {
66
- return {
67
- sdk: null,
68
- loading: true,
69
- error: null
70
- };
71
- },
72
-
73
- mounted: function() {
74
- this.initSDK();
75
- },
76
-
77
- beforeDestroy: function() {
78
- if (this.sdk) {
79
- this.sdk.destroy();
80
- this.sdk = null;
81
- }
82
- },
83
-
84
- methods: {
85
- initSDK: function() {
86
- var self = this;
87
-
88
- // 创建SDK实例
89
- var sdkInstance = new KimapSDK({
90
- container: self.$refs.mapContainer,
91
- objUrl: self.objUrl,
92
- dataUrl: self.dataUrl,
93
- origin: self.origin,
94
- maxX: self.maxX,
95
- maxY: self.maxY,
96
- showGrid: self.showGrid,
97
- showAxes: self.showAxes,
98
- backgroundColor: self.backgroundColor,
99
- onPositionClick: function(position, object) {
100
- self.$emit('position-click', { position: position, object: object });
101
- }
102
- });
103
-
104
- // 初始化SDK
105
- sdkInstance.init()
106
- .then(function(sdk) {
107
- self.sdk = sdk;
108
- self.loading = false;
109
- self.$emit('ready', sdk);
110
- })
111
- .catch(function(error) {
112
- console.error('SDK初始化失败:', error);
113
- self.error = error.message;
114
- self.loading = false;
115
- self.$emit('error', error);
116
- });
117
- },
118
-
119
- // 对外暴露的方法
120
- addLocationMarker: function(marker) {
121
- if (this.sdk) {
122
- this.sdk.addLocationMarker(marker);
123
- }
124
- },
125
-
126
- removeLocationMarker: function(id) {
127
- if (this.sdk) {
128
- this.sdk.removeLocationMarker(id);
129
- }
130
- },
131
-
132
- updateCurrentPosition: function(position) {
133
- if (this.sdk) {
134
- this.sdk.updateCurrentPosition(position);
135
- }
136
- },
137
-
138
- showPopup: function(info) {
139
- if (this.sdk) {
140
- this.sdk.showPopup(info);
141
- }
142
- },
143
-
144
- hidePopup: function() {
145
- if (this.sdk) {
146
- this.sdk.hidePopup();
147
- }
148
- },
149
-
150
- startDraw: function(mode, callbacks) {
151
- if (this.sdk) {
152
- this.sdk.startDraw(mode, callbacks);
153
- }
154
- },
155
-
156
- endDraw: function() {
157
- if (this.sdk) {
158
- this.sdk.endDraw();
159
- }
160
- },
161
-
162
- getSDK: function() {
163
- return this.sdk;
164
- },
165
-
166
- getCoordinateSystem: function() {
167
- if (this.sdk) {
168
- return this.sdk.getCoordinateSystem();
169
- }
170
- return null;
171
- },
172
-
173
- loadKMData: function() {
174
- if (this.sdk) {
175
- return this.sdk.loadKMData();
176
- }
177
- return Promise.resolve({ success: false, message: 'SDK未初始化' });
178
- }
179
- }
180
- };
181
- </script>
182
-
183
- <style scoped>
184
- .kimap-container {
185
- width: 100%;
186
- height: 100%;
187
- position: relative;
188
- }
189
- </style>
1
+ <template>
2
+ <div ref="mapContainer" class="kimap-container"></div>
3
+ </template>
4
+
5
+ <script>
6
+ // 使用本地KimapCore
7
+ var KimapCore = require('./src/KimapCore.js');
8
+ var KimapSDK = KimapCore.KimapSDK;
9
+
10
+ export default {
11
+ name: 'KimapComponent',
12
+
13
+ props: {
14
+ // OBJ模型文件URL(支持单文件string或多文件string[])
15
+ objUrl: {
16
+ type: [String, Array],
17
+ required: true
18
+ },
19
+
20
+ // 3D模型数据服务器URL(用于加载kidata文件)
21
+ dataUrl: {
22
+ type: String,
23
+ default: ''
24
+ },
25
+
26
+ // 原点坐标
27
+ origin: {
28
+ type: Object,
29
+ default: function() {
30
+ return { x: 0, y: 0, z: 0 };
31
+ }
32
+ },
33
+
34
+ // X轴最大坐标
35
+ maxX: {
36
+ type: Number,
37
+ default: 100
38
+ },
39
+
40
+ // Y轴最大坐标(高度)
41
+ maxY: {
42
+ type: Number,
43
+ default: 50
44
+ },
45
+
46
+ // 是否显示网格
47
+ showGrid: {
48
+ type: Boolean,
49
+ default: true
50
+ },
51
+
52
+ // 是否显示坐标轴
53
+ showAxes: {
54
+ type: Boolean,
55
+ default: true
56
+ },
57
+
58
+ // 背景颜色
59
+ backgroundColor: {
60
+ type: Number,
61
+ default: 0xf0f0f0
62
+ }
63
+ },
64
+
65
+ data: function() {
66
+ return {
67
+ sdk: null,
68
+ loading: true,
69
+ error: null
70
+ };
71
+ },
72
+
73
+ mounted: function() {
74
+ this.initSDK();
75
+ },
76
+
77
+ beforeDestroy: function() {
78
+ if (this.sdk) {
79
+ this.sdk.destroy();
80
+ this.sdk = null;
81
+ }
82
+ },
83
+
84
+ methods: {
85
+ initSDK: function() {
86
+ var self = this;
87
+
88
+ // 创建SDK实例
89
+ var sdkInstance = new KimapSDK({
90
+ container: self.$refs.mapContainer,
91
+ objUrl: self.objUrl,
92
+ dataUrl: self.dataUrl,
93
+ origin: self.origin,
94
+ maxX: self.maxX,
95
+ maxY: self.maxY,
96
+ showGrid: self.showGrid,
97
+ showAxes: self.showAxes,
98
+ backgroundColor: self.backgroundColor,
99
+ onPositionClick: function(position, object) {
100
+ self.$emit('position-click', { position: position, object: object });
101
+ }
102
+ });
103
+
104
+ // 初始化SDK
105
+ sdkInstance.init()
106
+ .then(function(sdk) {
107
+ self.sdk = sdk;
108
+ self.loading = false;
109
+ self.$emit('ready', sdk);
110
+ })
111
+ .catch(function(error) {
112
+ console.error('SDK初始化失败:', error);
113
+ self.error = error.message;
114
+ self.loading = false;
115
+ self.$emit('error', error);
116
+ });
117
+ },
118
+
119
+ // 对外暴露的方法
120
+ addLocationMarker: function(marker) {
121
+ if (this.sdk) {
122
+ this.sdk.addLocationMarker(marker);
123
+ }
124
+ },
125
+
126
+ removeLocationMarker: function(id) {
127
+ if (this.sdk) {
128
+ this.sdk.removeLocationMarker(id);
129
+ }
130
+ },
131
+
132
+ updateCurrentPosition: function(position) {
133
+ if (this.sdk) {
134
+ this.sdk.updateCurrentPosition(position);
135
+ }
136
+ },
137
+
138
+ showPopup: function(info) {
139
+ if (this.sdk) {
140
+ this.sdk.showPopup(info);
141
+ }
142
+ },
143
+
144
+ hidePopup: function() {
145
+ if (this.sdk) {
146
+ this.sdk.hidePopup();
147
+ }
148
+ },
149
+
150
+ startDraw: function(mode, callbacks) {
151
+ if (this.sdk) {
152
+ this.sdk.startDraw(mode, callbacks);
153
+ }
154
+ },
155
+
156
+ endDraw: function() {
157
+ if (this.sdk) {
158
+ this.sdk.endDraw();
159
+ }
160
+ },
161
+
162
+ getSDK: function() {
163
+ return this.sdk;
164
+ },
165
+
166
+ getCoordinateSystem: function() {
167
+ if (this.sdk) {
168
+ return this.sdk.getCoordinateSystem();
169
+ }
170
+ return null;
171
+ },
172
+
173
+ loadKMData: function() {
174
+ if (this.sdk) {
175
+ return this.sdk.loadKMData();
176
+ }
177
+ return Promise.resolve({ success: false, message: 'SDK未初始化' });
178
+ }
179
+ }
180
+ };
181
+ </script>
182
+
183
+ <style scoped>
184
+ .kimap-container {
185
+ width: 100%;
186
+ height: 100%;
187
+ position: relative;
188
+ }
189
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kimap/indoor-positioning-sdk-vue2",
3
- "version": "5.5.1",
3
+ "version": "5.6.0",
4
4
  "description": "Vue2自包含室内定位SDK - 完全兼容Webpack3+Babel6 | Vue2 Self-Contained Indoor Positioning SDK",
5
5
  "main": "index.js",
6
6
  "files": [