mechanic-map 0.16.0 → 0.16.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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Mechanic Map SDK v2 (package version v0.16.0)
1
+ # Mechanic Map SDK v2 (package version v0.16.2)
2
2
 
3
3
  ```js
4
4
  // Initialize MechanicMap
@@ -253,8 +253,8 @@ $svgMap.on('levelReady', function(event, levelId, levelNo, isOutdoor) {
253
253
 
254
254
  ### Level Switched
255
255
  ```js
256
- $svgMap.on("levelSwitched", function (event, selectedLevelId, selectedLevelNo) {
257
- console.log("on:levelSwitched", selectedLevelId, selectedLevelNo);
256
+ $svgMap.on("levelSwitched", function (event, selectedLevelId, selectedLevelNo, isOutdoor) {
257
+ console.log("on:levelSwitched", selectedLevelId, selectedLevelNo, isOutdoor);
258
258
  });
259
259
  ```
260
260
 
@@ -268,14 +268,14 @@ $svgMap.on("locationOpened", function (event, location) {
268
268
 
269
269
  ### Unselected Location (store, service, building)
270
270
  ```js
271
- $svgMap.on("locationClosed", function (event) {
271
+ $svgMap.on("locationClosed", function () {
272
272
  console.log("on:locationClosed");
273
273
  });
274
274
  ```
275
275
 
276
276
  ### Navigation Clicked (tooltip navigation button)
277
277
  ```js
278
- $svgMap.on("navigationClicked", function (event, locationId) {
278
+ $svgMap.on("navigationClicked", function (event, $btn, locationId) {
279
279
  console.log("on:navigationClicked", locationId);
280
280
  });
281
281
  ```
@@ -283,7 +283,7 @@ $svgMap.on("navigationClicked", function (event, locationId) {
283
283
 
284
284
  ### Detail Clicked (tooltip detail button)
285
285
  ```js
286
- $svgMap.on("detailClicked", function (event, locationId) {
286
+ $svgMap.on("detailClicked", function (event, $btn, locationId) {
287
287
  console.log("on:detailClicked", locationId);
288
288
  });
289
289
  ```
@@ -298,23 +298,31 @@ $svgMap.on("enterBuildingClicked", function (event, $btn, buildingId, locationId
298
298
 
299
299
  ### Close Clicked (tooltip close button)
300
300
  ```js
301
- $svgMap.on("closeClicked", function (event, locationId) {
302
- console.log("on:closeClicked", locationId);
301
+ $svgMap.on("closeClicked", function (event, $btn) {
302
+ console.log("on:closeClicked", $btn);
303
303
  });
304
304
  ```
305
305
 
306
306
  ### Started a navigation
307
307
  With this listener, you can: What floor am I on? Am I on the floor where navigation begins? Am I on the last floor? Is there a next floor?
308
308
  ```js
309
- $svgMap.on('navigation', function(event, { isStartFloor, isEndFloor, currentFloorNo, nextFloorNo, levelChanger, hasPrevNavigate, hasNextNavigate, hasPrevBuildingNavigate, hasNextBuildingNavigate }) {
310
- console.log('on:navigation', isStartFloor, isEndFloor, currentFloorNo, nextFloorNo, levelChanger);
311
-
312
- // is multiple building?
313
- console.log('on:navigation', hasPrevBuildingNavigate, hasPrevBuildingNavigate);
314
-
315
- // If there is more than one building and isEndFloor is true, then next can navigate.
316
- // hasPrevNavigate, hasNextNavigate
317
- console.log('on:navigation', hasPrevNavigate, hasNextNavigate);
309
+ $svgMap.on('navigation', function(event, params) {
310
+ console.log('on:navigation: params=', params);
311
+ // console.log('currentLevelId', params.currentLevelId);
312
+ // console.log('isStartFloor', params.isStartFloor);
313
+ // console.log('isEndFloor', params.isEndFloor);
314
+ //
315
+ // console.log('prevLevelId', params.prevLevelId);
316
+ // console.log('hasPrevNavigate', params.hasPrevNavigate);
317
+ //
318
+ // console.log('nextLevelId', params.nextLevelId);
319
+ // console.log('hasNextNavigate', params.hasNextNavigate);
320
+ //
321
+ // console.log('prevBuildingId', params.prevBuildingId);
322
+ // console.log('hasPrevBuildingNavigate', params.hasPrevBuildingNavigate);
323
+ //
324
+ // console.log('nextBuildingId', params.nextBuildingId);
325
+ // console.log('hasNextBuildingNavigate', params.hasNextBuildingNavigate);
318
326
  });
319
327
  ```
320
328
 
@@ -461,6 +469,19 @@ map.startNavigation(sp, autoMode = true, zoomEnabled = true, showPins = true)
461
469
 
462
470
  ```
463
471
 
472
+ ### Gets navigation data by offset based on current navigation position (for multi-building navigation).
473
+ ```js
474
+ map.getNavigationDetails(offset = 0)
475
+
476
+ // const prevBuildingNavigate = map.getNavigationDetails(-1)
477
+ // const nextBuildingNavigate = map.getNavigationDetails(1)
478
+ ```
479
+
480
+ ### Returns the level ID if there is navigation one step before.
481
+ ```js
482
+ map.prevLevelId() // undefined / levelId
483
+ ```
484
+
464
485
  ### Can we switch to the previous step?
465
486
  ```js
466
487
  map.hasPrevNavigate()
@@ -471,6 +492,11 @@ map.hasPrevNavigate()
471
492
  map.prevNavigate(autoMode = false, zoomEnabled = true, showPins = true)
472
493
  ```
473
494
 
495
+ ### Returns the building ID if there is navigation one step before (for multiple building).
496
+ ```js
497
+ map.prevBuildingId()
498
+ ```
499
+
474
500
  ### Can we switch to the previous building? (for multiple building)
475
501
  ```js
476
502
  map.hasPrevBuildingNavigate()
@@ -481,6 +507,11 @@ map.hasPrevBuildingNavigate()
481
507
  map.prevBuildingNavigate(autoMode = false, zoomEnabled = true, showPins = true)
482
508
  ```
483
509
 
510
+ ### Can we switch to the next step?
511
+ ```js
512
+ map.nextLevelId()
513
+ ```
514
+
484
515
  ### Can we switch to the next step?
485
516
  ```js
486
517
  map.hasNextNavigate()
@@ -491,6 +522,11 @@ map.hasNextNavigate()
491
522
  map.nextNavigate(autoMode = false, zoomEnabled = true, showPins = true)
492
523
  ```
493
524
 
525
+ ### Can we switch to the next building? (for multiple building)
526
+ ```js
527
+ map.nextBuildingId()
528
+ ```
529
+
494
530
  ### Can we switch to the next building? (for multiple building)
495
531
  ```js
496
532
  map.hasNextBuildingNavigate()