@situm/cordova 3.16.0 → 3.17.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.
- package/CHANGELOG_UNRELEASED.md +12 -2
- package/example/android/app/capacitor.build.gradle +1 -2
- package/example/android/build.gradle +1 -1
- package/example/android/capacitor.settings.gradle +9 -9
- package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/example/android/variables.gradle +2 -2
- package/example/src/app/sdk/sdk.page.html +7 -7
- package/example/src/app/sdk/sdk.page.scss +5 -3
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/android/app/build.gradle +1 -1
- package/src/android/situm.gradle +1 -1
- package/www/map-view-controller.js +21 -206
package/CHANGELOG_UNRELEASED.md
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
## Unreleased
|
|
2
|
+
|
|
3
|
+
### Updated
|
|
4
|
+
- Updated Android example app targetSdkVersion and compileSdkVersion from 33 to 37.
|
|
5
|
+
- Updated gradle wrapper version from 8.4 to 8.13.
|
|
6
|
+
- Updated AGP (com.android.application) from 8.0.0 to 8.13.2.
|
|
7
|
+
|
|
8
|
+
### Removed
|
|
9
|
+
- Removed the legacy routing and navigation bridge between the MapView and the native SDK, as the MapView now always uses its own routing and navigation library.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Deprecated the `use-viewer-navigation` MapView attribute. It is now ignored and kept only for backward compatibility.
|
|
@@ -17,8 +17,7 @@ dependencies {
|
|
|
17
17
|
implementation project(':capacitor-keyboard')
|
|
18
18
|
implementation project(':capacitor-preferences')
|
|
19
19
|
implementation project(':capacitor-status-bar')
|
|
20
|
-
|
|
21
|
-
implementation "androidx.appcompat:appcompat:1.3.1"
|
|
20
|
+
|
|
22
21
|
}
|
|
23
22
|
apply from: "../../../src/android/situm.gradle"
|
|
24
23
|
|
|
@@ -7,7 +7,7 @@ buildscript {
|
|
|
7
7
|
mavenCentral()
|
|
8
8
|
}
|
|
9
9
|
dependencies {
|
|
10
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
10
|
+
classpath 'com.android.tools.build:gradle:8.13.2'
|
|
11
11
|
classpath 'com.google.gms:google-services:4.3.15'
|
|
12
12
|
|
|
13
13
|
// NOTE: Do not place your application dependencies here; they belong
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
|
|
2
2
|
include ':capacitor-android'
|
|
3
|
-
project(':capacitor-android').projectDir = new File('
|
|
3
|
+
project(':capacitor-android').projectDir = new File('../../node_modules/.pnpm/@capacitor+android@5.5.1_@capacitor+core@5.7.8/node_modules/@capacitor/android/capacitor')
|
|
4
4
|
|
|
5
5
|
include ':capacitor-app'
|
|
6
|
-
project(':capacitor-app').projectDir = new File('
|
|
6
|
+
project(':capacitor-app').projectDir = new File('../../node_modules/.pnpm/@capacitor+app@5.0.6_@capacitor+core@5.7.8/node_modules/@capacitor/app/android')
|
|
7
7
|
|
|
8
8
|
include ':capacitor-camera'
|
|
9
|
-
project(':capacitor-camera').projectDir = new File('
|
|
9
|
+
project(':capacitor-camera').projectDir = new File('../../node_modules/.pnpm/@capacitor+camera@5.0.10_@capacitor+core@5.7.8/node_modules/@capacitor/camera/android')
|
|
10
10
|
|
|
11
11
|
include ':capacitor-filesystem'
|
|
12
|
-
project(':capacitor-filesystem').projectDir = new File('
|
|
12
|
+
project(':capacitor-filesystem').projectDir = new File('../../node_modules/.pnpm/@capacitor+filesystem@5.2.2_@capacitor+core@5.7.8/node_modules/@capacitor/filesystem/android')
|
|
13
13
|
|
|
14
14
|
include ':capacitor-geolocation'
|
|
15
|
-
project(':capacitor-geolocation').projectDir = new File('
|
|
15
|
+
project(':capacitor-geolocation').projectDir = new File('../../node_modules/.pnpm/@capacitor+geolocation@5.0.8_@capacitor+core@5.7.8/node_modules/@capacitor/geolocation/android')
|
|
16
16
|
|
|
17
17
|
include ':capacitor-haptics'
|
|
18
|
-
project(':capacitor-haptics').projectDir = new File('
|
|
18
|
+
project(':capacitor-haptics').projectDir = new File('../../node_modules/.pnpm/@capacitor+haptics@5.0.6_@capacitor+core@5.7.8/node_modules/@capacitor/haptics/android')
|
|
19
19
|
|
|
20
20
|
include ':capacitor-keyboard'
|
|
21
|
-
project(':capacitor-keyboard').projectDir = new File('
|
|
21
|
+
project(':capacitor-keyboard').projectDir = new File('../../node_modules/.pnpm/@capacitor+keyboard@5.0.6_@capacitor+core@5.7.8/node_modules/@capacitor/keyboard/android')
|
|
22
22
|
|
|
23
23
|
include ':capacitor-preferences'
|
|
24
|
-
project(':capacitor-preferences').projectDir = new File('
|
|
24
|
+
project(':capacitor-preferences').projectDir = new File('../../node_modules/.pnpm/@capacitor+preferences@5.0.8_@capacitor+core@5.7.8/node_modules/@capacitor/preferences/android')
|
|
25
25
|
|
|
26
26
|
include ':capacitor-status-bar'
|
|
27
|
-
project(':capacitor-status-bar').projectDir = new File('
|
|
27
|
+
project(':capacitor-status-bar').projectDir = new File('../../node_modules/.pnpm/@capacitor+status-bar@5.0.6_@capacitor+core@5.7.8/node_modules/@capacitor/status-bar/android')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
|
|
4
4
|
networkTimeout=10000
|
|
5
5
|
zipStoreBase=GRADLE_USER_HOME
|
|
6
6
|
zipStorePath=wrapper/dists
|
|
@@ -93,16 +93,16 @@
|
|
|
93
93
|
</ion-card>
|
|
94
94
|
|
|
95
95
|
<ion-card>
|
|
96
|
+
<ion-card-header>
|
|
97
|
+
<ion-card-title>{{ currentStatus }}</ion-card-title>
|
|
98
|
+
</ion-card-header>
|
|
96
99
|
<ion-card-content>
|
|
97
|
-
<ion-item>
|
|
98
|
-
<ion-label>{{ currentStatus }}</ion-label>
|
|
99
|
-
</ion-item>
|
|
100
|
-
|
|
101
100
|
<ion-textarea
|
|
102
|
-
class="
|
|
101
|
+
class="positioning-info-textarea"
|
|
103
102
|
[readonly]="true"
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
[autoGrow]="false"
|
|
104
|
+
rows="45"
|
|
105
|
+
value="{{ currentPositioningInfo }}"
|
|
106
106
|
/>
|
|
107
107
|
</ion-card-content>
|
|
108
108
|
</ion-card>
|
|
@@ -18,7 +18,9 @@ ion-item.custom {
|
|
|
18
18
|
--margin-end: 0px;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
ion-textarea.
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
ion-textarea.positioning-info-textarea {
|
|
22
|
+
display: block;
|
|
23
|
+
max-height: 200vh;
|
|
24
|
+
overflow-y: auto;
|
|
25
|
+
--color: var(--ion-color-dark);
|
|
24
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@situm/cordova",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.0",
|
|
4
4
|
"description": "Situm Wayfinding for Capacitor and Cordova. Integrate plug&play indoor navigation experience with floorplans, POIs, routes and turn-by-turn directions in no time. With the power of Situm.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": "https://github.com/situmtech/cordova",
|
package/plugin.xml
CHANGED
|
@@ -44,7 +44,7 @@ dependencies {
|
|
|
44
44
|
implementation ('com.googlecode.json-simple:json-simple:1.1.1'){
|
|
45
45
|
exclude group: 'junit', module:'junit'
|
|
46
46
|
}
|
|
47
|
-
implementation ('es.situm:situm-sdk:3.37.
|
|
47
|
+
implementation ('es.situm:situm-sdk:3.37.1@aar') {
|
|
48
48
|
transitive = true
|
|
49
49
|
}
|
|
50
50
|
implementation 'org.apache.cordova:framework:10.1.1'
|
package/src/android/situm.gradle
CHANGED
|
@@ -49,10 +49,7 @@ class MapViewControllerImpl {
|
|
|
49
49
|
_onLoadCallback = undefined;
|
|
50
50
|
_onPoiSelectedCallback = undefined;
|
|
51
51
|
_onPoiDeselectedCallback = undefined;
|
|
52
|
-
_buildings = undefined;
|
|
53
52
|
_mapView = undefined;
|
|
54
|
-
_isNavigating = false;
|
|
55
|
-
_navigationType = "";
|
|
56
53
|
_isWaitingForAuth = false;
|
|
57
54
|
|
|
58
55
|
constructor() {
|
|
@@ -62,21 +59,12 @@ class MapViewControllerImpl {
|
|
|
62
59
|
|
|
63
60
|
_prepare(mapView) {
|
|
64
61
|
this._mapView = mapView;
|
|
65
|
-
let useViewerNavigation = mapView.getAttribute('use-viewer-navigation')
|
|
66
|
-
? mapView.getAttribute('use-viewer-navigation')
|
|
67
|
-
: null;
|
|
68
|
-
if (useViewerNavigation != null) {
|
|
69
|
-
this._setNavigationType(useViewerNavigation);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
62
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
this._navigationType = 'sdk';
|
|
79
|
-
}
|
|
63
|
+
if (mapView.hasAttribute('use-viewer-navigation')) {
|
|
64
|
+
console.warn(
|
|
65
|
+
'Situm> MapView> [!] The "use-viewer-navigation" attribute is deprecated and ignored. ' +
|
|
66
|
+
'The MapView always uses its own routing and navigation library.'
|
|
67
|
+
);
|
|
80
68
|
}
|
|
81
69
|
}
|
|
82
70
|
|
|
@@ -127,17 +115,6 @@ class MapViewControllerImpl {
|
|
|
127
115
|
|
|
128
116
|
_handleOnLocationUpdate(payload) {
|
|
129
117
|
this._sendMessageToViewer('location.update', payload);
|
|
130
|
-
if (this._isNavigating) {
|
|
131
|
-
Situm.updateNavigationWithLocation(
|
|
132
|
-
[payload],
|
|
133
|
-
() => {
|
|
134
|
-
// Do nothing.
|
|
135
|
-
},
|
|
136
|
-
() => {
|
|
137
|
-
console.error('Error at updateNavigationWithLocation');
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
118
|
}
|
|
142
119
|
|
|
143
120
|
_handleOnLocationStatus(payload) {
|
|
@@ -177,15 +154,6 @@ class MapViewControllerImpl {
|
|
|
177
154
|
};
|
|
178
155
|
this._onPoiDeselectedCallback(poiDeselectedResult);
|
|
179
156
|
break;
|
|
180
|
-
case 'directions.requested':
|
|
181
|
-
this._onDirectionsRequested(m.payload);
|
|
182
|
-
break;
|
|
183
|
-
case 'navigation.requested':
|
|
184
|
-
this._onNavigationRequested(m.payload);
|
|
185
|
-
break;
|
|
186
|
-
case 'navigation.stopped':
|
|
187
|
-
this._onNavigationCancel();
|
|
188
|
-
break;
|
|
189
157
|
case 'viewer.navigation.started':
|
|
190
158
|
this._onViewerNavigationStarted(m.payload);
|
|
191
159
|
break;
|
|
@@ -211,9 +179,6 @@ class MapViewControllerImpl {
|
|
|
211
179
|
this._onLoadCallback(this);
|
|
212
180
|
console.debug('Map is ready!');
|
|
213
181
|
}
|
|
214
|
-
if (this._navigationType) {
|
|
215
|
-
this._sendNavigationConfig(this._navigationType);
|
|
216
|
-
}
|
|
217
182
|
this._sendMessageToViewer('app.set_config_item', [
|
|
218
183
|
{key: "internal.tts.engine", value: "mobile"},
|
|
219
184
|
// Any other config item here...
|
|
@@ -240,180 +205,34 @@ class MapViewControllerImpl {
|
|
|
240
205
|
);
|
|
241
206
|
}
|
|
242
207
|
|
|
243
|
-
// Fetch the given building and return it or undefined if not found.
|
|
244
|
-
_ensureBuilding(buildingId, callback) {
|
|
245
|
-
if (this._buildings) {
|
|
246
|
-
let building = this._buildings.find(
|
|
247
|
-
(b) => b.buildingIdentifier == buildingId
|
|
248
|
-
);
|
|
249
|
-
callback(building);
|
|
250
|
-
} else {
|
|
251
|
-
// Fetch buildings and calculate route.
|
|
252
|
-
cordova.plugins.Situm.fetchBuildings(
|
|
253
|
-
(res) => {
|
|
254
|
-
this._buildings = res;
|
|
255
|
-
let building = this._buildings.find(
|
|
256
|
-
(b) => b.buildingIdentifier == buildingId
|
|
257
|
-
);
|
|
258
|
-
callback(building);
|
|
259
|
-
},
|
|
260
|
-
(err) => {
|
|
261
|
-
callback(undefined);
|
|
262
|
-
}
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// DIRECTIONS:
|
|
268
|
-
|
|
269
|
-
_onDirectionsRequested(payload) {
|
|
270
|
-
let directionsRequest = payload.directionsRequest;
|
|
271
|
-
let mapViewerData = {
|
|
272
|
-
identifier: payload.identifier,
|
|
273
|
-
originIdentifier: payload.originIdentifier,
|
|
274
|
-
destinationIdentifier: payload.destinationIdentifier,
|
|
275
|
-
type: directionsRequest.accessibilityMode
|
|
276
|
-
};
|
|
277
|
-
this._ensureBuilding(payload.buildingIdentifier, (building) => {
|
|
278
|
-
if (building) {
|
|
279
|
-
Situm.requestDirections(
|
|
280
|
-
[
|
|
281
|
-
building,
|
|
282
|
-
directionsRequest.from,
|
|
283
|
-
directionsRequest.to,
|
|
284
|
-
directionsRequest
|
|
285
|
-
],
|
|
286
|
-
(route) => {
|
|
287
|
-
this._sendMessageToViewer('directions.update', {
|
|
288
|
-
...route,
|
|
289
|
-
...mapViewerData
|
|
290
|
-
});
|
|
291
|
-
},
|
|
292
|
-
(error) => {
|
|
293
|
-
this._sendMessageToViewer('directions.update', {
|
|
294
|
-
error: -1,
|
|
295
|
-
identifier: mapViewerData.identifier
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
);
|
|
299
|
-
} else {
|
|
300
|
-
this._sendMessageToViewer('directions.update', {
|
|
301
|
-
error: -1,
|
|
302
|
-
identifier: payload.identifier
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
|
|
308
208
|
// NAVIGATION
|
|
309
209
|
|
|
310
|
-
_onNavigationRequested(payload) {
|
|
311
|
-
let directionsRequest = payload.directionsRequest;
|
|
312
|
-
let mapViewerData = {
|
|
313
|
-
identifier: payload.identifier,
|
|
314
|
-
originIdentifier: payload.originIdentifier,
|
|
315
|
-
destinationIdentifier: payload.destinationIdentifier,
|
|
316
|
-
type: directionsRequest.accessibilityMode
|
|
317
|
-
};
|
|
318
|
-
let navigationRequest = payload.navigationRequest;
|
|
319
|
-
this._ensureBuilding(payload.buildingIdentifier, (building) => {
|
|
320
|
-
// Request directions again to update the calculated route on the native side.
|
|
321
|
-
Situm.requestDirections(
|
|
322
|
-
[
|
|
323
|
-
building,
|
|
324
|
-
directionsRequest.from,
|
|
325
|
-
directionsRequest.to,
|
|
326
|
-
directionsRequest
|
|
327
|
-
],
|
|
328
|
-
(route) => {
|
|
329
|
-
this._isNavigating = true;
|
|
330
|
-
this._sendMessageToViewer('navigation.start', {
|
|
331
|
-
...route,
|
|
332
|
-
...mapViewerData
|
|
333
|
-
});
|
|
334
|
-
Situm.requestNavigationUpdates(
|
|
335
|
-
[navigationRequest],
|
|
336
|
-
(progress) => {
|
|
337
|
-
// Navigation is working, handle different progress types:
|
|
338
|
-
if (progress.type == 'progress') {
|
|
339
|
-
progress.type = 'PROGRESS'; // The map-viewer waits for an upper case "type".
|
|
340
|
-
this._sendMessageToViewer('navigation.update', progress);
|
|
341
|
-
} else if (progress.type == 'destinationReached') {
|
|
342
|
-
this._sendMessageToViewer('navigation.update', {
|
|
343
|
-
type: 'DESTINATION_REACHED'
|
|
344
|
-
});
|
|
345
|
-
this._isNavigating = false;
|
|
346
|
-
} else if (progress.type == 'userOutsideRoute') {
|
|
347
|
-
this._sendMessageToViewer('navigation.update', {
|
|
348
|
-
type: 'OUT_OF_ROUTE'
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
(error) => {
|
|
353
|
-
this._sendMessageToViewer('directions.update', {
|
|
354
|
-
error: -1,
|
|
355
|
-
identifier: mapViewerData.identifier
|
|
356
|
-
});
|
|
357
|
-
this._isNavigating = false;
|
|
358
|
-
}
|
|
359
|
-
);
|
|
360
|
-
},
|
|
361
|
-
(error) => {
|
|
362
|
-
this._sendMessageToViewer('directions.update', {
|
|
363
|
-
error: -1,
|
|
364
|
-
identifier: mapViewerData.identifier
|
|
365
|
-
});
|
|
366
|
-
this._isNavigating = false;
|
|
367
|
-
}
|
|
368
|
-
);
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
_onNavigationCancel() {
|
|
373
|
-
this._isNavigating = false;
|
|
374
|
-
Situm.removeNavigationUpdates(
|
|
375
|
-
() => {
|
|
376
|
-
// Do nothing.
|
|
377
|
-
},
|
|
378
|
-
() => {
|
|
379
|
-
console.error('Error removing navigation updates.');
|
|
380
|
-
}
|
|
381
|
-
);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
210
|
_onViewerNavigationStarted(webPayload) {
|
|
385
|
-
if (this._isNavigating) {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
this._isNavigating = true;
|
|
389
211
|
let externalNavigation = { messageType: "NavigationStarted", payload: webPayload};
|
|
390
212
|
Situm.updateNavigationState(externalNavigation, () => {}, () => {});
|
|
391
213
|
}
|
|
392
214
|
|
|
393
215
|
_onViewerNavigationUpdated(webPayload) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
this._isNavigating = false;
|
|
216
|
+
let messageType;
|
|
217
|
+
switch (webPayload.type) {
|
|
218
|
+
case 'PROGRESS':
|
|
219
|
+
messageType = 'NavigationUpdated';
|
|
220
|
+
break;
|
|
221
|
+
case 'DESTINATION_REACHED':
|
|
222
|
+
messageType = 'DestinationReached';
|
|
223
|
+
break;
|
|
224
|
+
case 'OUT_OF_ROUTE':
|
|
225
|
+
messageType = 'OutsideRoute';
|
|
226
|
+
break;
|
|
227
|
+
default:
|
|
228
|
+
return;
|
|
408
229
|
}
|
|
409
|
-
|
|
230
|
+
|
|
231
|
+
const externalNavigation = { messageType, payload: webPayload };
|
|
232
|
+
Situm.updateNavigationState(externalNavigation, () => { }, () => { });
|
|
410
233
|
}
|
|
411
234
|
|
|
412
235
|
_onViewerNavigationStopped(webPayload) {
|
|
413
|
-
if (!this._isNavigating) {
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
this._isNavigating = false;
|
|
417
236
|
let externalNavigation = { messageType: "NavigationCancelled", payload: webPayload};
|
|
418
237
|
Situm.updateNavigationState(externalNavigation, () => {}, () => {});
|
|
419
238
|
}
|
|
@@ -440,10 +259,6 @@ class MapViewControllerImpl {
|
|
|
440
259
|
});
|
|
441
260
|
}
|
|
442
261
|
|
|
443
|
-
_sendNavigationConfig(navigationType) {
|
|
444
|
-
this._sendMessageToViewer('app.set_config_item', [{key:'internal.navigationLibrary',value:navigationType}]);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
262
|
/**
|
|
448
263
|
* Allows you to navigate to a {@link POI} programmatically in your venue. This will cause the {@link MapView} to start navigation mode displaying the route between the user's location and the POI specified by parameters.
|
|
449
264
|
*
|