@situm/cordova 3.0.1 → 3.1.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 +5 -26
- package/docs/JSDoc/MapView.html +2 -2
- package/docs/JSDoc/MapViewControllerImpl.html +458 -2
- package/docs/JSDoc/Situm.html +1 -1
- package/docs/JSDoc/android_Interfaces.js.html +38 -2
- package/docs/JSDoc/android_situm.js.html +1 -1
- package/docs/JSDoc/global.html +289 -1
- package/docs/JSDoc/index.html +1 -1
- package/docs/JSDoc/map-view-controller.js.html +128 -29
- package/docs/JSDoc/map-view.js.html +1 -2
- package/docs/JSDoc/styles/custom.css +4 -0
- package/docs/static/styles/custom.css +4 -0
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/www/android/Interfaces.js +37 -1
- package/www/map-view-controller.js +129 -28
- package/www/map-view.js +1 -2
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<ul></ul>
|
|
41
41
|
</div>
|
|
42
42
|
|
|
43
|
-
<div class="lnb-api hidden"><h3>Namespaces</h3><ul><li><a href="MapView.html">MapView</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="MapView_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="MapView.html#.onLoad">onLoad</a></li></ul></div></li><li><a href="MapViewControllerImpl.html">MapViewControllerImpl</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="MapViewControllerImpl_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="MapViewControllerImpl.html#selectPoi">selectPoi</a></li></ul></div></li><li><a href="Situm.html">Situm</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="Situm_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="Situm.html#.fetchBuildingInfo">fetchBuildingInfo</a></li><li><a href="Situm.html#.fetchBuildings">fetchBuildings</a></li><li><a href="Situm.html#.fetchEventsFromBuilding">fetchEventsFromBuilding</a></li><li><a href="Situm.html#.fetchFloorsFromBuilding">fetchFloorsFromBuilding</a></li><li><a href="Situm.html#.fetchGeofencesFromBuilding">fetchGeofencesFromBuilding</a></li><li><a href="Situm.html#.fetchIndoorPOIsFromBuilding">fetchIndoorPOIsFromBuilding</a></li><li><a href="Situm.html#.fetchMapFromFloor">fetchMapFromFloor</a></li><li><a href="Situm.html#.fetchOutdoorPOIsFromBuilding">fetchOutdoorPOIsFromBuilding</a></li><li><a href="Situm.html#.fetchPoiCategories">fetchPoiCategories</a></li><li><a href="Situm.html#.fetchPoiCategoryIconNormal">fetchPoiCategoryIconNormal</a></li><li><a href="Situm.html#.fetchPoiCategoryIconSelected">fetchPoiCategoryIconSelected</a></li><li><a href="Situm.html#.internalSetEventDelegate">internalSetEventDelegate</a></li><li><a href="Situm.html#.invalidateCache">invalidateCache</a></li><li><a href="Situm.html#.onEnterGeofences">onEnterGeofences</a></li><li><a href="Situm.html#.onExitGeofences">onExitGeofences</a></li><li><a href="Situm.html#.removeNavigationUpdates">removeNavigationUpdates</a></li><li><a href="Situm.html#.removeRealTimeUpdates">removeRealTimeUpdates</a></li><li><a href="Situm.html#.requestDirections">requestDirections</a></li><li><a href="Situm.html#.requestNavigationUpdates">requestNavigationUpdates</a></li><li><a href="Situm.html#.requestRealTimeUpdates">requestRealTimeUpdates</a></li><li><a href="Situm.html#.setApiKey">setApiKey</a></li><li><a href="Situm.html#.setCacheMaxAge">setCacheMaxAge</a></li><li><a href="Situm.html#.setUserPass">setUserPass</a></li><li><a href="Situm.html#.startPositioning">startPositioning</a></li><li><a href="Situm.html#.stopPositioning">stopPositioning</a></li><li><a href="Situm.html#.updateNavigationWithLocation">updateNavigationWithLocation</a></li></ul></div></li></ul></div><div class="lnb-api hidden"><h3>Global</h3><ul><li><a href="global.html#Angle">Angle</a></li><li><a href="global.html#BeaconFilter">BeaconFilter</a></li><li><a href="global.html#Bounds">Bounds</a></li><li><a href="global.html#Building">Building</a></li><li><a href="global.html#BuildingInfo">BuildingInfo</a></li><li><a href="global.html#CartesianCoordinate">CartesianCoordinate</a></li><li><a href="global.html#Circle">Circle</a></li><li><a href="global.html#Coordinate">Coordinate</a></li><li><a href="global.html#Dimensions">Dimensions</a></li><li><a href="global.html#DirectionsOptions">DirectionsOptions</a></li><li><a href="global.html#DirectionsRequest">DirectionsRequest</a></li><li><a href="global.html#Floor">Floor</a></li><li><a href="global.html#Geofence">Geofence</a></li><li><a href="global.html#Indication">Indication</a></li><li><a href="global.html#Location">Location</a></li><li><a href="global.html#LocationOptions">LocationOptions</a></li><li><a href="global.html#LocationRequest">LocationRequest</a></li><li><a href="global.html#LocationStatus">LocationStatus</a></li><li><a href="global.html#NavigationProgress">NavigationProgress</a></li><li><a href="global.html#NavigationRequest">NavigationRequest</a></li><li><a href="global.html#OutdoorLocationOptions">OutdoorLocationOptions</a></li><li><a href="global.html#POI">POI</a></li><li><a href="global.html#PoiCategory">PoiCategory</a></li><li><a href="global.html#Point">Point</a></li><li><a href="global.html#RealTimeData">RealTimeData</a></li><li><a href="global.html#RealTimeRequest">RealTimeRequest</a></li><li><a href="global.html#Route">Route</a></li><li><a href="global.html#RouteSegment">RouteSegment</a></li><li><a href="global.html#RouteStep">RouteStep</a></li><li><a href="global.html#SitumConversionArea">SitumConversionArea</a></li><li><a href="global.html#SitumEvent">SitumEvent</a></li></ul></div>
|
|
43
|
+
<div class="lnb-api hidden"><h3>Namespaces</h3><ul><li><a href="MapView.html">MapView</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="MapView_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="MapView.html#.onLoad">onLoad</a></li></ul></div></li><li><a href="MapViewControllerImpl.html">MapViewControllerImpl</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="MapViewControllerImpl_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="MapViewControllerImpl.html#navigateToPoi">navigateToPoi</a></li><li><a href="MapViewControllerImpl.html#onPoiDeselected">onPoiDeselected</a></li><li><a href="MapViewControllerImpl.html#onPoiSelected">onPoiSelected</a></li><li><a href="MapViewControllerImpl.html#selectPoi">selectPoi</a></li></ul></div></li><li><a href="Situm.html">Situm</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="Situm_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="Situm.html#.fetchBuildingInfo">fetchBuildingInfo</a></li><li><a href="Situm.html#.fetchBuildings">fetchBuildings</a></li><li><a href="Situm.html#.fetchEventsFromBuilding">fetchEventsFromBuilding</a></li><li><a href="Situm.html#.fetchFloorsFromBuilding">fetchFloorsFromBuilding</a></li><li><a href="Situm.html#.fetchGeofencesFromBuilding">fetchGeofencesFromBuilding</a></li><li><a href="Situm.html#.fetchIndoorPOIsFromBuilding">fetchIndoorPOIsFromBuilding</a></li><li><a href="Situm.html#.fetchMapFromFloor">fetchMapFromFloor</a></li><li><a href="Situm.html#.fetchOutdoorPOIsFromBuilding">fetchOutdoorPOIsFromBuilding</a></li><li><a href="Situm.html#.fetchPoiCategories">fetchPoiCategories</a></li><li><a href="Situm.html#.fetchPoiCategoryIconNormal">fetchPoiCategoryIconNormal</a></li><li><a href="Situm.html#.fetchPoiCategoryIconSelected">fetchPoiCategoryIconSelected</a></li><li><a href="Situm.html#.internalSetEventDelegate">internalSetEventDelegate</a></li><li><a href="Situm.html#.invalidateCache">invalidateCache</a></li><li><a href="Situm.html#.onEnterGeofences">onEnterGeofences</a></li><li><a href="Situm.html#.onExitGeofences">onExitGeofences</a></li><li><a href="Situm.html#.removeNavigationUpdates">removeNavigationUpdates</a></li><li><a href="Situm.html#.removeRealTimeUpdates">removeRealTimeUpdates</a></li><li><a href="Situm.html#.requestDirections">requestDirections</a></li><li><a href="Situm.html#.requestNavigationUpdates">requestNavigationUpdates</a></li><li><a href="Situm.html#.requestRealTimeUpdates">requestRealTimeUpdates</a></li><li><a href="Situm.html#.setApiKey">setApiKey</a></li><li><a href="Situm.html#.setCacheMaxAge">setCacheMaxAge</a></li><li><a href="Situm.html#.setUserPass">setUserPass</a></li><li><a href="Situm.html#.startPositioning">startPositioning</a></li><li><a href="Situm.html#.stopPositioning">stopPositioning</a></li><li><a href="Situm.html#.updateNavigationWithLocation">updateNavigationWithLocation</a></li></ul></div></li></ul></div><div class="lnb-api hidden"><h3>Global</h3><ul><li><a href="global.html#Angle">Angle</a></li><li><a href="global.html#BeaconFilter">BeaconFilter</a></li><li><a href="global.html#Bounds">Bounds</a></li><li><a href="global.html#Building">Building</a></li><li><a href="global.html#BuildingInfo">BuildingInfo</a></li><li><a href="global.html#CartesianCoordinate">CartesianCoordinate</a></li><li><a href="global.html#Circle">Circle</a></li><li><a href="global.html#Coordinate">Coordinate</a></li><li><a href="global.html#Dimensions">Dimensions</a></li><li><a href="global.html#DirectionsOptions">DirectionsOptions</a></li><li><a href="global.html#DirectionsRequest">DirectionsRequest</a></li><li><a href="global.html#Floor">Floor</a></li><li><a href="global.html#Geofence">Geofence</a></li><li><a href="global.html#Indication">Indication</a></li><li><a href="global.html#Location">Location</a></li><li><a href="global.html#LocationOptions">LocationOptions</a></li><li><a href="global.html#LocationRequest">LocationRequest</a></li><li><a href="global.html#LocationStatus">LocationStatus</a></li><li><a href="global.html#NavigationProgress">NavigationProgress</a></li><li><a href="global.html#NavigationRequest">NavigationRequest</a></li><li><a href="global.html#OutdoorLocationOptions">OutdoorLocationOptions</a></li><li><a href="global.html#POI">POI</a></li><li><a href="global.html#PoiCategory">PoiCategory</a></li><li><a href="global.html#PoiDeselectedResult">PoiDeselectedResult</a></li><li><a href="global.html#Point">Point</a></li><li><a href="global.html#PoiSelectedResult">PoiSelectedResult</a></li><li><a href="global.html#RealTimeData">RealTimeData</a></li><li><a href="global.html#RealTimeRequest">RealTimeRequest</a></li><li><a href="global.html#Route">Route</a></li><li><a href="global.html#RouteSegment">RouteSegment</a></li><li><a href="global.html#RouteStep">RouteStep</a></li><li><a href="global.html#SitumConversionArea">SitumConversionArea</a></li><li><a href="global.html#SitumEvent">SitumEvent</a></li></ul></div>
|
|
44
44
|
</nav>
|
|
45
45
|
<div id="resizer"></div>
|
|
46
46
|
|
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
*/
|
|
60
60
|
class MapViewControllerImpl {
|
|
61
61
|
_onLoadCallback = undefined;
|
|
62
|
+
_onPoiSelectedCallback = undefined;
|
|
63
|
+
_onPoiDeselectedCallback = undefined;
|
|
62
64
|
_buildings = undefined;
|
|
63
65
|
_mapView = undefined;
|
|
64
66
|
_isNavigating = false;
|
|
@@ -80,22 +82,22 @@ class MapViewControllerImpl {
|
|
|
80
82
|
type: type,
|
|
81
83
|
payload: payload,
|
|
82
84
|
};
|
|
83
|
-
if (this._mapView && this._mapView.firstElementChild){
|
|
85
|
+
if (this._mapView && this._mapView.firstElementChild) {
|
|
84
86
|
this._mapView.firstElementChild.contentWindow.postMessage(
|
|
85
87
|
message,
|
|
86
88
|
this._mapView._getViewerDomain()
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
// ==================================================
|
|
92
|
-
// SDK MESSAGES:
|
|
94
|
+
// SDK MESSAGES:
|
|
93
95
|
// ==================================================
|
|
94
96
|
|
|
95
97
|
_handleSdkNativeEvents(eventName, payload) {
|
|
96
98
|
switch (eventName) {
|
|
97
99
|
case "onLocationUpdate":
|
|
98
|
-
// TODO: iOS is sending messages here not related to Location. Check
|
|
100
|
+
// TODO: iOS is sending messages here not related to Location. Check
|
|
99
101
|
// some fields to avoid assuming that we receive an object of type Location.
|
|
100
102
|
if (payload.buildingIdentifier && payload.position) {
|
|
101
103
|
this._handleOnLocationUpdate(payload);
|
|
@@ -115,30 +117,49 @@ class MapViewControllerImpl {
|
|
|
115
117
|
// Do nothing.
|
|
116
118
|
},
|
|
117
119
|
() => {
|
|
118
|
-
console.error("Error at updateNavigationWithLocation")
|
|
120
|
+
console.error("Error at updateNavigationWithLocation");
|
|
119
121
|
}
|
|
120
122
|
);
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
_handleOnLocationStatus(payload) {
|
|
125
|
-
this._sendMessageToViewer("location.update_status", {
|
|
127
|
+
this._sendMessageToViewer("location.update_status", {
|
|
128
|
+
status: payload.statusName,
|
|
129
|
+
});
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
// ==================================================
|
|
129
|
-
// MAP-VIEWER MESSAGES:
|
|
133
|
+
// MAP-VIEWER MESSAGES:
|
|
130
134
|
// ==================================================
|
|
131
135
|
|
|
132
136
|
_handleMapViewMessages(m) {
|
|
133
137
|
switch (m.type) {
|
|
134
138
|
case "app.map_is_ready":
|
|
135
|
-
if (
|
|
139
|
+
if (
|
|
140
|
+
this._onLoadCallback &&
|
|
141
|
+
typeof this._onLoadCallback === "function"
|
|
142
|
+
) {
|
|
136
143
|
this._onLoadCallback(this);
|
|
137
|
-
console.debug(
|
|
144
|
+
console.debug("Map is ready!");
|
|
138
145
|
}
|
|
139
146
|
break;
|
|
140
147
|
case "cartography.poi_selected":
|
|
141
148
|
console.debug(`poi (${m.payload.identifier}) was selected`);
|
|
149
|
+
this._onPoiSelectedCallback({
|
|
150
|
+
poi: {
|
|
151
|
+
identifier: m.payload.identifier,
|
|
152
|
+
buildingIdentifier: m.payload.buildingIdentifier,
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
break;
|
|
156
|
+
case "cartography.poi_deselected":
|
|
157
|
+
this._onPoiDeselectedCallback({
|
|
158
|
+
poi: {
|
|
159
|
+
identifier: m.payload.identifier,
|
|
160
|
+
buildingIdentifier: m.payload.buildingIdentifier,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
142
163
|
break;
|
|
143
164
|
case "directions.requested":
|
|
144
165
|
this._onDirectionsRequested(m.payload);
|
|
@@ -158,14 +179,18 @@ class MapViewControllerImpl {
|
|
|
158
179
|
// Fetch the given building and return it or undefined if not found.
|
|
159
180
|
_ensureBuilding(buildingId, callback) {
|
|
160
181
|
if (this._buildings) {
|
|
161
|
-
let building = this._buildings.find(
|
|
182
|
+
let building = this._buildings.find(
|
|
183
|
+
(b) => b.buildingIdentifier == buildingId
|
|
184
|
+
);
|
|
162
185
|
callback(building);
|
|
163
186
|
} else {
|
|
164
187
|
// Fetch buildings and calculate route.
|
|
165
188
|
cordova.plugins.Situm.fetchBuildings(
|
|
166
189
|
(res) => {
|
|
167
190
|
this._buildings = res;
|
|
168
|
-
let building = this._buildings.find(
|
|
191
|
+
let building = this._buildings.find(
|
|
192
|
+
(b) => b.buildingIdentifier == buildingId
|
|
193
|
+
);
|
|
169
194
|
callback(building);
|
|
170
195
|
},
|
|
171
196
|
(err) => {
|
|
@@ -184,20 +209,34 @@ class MapViewControllerImpl {
|
|
|
184
209
|
originIdentifier: payload.originIdentifier,
|
|
185
210
|
destinationIdentifier: payload.destinationIdentifier,
|
|
186
211
|
type: directionsRequest.accessibilityMode,
|
|
187
|
-
}
|
|
212
|
+
};
|
|
188
213
|
this._ensureBuilding(payload.buildingIdentifier, (building) => {
|
|
189
|
-
if (building){
|
|
214
|
+
if (building) {
|
|
190
215
|
Situm.requestDirections(
|
|
191
|
-
[
|
|
216
|
+
[
|
|
217
|
+
building,
|
|
218
|
+
directionsRequest.from,
|
|
219
|
+
directionsRequest.to,
|
|
220
|
+
directionsRequest,
|
|
221
|
+
],
|
|
192
222
|
(route) => {
|
|
193
|
-
this._sendMessageToViewer("directions.update", {
|
|
223
|
+
this._sendMessageToViewer("directions.update", {
|
|
224
|
+
...route,
|
|
225
|
+
...mapViewerData,
|
|
226
|
+
});
|
|
194
227
|
},
|
|
195
228
|
(error) => {
|
|
196
|
-
this._sendMessageToViewer("directions.update", {
|
|
229
|
+
this._sendMessageToViewer("directions.update", {
|
|
230
|
+
error: -1,
|
|
231
|
+
identifier: mapViewerData.identifier,
|
|
232
|
+
});
|
|
197
233
|
}
|
|
198
234
|
);
|
|
199
235
|
} else {
|
|
200
|
-
this._sendMessageToViewer("directions.update", {
|
|
236
|
+
this._sendMessageToViewer("directions.update", {
|
|
237
|
+
error: -1,
|
|
238
|
+
identifier: payload.identifier,
|
|
239
|
+
});
|
|
201
240
|
}
|
|
202
241
|
});
|
|
203
242
|
}
|
|
@@ -211,36 +250,55 @@ class MapViewControllerImpl {
|
|
|
211
250
|
originIdentifier: payload.originIdentifier,
|
|
212
251
|
destinationIdentifier: payload.destinationIdentifier,
|
|
213
252
|
type: directionsRequest.accessibilityMode,
|
|
214
|
-
}
|
|
253
|
+
};
|
|
215
254
|
let navigationRequest = payload.navigationRequest;
|
|
216
255
|
this._ensureBuilding(payload.buildingIdentifier, (building) => {
|
|
217
256
|
// Request directions again to update the calculated route on the native side.
|
|
218
257
|
Situm.requestDirections(
|
|
219
|
-
[
|
|
258
|
+
[
|
|
259
|
+
building,
|
|
260
|
+
directionsRequest.from,
|
|
261
|
+
directionsRequest.to,
|
|
262
|
+
directionsRequest,
|
|
263
|
+
],
|
|
220
264
|
(route) => {
|
|
221
265
|
this._isNavigating = true;
|
|
222
|
-
this._sendMessageToViewer("navigation.start", {
|
|
266
|
+
this._sendMessageToViewer("navigation.start", {
|
|
267
|
+
...route,
|
|
268
|
+
...mapViewerData,
|
|
269
|
+
});
|
|
223
270
|
Situm.requestNavigationUpdates(
|
|
224
271
|
[navigationRequest],
|
|
225
272
|
(progress) => {
|
|
226
273
|
// Navigation is working, handle different progress types:
|
|
227
274
|
if (progress.type == "progress") {
|
|
228
|
-
progress.type =
|
|
275
|
+
progress.type = "PROGRESS"; // The map-viewer waits for an upper case "type".
|
|
229
276
|
this._sendMessageToViewer("navigation.update", progress);
|
|
230
277
|
} else if (progress.type == "destinationReached") {
|
|
231
|
-
this._sendMessageToViewer("navigation.update", {
|
|
278
|
+
this._sendMessageToViewer("navigation.update", {
|
|
279
|
+
type: "DESTINATION_REACHED",
|
|
280
|
+
});
|
|
232
281
|
this._isNavigating = false;
|
|
233
282
|
} else if (progress.type == "userOutsideRoute") {
|
|
234
|
-
this._sendMessageToViewer("navigation.update", {
|
|
283
|
+
this._sendMessageToViewer("navigation.update", {
|
|
284
|
+
type: "OUT_OF_ROUTE",
|
|
285
|
+
});
|
|
235
286
|
}
|
|
236
287
|
},
|
|
237
288
|
(error) => {
|
|
238
|
-
this._sendMessageToViewer("directions.update", {
|
|
289
|
+
this._sendMessageToViewer("directions.update", {
|
|
290
|
+
error: -1,
|
|
291
|
+
identifier: mapViewerData.identifier,
|
|
292
|
+
});
|
|
239
293
|
this._isNavigating = false;
|
|
240
|
-
}
|
|
294
|
+
}
|
|
295
|
+
);
|
|
241
296
|
},
|
|
242
297
|
(error) => {
|
|
243
|
-
this._sendMessageToViewer("directions.update", {
|
|
298
|
+
this._sendMessageToViewer("directions.update", {
|
|
299
|
+
error: -1,
|
|
300
|
+
identifier: mapViewerData.identifier,
|
|
301
|
+
});
|
|
244
302
|
this._isNavigating = false;
|
|
245
303
|
}
|
|
246
304
|
);
|
|
@@ -268,9 +326,50 @@ class MapViewControllerImpl {
|
|
|
268
326
|
* @param {number} identifier The unique identifier of the resource.
|
|
269
327
|
* */
|
|
270
328
|
selectPoi(identifier) {
|
|
271
|
-
this._sendMessageToViewer("cartography.select_poi", {
|
|
329
|
+
this._sendMessageToViewer("cartography.select_poi", {
|
|
330
|
+
identifier: identifier,
|
|
331
|
+
});
|
|
272
332
|
}
|
|
273
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Navigate to a POI of a building.
|
|
336
|
+
*
|
|
337
|
+
* The types of {@link accessibilityMode} you can use are:
|
|
338
|
+
* - 'CHOOSE_SHORTEST' : Calculates the shortest route to the destination {@link POI}.
|
|
339
|
+
* - 'ONLY_ACCESSIBLE' : Calculates the shortest route to the destination {@link POI} but avoiding stairs and prioritizing accessible floor changes such as lifts.
|
|
340
|
+
* - 'ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES' : Calculates the shortest route to the destination {@link POI} but avoiding lifts and prioritizing non-accessible floor changes such as stairs.
|
|
341
|
+
*
|
|
342
|
+
* accessibilityMode defaults to CHOOSE_SHORTEST.
|
|
343
|
+
*
|
|
344
|
+
* @param {number} identifier The identifier of the poi.
|
|
345
|
+
* @param {'CHOOSE_SHORTEST' | 'ONLY_ACCESSIBLE' | 'ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES' | undefined} accessibilityMode Choose the route type to calculate.
|
|
346
|
+
* */
|
|
347
|
+
navigateToPoi(identifier, accessibilityMode) {
|
|
348
|
+
this._sendMessageToViewer("navigation.start", {
|
|
349
|
+
navigationTo: identifier,
|
|
350
|
+
type: accessibilityMode,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// ==================================================
|
|
355
|
+
// EVENTS
|
|
356
|
+
// ==================================================
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* A POI was selected in your building.
|
|
360
|
+
* @param {Function} cb A callback that returns a {@link PoiSelectedResult} by its parameters.
|
|
361
|
+
* */
|
|
362
|
+
onPoiSelected(cb) {
|
|
363
|
+
this._onPoiSelectedCallback = callback;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* A POI was deselected in your building.
|
|
368
|
+
* @param {Function} cb A callback that returns a {@link PoiDeselectedResult} by its parameters.
|
|
369
|
+
* */
|
|
370
|
+
onPoiDeselected(cb) {
|
|
371
|
+
this._onPoiDeselectedCallback = callback;
|
|
372
|
+
}
|
|
274
373
|
}
|
|
275
374
|
|
|
276
375
|
let MapViewController = new MapViewControllerImpl();
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<ul></ul>
|
|
41
41
|
</div>
|
|
42
42
|
|
|
43
|
-
<div class="lnb-api hidden"><h3>Namespaces</h3><ul><li><a href="MapView.html">MapView</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="MapView_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="MapView.html#.onLoad">onLoad</a></li></ul></div></li><li><a href="MapViewControllerImpl.html">MapViewControllerImpl</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="MapViewControllerImpl_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="MapViewControllerImpl.html#selectPoi">selectPoi</a></li></ul></div></li><li><a href="Situm.html">Situm</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="Situm_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="Situm.html#.fetchBuildingInfo">fetchBuildingInfo</a></li><li><a href="Situm.html#.fetchBuildings">fetchBuildings</a></li><li><a href="Situm.html#.fetchEventsFromBuilding">fetchEventsFromBuilding</a></li><li><a href="Situm.html#.fetchFloorsFromBuilding">fetchFloorsFromBuilding</a></li><li><a href="Situm.html#.fetchGeofencesFromBuilding">fetchGeofencesFromBuilding</a></li><li><a href="Situm.html#.fetchIndoorPOIsFromBuilding">fetchIndoorPOIsFromBuilding</a></li><li><a href="Situm.html#.fetchMapFromFloor">fetchMapFromFloor</a></li><li><a href="Situm.html#.fetchOutdoorPOIsFromBuilding">fetchOutdoorPOIsFromBuilding</a></li><li><a href="Situm.html#.fetchPoiCategories">fetchPoiCategories</a></li><li><a href="Situm.html#.fetchPoiCategoryIconNormal">fetchPoiCategoryIconNormal</a></li><li><a href="Situm.html#.fetchPoiCategoryIconSelected">fetchPoiCategoryIconSelected</a></li><li><a href="Situm.html#.internalSetEventDelegate">internalSetEventDelegate</a></li><li><a href="Situm.html#.invalidateCache">invalidateCache</a></li><li><a href="Situm.html#.onEnterGeofences">onEnterGeofences</a></li><li><a href="Situm.html#.onExitGeofences">onExitGeofences</a></li><li><a href="Situm.html#.removeNavigationUpdates">removeNavigationUpdates</a></li><li><a href="Situm.html#.removeRealTimeUpdates">removeRealTimeUpdates</a></li><li><a href="Situm.html#.requestDirections">requestDirections</a></li><li><a href="Situm.html#.requestNavigationUpdates">requestNavigationUpdates</a></li><li><a href="Situm.html#.requestRealTimeUpdates">requestRealTimeUpdates</a></li><li><a href="Situm.html#.setApiKey">setApiKey</a></li><li><a href="Situm.html#.setCacheMaxAge">setCacheMaxAge</a></li><li><a href="Situm.html#.setUserPass">setUserPass</a></li><li><a href="Situm.html#.startPositioning">startPositioning</a></li><li><a href="Situm.html#.stopPositioning">stopPositioning</a></li><li><a href="Situm.html#.updateNavigationWithLocation">updateNavigationWithLocation</a></li></ul></div></li></ul></div><div class="lnb-api hidden"><h3>Global</h3><ul><li><a href="global.html#Angle">Angle</a></li><li><a href="global.html#BeaconFilter">BeaconFilter</a></li><li><a href="global.html#Bounds">Bounds</a></li><li><a href="global.html#Building">Building</a></li><li><a href="global.html#BuildingInfo">BuildingInfo</a></li><li><a href="global.html#CartesianCoordinate">CartesianCoordinate</a></li><li><a href="global.html#Circle">Circle</a></li><li><a href="global.html#Coordinate">Coordinate</a></li><li><a href="global.html#Dimensions">Dimensions</a></li><li><a href="global.html#DirectionsOptions">DirectionsOptions</a></li><li><a href="global.html#DirectionsRequest">DirectionsRequest</a></li><li><a href="global.html#Floor">Floor</a></li><li><a href="global.html#Geofence">Geofence</a></li><li><a href="global.html#Indication">Indication</a></li><li><a href="global.html#Location">Location</a></li><li><a href="global.html#LocationOptions">LocationOptions</a></li><li><a href="global.html#LocationRequest">LocationRequest</a></li><li><a href="global.html#LocationStatus">LocationStatus</a></li><li><a href="global.html#NavigationProgress">NavigationProgress</a></li><li><a href="global.html#NavigationRequest">NavigationRequest</a></li><li><a href="global.html#OutdoorLocationOptions">OutdoorLocationOptions</a></li><li><a href="global.html#POI">POI</a></li><li><a href="global.html#PoiCategory">PoiCategory</a></li><li><a href="global.html#Point">Point</a></li><li><a href="global.html#RealTimeData">RealTimeData</a></li><li><a href="global.html#RealTimeRequest">RealTimeRequest</a></li><li><a href="global.html#Route">Route</a></li><li><a href="global.html#RouteSegment">RouteSegment</a></li><li><a href="global.html#RouteStep">RouteStep</a></li><li><a href="global.html#SitumConversionArea">SitumConversionArea</a></li><li><a href="global.html#SitumEvent">SitumEvent</a></li></ul></div>
|
|
43
|
+
<div class="lnb-api hidden"><h3>Namespaces</h3><ul><li><a href="MapView.html">MapView</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="MapView_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="MapView.html#.onLoad">onLoad</a></li></ul></div></li><li><a href="MapViewControllerImpl.html">MapViewControllerImpl</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="MapViewControllerImpl_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="MapViewControllerImpl.html#navigateToPoi">navigateToPoi</a></li><li><a href="MapViewControllerImpl.html#onPoiDeselected">onPoiDeselected</a></li><li><a href="MapViewControllerImpl.html#onPoiSelected">onPoiSelected</a></li><li><a href="MapViewControllerImpl.html#selectPoi">selectPoi</a></li></ul></div></li><li><a href="Situm.html">Situm</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="Situm_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="Situm.html#.fetchBuildingInfo">fetchBuildingInfo</a></li><li><a href="Situm.html#.fetchBuildings">fetchBuildings</a></li><li><a href="Situm.html#.fetchEventsFromBuilding">fetchEventsFromBuilding</a></li><li><a href="Situm.html#.fetchFloorsFromBuilding">fetchFloorsFromBuilding</a></li><li><a href="Situm.html#.fetchGeofencesFromBuilding">fetchGeofencesFromBuilding</a></li><li><a href="Situm.html#.fetchIndoorPOIsFromBuilding">fetchIndoorPOIsFromBuilding</a></li><li><a href="Situm.html#.fetchMapFromFloor">fetchMapFromFloor</a></li><li><a href="Situm.html#.fetchOutdoorPOIsFromBuilding">fetchOutdoorPOIsFromBuilding</a></li><li><a href="Situm.html#.fetchPoiCategories">fetchPoiCategories</a></li><li><a href="Situm.html#.fetchPoiCategoryIconNormal">fetchPoiCategoryIconNormal</a></li><li><a href="Situm.html#.fetchPoiCategoryIconSelected">fetchPoiCategoryIconSelected</a></li><li><a href="Situm.html#.internalSetEventDelegate">internalSetEventDelegate</a></li><li><a href="Situm.html#.invalidateCache">invalidateCache</a></li><li><a href="Situm.html#.onEnterGeofences">onEnterGeofences</a></li><li><a href="Situm.html#.onExitGeofences">onExitGeofences</a></li><li><a href="Situm.html#.removeNavigationUpdates">removeNavigationUpdates</a></li><li><a href="Situm.html#.removeRealTimeUpdates">removeRealTimeUpdates</a></li><li><a href="Situm.html#.requestDirections">requestDirections</a></li><li><a href="Situm.html#.requestNavigationUpdates">requestNavigationUpdates</a></li><li><a href="Situm.html#.requestRealTimeUpdates">requestRealTimeUpdates</a></li><li><a href="Situm.html#.setApiKey">setApiKey</a></li><li><a href="Situm.html#.setCacheMaxAge">setCacheMaxAge</a></li><li><a href="Situm.html#.setUserPass">setUserPass</a></li><li><a href="Situm.html#.startPositioning">startPositioning</a></li><li><a href="Situm.html#.stopPositioning">stopPositioning</a></li><li><a href="Situm.html#.updateNavigationWithLocation">updateNavigationWithLocation</a></li></ul></div></li></ul></div><div class="lnb-api hidden"><h3>Global</h3><ul><li><a href="global.html#Angle">Angle</a></li><li><a href="global.html#BeaconFilter">BeaconFilter</a></li><li><a href="global.html#Bounds">Bounds</a></li><li><a href="global.html#Building">Building</a></li><li><a href="global.html#BuildingInfo">BuildingInfo</a></li><li><a href="global.html#CartesianCoordinate">CartesianCoordinate</a></li><li><a href="global.html#Circle">Circle</a></li><li><a href="global.html#Coordinate">Coordinate</a></li><li><a href="global.html#Dimensions">Dimensions</a></li><li><a href="global.html#DirectionsOptions">DirectionsOptions</a></li><li><a href="global.html#DirectionsRequest">DirectionsRequest</a></li><li><a href="global.html#Floor">Floor</a></li><li><a href="global.html#Geofence">Geofence</a></li><li><a href="global.html#Indication">Indication</a></li><li><a href="global.html#Location">Location</a></li><li><a href="global.html#LocationOptions">LocationOptions</a></li><li><a href="global.html#LocationRequest">LocationRequest</a></li><li><a href="global.html#LocationStatus">LocationStatus</a></li><li><a href="global.html#NavigationProgress">NavigationProgress</a></li><li><a href="global.html#NavigationRequest">NavigationRequest</a></li><li><a href="global.html#OutdoorLocationOptions">OutdoorLocationOptions</a></li><li><a href="global.html#POI">POI</a></li><li><a href="global.html#PoiCategory">PoiCategory</a></li><li><a href="global.html#PoiDeselectedResult">PoiDeselectedResult</a></li><li><a href="global.html#Point">Point</a></li><li><a href="global.html#PoiSelectedResult">PoiSelectedResult</a></li><li><a href="global.html#RealTimeData">RealTimeData</a></li><li><a href="global.html#RealTimeRequest">RealTimeRequest</a></li><li><a href="global.html#Route">Route</a></li><li><a href="global.html#RouteSegment">RouteSegment</a></li><li><a href="global.html#RouteStep">RouteStep</a></li><li><a href="global.html#SitumConversionArea">SitumConversionArea</a></li><li><a href="global.html#SitumEvent">SitumEvent</a></li></ul></div>
|
|
44
44
|
</nav>
|
|
45
45
|
<div id="resizer"></div>
|
|
46
46
|
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
<section>
|
|
54
54
|
<article>
|
|
55
55
|
<pre class="prettyprint source linenums"><code>const MapViewController = require('./map-view-controller');
|
|
56
|
-
|
|
57
56
|
/**
|
|
58
57
|
* @namespace MapView
|
|
59
58
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@situm/cordova",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.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
|
@@ -739,4 +739,40 @@ var RealTimeData = {
|
|
|
739
739
|
locations,
|
|
740
740
|
}
|
|
741
741
|
|
|
742
|
-
module.exports = RealTimeData
|
|
742
|
+
module.exports = RealTimeData
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* @name
|
|
746
|
+
* PoiSelectedResult
|
|
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.
|
|
749
|
+
* @property {number} identifier The unique identifier of the {@link POI} selected.
|
|
750
|
+
* @property {number} buildingIdentifier The unique identifier of the building where the {@link POI} is located at.
|
|
751
|
+
*/
|
|
752
|
+
|
|
753
|
+
var PoiSelectedResult = {
|
|
754
|
+
poi: {
|
|
755
|
+
identifier,
|
|
756
|
+
buildingIdentifier,
|
|
757
|
+
},
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
module.exports = PoiSelectedResult;
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* @name
|
|
764
|
+
* PoiDeselectedResult
|
|
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.
|
|
767
|
+
* @property {number} identifier The unique identifier of the {@link POI} deselected.
|
|
768
|
+
* @property {number} buildingIdentifier The unique identifier of the building where the {@link POI} is located at.
|
|
769
|
+
*/
|
|
770
|
+
|
|
771
|
+
var PoiDeselectedResult = {
|
|
772
|
+
poi: {
|
|
773
|
+
identifier,
|
|
774
|
+
buildingIdentifier,
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
module.exports = PoiDeselectedResult;
|