proximiio-js-library 1.9.39 → 1.9.40

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.
@@ -7,7 +7,7 @@ import { AmenityModel } from '../../models/amenity';
7
7
  import { MapboxOptions } from '../../models/mapbox-options';
8
8
  import PersonModel from '../../models/person';
9
9
  import { WayfindingConfigModel } from '../../models/wayfinding';
10
- interface State {
10
+ export interface State {
11
11
  readonly initializing: boolean;
12
12
  readonly floor: FloorModel;
13
13
  readonly floors: FloorModel[];
@@ -28,7 +28,7 @@ interface State {
28
28
  readonly persons: PersonModel[];
29
29
  readonly user: any;
30
30
  }
31
- interface Options {
31
+ export interface Options {
32
32
  selector?: string;
33
33
  allowNewFeatureModal?: boolean;
34
34
  newFeatureModalEvent?: string;
@@ -100,7 +100,7 @@ interface Options {
100
100
  useTimerangeData?: boolean;
101
101
  sendAnalytics?: boolean;
102
102
  }
103
- interface PaddingOptions {
103
+ export interface PaddingOptions {
104
104
  bottom: number;
105
105
  left: number;
106
106
  right: number;
@@ -222,6 +222,15 @@ export declare class Map {
222
222
  * map.getMapboxInstance();
223
223
  */
224
224
  getMapboxInstance(): maplibregl.Map;
225
+ /**
226
+ * @memberof Map
227
+ * @name getMapState
228
+ * @returns returns map state
229
+ * @example
230
+ * const map = new Proximiio.Map();
231
+ * map.getMapState();
232
+ */
233
+ getMapState(): any;
225
234
  /**
226
235
  * @memberof Map
227
236
  * @name getMapReadyListener
@@ -917,4 +926,3 @@ export declare class Map {
917
926
  */
918
927
  refetch(): void;
919
928
  }
920
- export {};
@@ -2185,6 +2185,17 @@ var Map = /** @class */ (function () {
2185
2185
  Map.prototype.getMapboxInstance = function () {
2186
2186
  return this.map;
2187
2187
  };
2188
+ /**
2189
+ * @memberof Map
2190
+ * @name getMapState
2191
+ * @returns returns map state
2192
+ * @example
2193
+ * const map = new Proximiio.Map();
2194
+ * map.getMapState();
2195
+ */
2196
+ Map.prototype.getMapState = function () {
2197
+ return this.state;
2198
+ };
2188
2199
  /**
2189
2200
  * @memberof Map
2190
2201
  * @name getMapReadyListener
@@ -76,16 +76,21 @@ var getFeatures = function (_a) {
76
76
  if (useTimerangeData) {
77
77
  res.data.features = res.data.features
78
78
  .map(function (feature) {
79
- if (feature.properties && feature.properties.type === 'poi') {
80
- if (feature.properties.metadata &&
81
- feature.properties.metadata.dateStart &&
82
- feature.properties.metadata.dateEnd &&
83
- feature.properties.metadata.dateStart <= Date.now() &&
79
+ var _a, _b;
80
+ if (feature.properties && ((_a = feature.properties.metadata) === null || _a === void 0 ? void 0 : _a.dateStart) && ((_b = feature.properties.metadata) === null || _b === void 0 ? void 0 : _b.dateEnd)) {
81
+ // if feature have dateStart and dateEnd check the range and filter
82
+ if (feature.properties.metadata.dateStart <= Date.now() &&
84
83
  feature.properties.metadata.dateEnd >= Date.now()) {
84
+ // if feature is in range return feature
85
85
  return feature;
86
86
  }
87
+ else {
88
+ // if feature is outside of range return undefined
89
+ return undefined;
90
+ }
87
91
  }
88
92
  else {
93
+ // if feature dont have dateStart and dateEnd return feature
89
94
  return feature;
90
95
  }
91
96
  })
@@ -25,7 +25,9 @@ export declare class FloorModel extends BaseModel {
25
25
  editor?: FloorEditorModel;
26
26
  geopoint?: [number, number];
27
27
  remoteId?: string;
28
- metadata?: object;
28
+ metadata?: {
29
+ [key: string]: string | undefined;
30
+ };
29
31
  constructor(data: any);
30
32
  get hasFloorplan(): boolean;
31
33
  }
@@ -9,6 +9,9 @@ export declare class PlaceModel extends BaseModel {
9
9
  };
10
10
  tags?: string[];
11
11
  remoteId?: string;
12
+ metadata?: {
13
+ [key: string]: string | undefined;
14
+ };
12
15
  constructor(data: any);
13
16
  get hasLocation(): boolean;
14
17
  }