@situm/cordova 3.2.4 → 3.3.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/README.md CHANGED
@@ -2,9 +2,7 @@
2
2
  <h1 align="center">Situm Cordova Plugin</h1>
3
3
  </p>
4
4
 
5
- <div align="center" style="text-align:center">
6
5
  Situm Cordova Plugin is a set of utilities that allow any developer to build Cordova location based apps using Situm's indoor positioning system. Among many other capabilities, apps developed with Situm Cordova Plugin will be able to:
7
- </div>
8
6
 
9
7
  - Obtain information related to buildings where Situm's positioning system is already configured: floorplans, points of interest, geotriggered events, etc.
10
8
  - Retrieve the location of the smartphone inside these buildings (position, orientation, and floor where the smartphone is).
@@ -70,7 +68,7 @@ Situm Cordova Plugin is licensed under [MIT License](https://opensource.org/lice
70
68
  ### Methods
71
69
 
72
70
  > [!NOTE]
73
- > This plugin is currently under development. There may be method not implemented yet. Also there may be some API changes as development progresses.
71
+ > This plugin is currently under development. There may be methods not implemented yet. Also there may be some API changes as development progresses.
74
72
 
75
73
  ### Situm class
76
74
 
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "..": {
69
69
  "name": "@situm/cordova",
70
- "version": "3.1.0",
70
+ "version": "3.3.0",
71
71
  "engines": [
72
72
  {
73
73
  "name": "cordova-android",
@@ -16,6 +16,7 @@
16
16
  viewer-domain="https://map-viewer.situm.com"
17
17
  situm-api-key="YOUR_SITUM_API_KEY"
18
18
  building-identifier="YOUR_BUILDING_IDENTIFIER"
19
+ remote-identifier="YOUR_REMOTE_IDENTIFIER"
19
20
  #mapView
20
21
  />
21
22
  <!-- WARNING: We will be overwritting this attributes with the values in constants.ts -->
@@ -43,5 +43,10 @@ export class WYFPage {
43
43
  'building-identifier',
44
44
  Constants.BUILDING_IDENTIFIER
45
45
  );
46
+
47
+ this.mapView?.nativeElement.setAttribute(
48
+ 'remote-identifier',
49
+ Constants.REMOTE_IDENTIFIER
50
+ );
46
51
  }
47
52
  }
@@ -3,4 +3,5 @@
3
3
  export const API_USER = 'YOUR_SITUM_API_USER';
4
4
  export const API_KEY = 'YOUR_SITUM_API_KEY';
5
5
  export const BUILDING_IDENTIFIER = 'YOUR_BUILDING_IDENTIFIER';
6
+ export const REMOTE_IDENTIFIER = 'YOUR_REMOTE_IDENTIFIER';
6
7
  export const VIEWER_DOMAIN = 'https://map-viewer.situm.com';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situm/cordova",
3
- "version": "3.2.4",
3
+ "version": "3.3.0",
4
4
  "description": "Set of utilities that allow any developer to build Cordova location based apps using Situm's indoor positioning system.",
5
5
  "private": false,
6
6
  "repository": "https://github.com/situmtech/cordova",
package/plugin.xml CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
4
4
  id="@situm/cordova"
5
- version="3.2.4">
5
+ version="3.3.0">
6
6
  <name>Situm Cordova plugin Official</name>
7
7
  <description>This is the stable branch.</description>
8
8
  <license>MIT</license>
@@ -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.9.2@aar') {
47
+ implementation ('es.situm:situm-sdk:3.9.3@aar') {
48
48
  transitive = true
49
49
  }
50
50
  implementation 'org.apache.cordova:framework:10.1.1'
@@ -13,7 +13,7 @@ allprojects {
13
13
  dependencies {
14
14
  implementation 'com.google.android.gms:play-services-maps:16.0.0'
15
15
  implementation 'com.google.android.gms:play-services-location:16.0.0'
16
- implementation('es.situm:situm-sdk:3.9.2@aar') {
16
+ implementation('es.situm:situm-sdk:3.9.3@aar') {
17
17
  transitive = true
18
18
  }
19
19
  }
@@ -745,7 +745,7 @@ module.exports = RealTimeData
745
745
  * @name
746
746
  * PoiSelectedResult
747
747
  * @description
748
- * An object that contains the identifier of the {@link POI} the user has selected and the building indentifier where it is located.
748
+ * An object that contains the identifier of the {@link POI} the user has selected and the building identifier where it is located.
749
749
  * @property {number} identifier The unique identifier of the {@link POI} selected.
750
750
  * @property {number} buildingIdentifier The unique identifier of the building where the {@link POI} is located at.
751
751
  */
@@ -763,7 +763,7 @@ module.exports = PoiSelectedResult;
763
763
  * @name
764
764
  * PoiDeselectedResult
765
765
  * @description
766
- * An object that contains the identifier of the {@link POI} the user has deselected and the building indentifier where it is located.
766
+ * An object that contains the identifier of the {@link POI} the user has deselected and the building identifier where it is located.
767
767
  * @property {number} identifier The unique identifier of the {@link POI} deselected.
768
768
  * @property {number} buildingIdentifier The unique identifier of the building where the {@link POI} is located at.
769
769
  */
@@ -270,7 +270,8 @@ class MapViewControllerImpl {
270
270
  // ==================================================
271
271
 
272
272
  /**
273
- * Select a {@link POI} of a building.
273
+ * Allows you to select a {@link POI} programmatically in your venue. This will cause the {@link MapView} to center the view on that POI and show its information.
274
+ *
274
275
  * @param {number} identifier The unique identifier of the resource.
275
276
  * */
276
277
  selectPoi(identifier) {
@@ -280,7 +281,7 @@ class MapViewControllerImpl {
280
281
  }
281
282
 
282
283
  /**
283
- * Navigate to a {@link POI} of a building.
284
+ * 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.
284
285
  *
285
286
  * The types of {@link accessibilityMode} you can use are:
286
287
  * - 'CHOOSE_SHORTEST' : Calculates the shortest route to the destination {@link POI}.
@@ -299,12 +300,23 @@ class MapViewControllerImpl {
299
300
  });
300
301
  }
301
302
 
303
+ /**
304
+ * Allows you to change the initial language that <map-view> uses to display its UI.
305
+ * Checkout the [Situm docs](https://situm.com/docs/query-params/) to see the list of
306
+ * supported languages.
307
+ *
308
+ * @param {string} language an ISO 639-1 code.
309
+ */
310
+ setLanguage(language){
311
+ this._sendMessageToViewer("ui.set_language", language);
312
+ }
313
+
302
314
  // ==================================================
303
315
  // EVENTS
304
316
  // ==================================================
305
317
 
306
318
  /**
307
- * A {@link POI} was selected in your building.
319
+ * Informs you, through the function you pass as callback ({@link cb}), that a {@link POI} was selected in your building.
308
320
  * @param {Function} cb A callback that returns a {@link PoiSelectedResult} by its parameters.
309
321
  * */
310
322
  onPoiSelected(cb) {
@@ -312,7 +324,7 @@ class MapViewControllerImpl {
312
324
  }
313
325
 
314
326
  /**
315
- * A {@link POI} was deselected in your building.
327
+ * Informs you, through the function you pass as callback ({@link cb}), that a {@link POI} was deselected in your building.
316
328
  * @param {Function} cb A callback that returns a {@link PoiDeselectedResult} by its parameters.
317
329
  * */
318
330
  onPoiDeselected(cb) {
package/www/map-view.js CHANGED
@@ -33,10 +33,15 @@ class MapView extends HTMLElement {
33
33
  );
34
34
  let situmApiKey = this.getAttribute("situm-api-key") ?? "";
35
35
  let buildingIdentifier = this.getAttribute("building-identifier") ?? "";
36
+ let language = this.getAttribute("language") ?? "";
37
+
36
38
  let situmApiKeyQP = situmApiKey.length > 0 ? `apikey=${situmApiKey}` : "";
37
39
  let buildingIdentifierQP =
38
40
  buildingIdentifier.length > 0 ? `&buildingid=${buildingIdentifier}` : "";
39
- let query = `${situmApiKeyQP}${buildingIdentifierQP}&mode=embed`;
41
+ let languageQP = language.length > 0 ? `&lng=${language}` : "";
42
+
43
+ let query = `${situmApiKeyQP}${buildingIdentifierQP}${languageQP}&mode=embed`;
44
+
40
45
  let remoteIdentifier = this.getAttribute("remote-identifier");
41
46
  if (remoteIdentifier) {
42
47
  return `${viewerDomain}/id/${remoteIdentifier}?${query}`;