@mappedin/react-native-sdk 3.4.4 → 4.0.4-alpha.8
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 +12 -8
- package/dist/index.d.ts +5753 -0
- package/dist/index.js +3552 -0
- package/dist/index.js.map +7 -0
- package/package.json +26 -22
- package/CHANGELOG.md +0 -42
- package/dist/get-venue/package.json +0 -44
- package/dist/get-venue/src/Mappedin.API.types.d.ts +0 -203
- package/dist/get-venue/src/Mappedin.API.types.d.ts.map +0 -1
- package/dist/get-venue/src/Mappedin.API.types.js +0 -4
- package/dist/get-venue/src/Mappedin.d.ts +0 -256
- package/dist/get-venue/src/Mappedin.d.ts.map +0 -1
- package/dist/get-venue/src/Mappedin.js +0 -248
- package/dist/get-venue/src/Mappedin.types.d.ts +0 -30
- package/dist/get-venue/src/Mappedin.types.d.ts.map +0 -1
- package/dist/get-venue/src/Mappedin.types.js +0 -1
- package/dist/get-venue/src/MappedinCategory.d.ts +0 -48
- package/dist/get-venue/src/MappedinCategory.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinCategory.js +0 -87
- package/dist/get-venue/src/MappedinCoordinate.d.ts +0 -42
- package/dist/get-venue/src/MappedinCoordinate.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinCoordinate.js +0 -43
- package/dist/get-venue/src/MappedinCoordinate.test.d.ts +0 -2
- package/dist/get-venue/src/MappedinCoordinate.test.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinCoordinate.test.js +0 -19
- package/dist/get-venue/src/MappedinDestinationSet.d.ts +0 -8
- package/dist/get-venue/src/MappedinDestinationSet.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinDestinationSet.js +0 -6
- package/dist/get-venue/src/MappedinDirections.d.ts +0 -56
- package/dist/get-venue/src/MappedinDirections.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinDirections.js +0 -42
- package/dist/get-venue/src/MappedinEvent.d.ts +0 -30
- package/dist/get-venue/src/MappedinEvent.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinEvent.js +0 -67
- package/dist/get-venue/src/MappedinJSONScene.d.ts +0 -9
- package/dist/get-venue/src/MappedinJSONScene.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinJSONScene.js +0 -24
- package/dist/get-venue/src/MappedinLocation.d.ts +0 -89
- package/dist/get-venue/src/MappedinLocation.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinLocation.js +0 -223
- package/dist/get-venue/src/MappedinLocationRankings.d.ts +0 -12
- package/dist/get-venue/src/MappedinLocationRankings.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinLocationRankings.js +0 -26
- package/dist/get-venue/src/MappedinLocationState.d.ts +0 -14
- package/dist/get-venue/src/MappedinLocationState.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinLocationState.js +0 -33
- package/dist/get-venue/src/MappedinMap.d.ts +0 -64
- package/dist/get-venue/src/MappedinMap.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinMap.js +0 -215
- package/dist/get-venue/src/MappedinMapGroup.d.ts +0 -23
- package/dist/get-venue/src/MappedinMapGroup.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinMapGroup.js +0 -62
- package/dist/get-venue/src/MappedinNavigatable.d.ts +0 -38
- package/dist/get-venue/src/MappedinNavigatable.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinNavigatable.js +0 -82
- package/dist/get-venue/src/MappedinNode.d.ts +0 -65
- package/dist/get-venue/src/MappedinNode.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinNode.js +0 -153
- package/dist/get-venue/src/MappedinPolygon.d.ts +0 -60
- package/dist/get-venue/src/MappedinPolygon.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinPolygon.js +0 -164
- package/dist/get-venue/src/MappedinRankings.d.ts +0 -32
- package/dist/get-venue/src/MappedinRankings.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinRankings.js +0 -46
- package/dist/get-venue/src/MappedinTheme.d.ts +0 -15
- package/dist/get-venue/src/MappedinTheme.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinTheme.js +0 -41
- package/dist/get-venue/src/MappedinVenue.d.ts +0 -47
- package/dist/get-venue/src/MappedinVenue.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinVenue.js +0 -61
- package/dist/get-venue/src/MappedinVortex.d.ts +0 -26
- package/dist/get-venue/src/MappedinVortex.d.ts.map +0 -1
- package/dist/get-venue/src/MappedinVortex.js +0 -54
- package/dist/get-venue/src/default-things.d.ts +0 -14
- package/dist/get-venue/src/default-things.d.ts.map +0 -1
- package/dist/get-venue/src/default-things.js +0 -60
- package/dist/get-venue/src/fixtures/MappedinDemoMall.json +0 -1
- package/dist/get-venue/src/index.cjs.js +0 -16
- package/dist/get-venue/src/index.d.ts +0 -65
- package/dist/get-venue/src/index.d.ts.map +0 -1
- package/dist/get-venue/src/index.js +0 -16
- package/dist/get-venue/src/utils.d.ts +0 -15
- package/dist/get-venue/src/utils.d.ts.map +0 -1
- package/dist/get-venue/src/utils.js +0 -188
- package/dist/get-venue/tsconfig.docs.json +0 -7
- package/dist/get-venue/tsconfig.isomorphic.json +0 -20
- package/dist/get-venue/tsconfig.isomorphic.tsbuildinfo +0 -2262
- package/dist/get-venue/tsconfig.json +0 -19
- package/dist/get-venue/tsconfig.tsbuildinfo +0 -2758
- package/dist/sdk/src/MappedinController.d.ts +0 -45
- package/dist/sdk/src/MappedinController.d.ts.map +0 -1
- package/dist/sdk/src/MappedinController.js +0 -1
- package/dist/sdk/src/MiMapView.d.ts +0 -80
- package/dist/sdk/src/MiMapView.d.ts.map +0 -1
- package/dist/sdk/src/MiMapView.element.d.ts +0 -8
- package/dist/sdk/src/MiMapView.element.d.ts.map +0 -1
- package/dist/sdk/src/MiMapView.element.js +0 -5
- package/dist/sdk/src/MiMapView.element.web.d.ts +0 -6
- package/dist/sdk/src/MiMapView.element.web.d.ts.map +0 -1
- package/dist/sdk/src/MiMapView.element.web.js +0 -1
- package/dist/sdk/src/MiMapView.js +0 -1
- package/dist/sdk/src/MiMapView.store.d.ts +0 -197
- package/dist/sdk/src/MiMapView.store.d.ts.map +0 -1
- package/dist/sdk/src/MiMapView.store.js +0 -1
- package/dist/sdk/src/MiMapView.store.types.d.ts +0 -202
- package/dist/sdk/src/MiMapView.store.types.d.ts.map +0 -1
- package/dist/sdk/src/MiMapView.store.types.js +0 -1
- package/dist/sdk/src/MiMiniMap.d.ts +0 -31
- package/dist/sdk/src/MiMiniMap.d.ts.map +0 -1
- package/dist/sdk/src/MiMiniMap.js +0 -3
- package/dist/sdk/src/MiMiniMap.store.d.ts +0 -22
- package/dist/sdk/src/MiMiniMap.store.d.ts.map +0 -1
- package/dist/sdk/src/MiMiniMap.store.js +0 -1
- package/dist/sdk/src/assets/index.html.d.ts +0 -3
- package/dist/sdk/src/assets/index.html.d.ts.map +0 -1
- package/dist/sdk/src/assets/index.html.js +0 -1
- package/dist/sdk/src/index.d.ts +0 -186
- package/dist/sdk/src/index.d.ts.map +0 -1
- package/dist/sdk/src/index.js +0 -1
- package/dist/sdk/src/pub-sub.d.ts +0 -27
- package/dist/sdk/src/pub-sub.d.ts.map +0 -1
- package/dist/sdk/src/pub-sub.js +0 -1
- package/dist/sdk/src/utils.d.ts +0 -18
- package/dist/sdk/src/utils.d.ts.map +0 -1
- package/dist/sdk/src/utils.js +0 -1
- package/dist/sdk/tsconfig.build.tsbuildinfo +0 -6928
- package/dist/types/src/Mappedin.bridge.events.d.ts +0 -74
- package/dist/types/src/Mappedin.bridge.events.d.ts.map +0 -1
- package/dist/types/src/Mappedin.bridge.events.js +0 -1
- package/dist/types/src/index.d.ts +0 -4
- package/dist/types/src/index.d.ts.map +0 -1
- package/dist/types/src/index.js +0 -1
- package/dist/types/src/navigator.d.ts +0 -78
- package/dist/types/src/navigator.d.ts.map +0 -1
- package/dist/types/src/navigator.js +0 -1
- package/dist/types/tsconfig.tsbuildinfo +0 -1819
- package/dist/types_mappedin__mappedin-js/tsconfig.tsbuildinfo +0 -1781
- package/dist/types_mappedin__mappedin-js/types.d.ts +0 -205
- package/dist/types_mappedin__mappedin-js/types.d.ts.map +0 -1
- package/dist/types_mappedin__mappedin-js/types.js +0 -53
- package/docs/assets/css/main.css +0 -2660
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +0 -248
- package/docs/assets/js/search.js +0 -1
- package/docs/classes/mappedin.html +0 -560
- package/docs/classes/mappedincategory.html +0 -373
- package/docs/classes/mappedindestinationset.html +0 -184
- package/docs/classes/mappedindirections.html +0 -258
- package/docs/classes/mappedinevent.html +0 -387
- package/docs/classes/mappedinlocation.html +0 -942
- package/docs/classes/mappedinmap.html +0 -501
- package/docs/classes/mappedinmapgroup.html +0 -329
- package/docs/classes/mappedinnode.html +0 -717
- package/docs/classes/mappedinpolygon.html +0 -714
- package/docs/classes/mappedinrankings.html +0 -288
- package/docs/classes/mappedinvenue.html +0 -494
- package/docs/classes/mappedinvortex.html +0 -331
- package/docs/classes/mapviewstore.html +0 -1233
- package/docs/enums/action_type.html +0 -188
- package/docs/enums/bearing_type.html +0 -188
- package/docs/enums/collision_ranking_tiers.html +0 -177
- package/docs/enums/e_bluedot_state.html +0 -223
- package/docs/enums/e_bluedot_state_reason.html +0 -197
- package/docs/enums/e_marker_state.html +0 -204
- package/docs/enums/marker_anchor.html +0 -188
- package/docs/enums/state.html +0 -160
- package/docs/index.html +0 -1078
- package/docs/modules.html +0 -1898
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { TImage } from './Mappedin.API.types';
|
|
2
|
-
import type { Mappedin } from './Mappedin';
|
|
3
|
-
import type { MappedinLocation } from './MappedinLocation';
|
|
4
|
-
/**
|
|
5
|
-
* An event.
|
|
6
|
-
*
|
|
7
|
-
* @class MappedinEvent
|
|
8
|
-
*/
|
|
9
|
-
export declare class MappedinEvent {
|
|
10
|
-
#private;
|
|
11
|
-
id: string;
|
|
12
|
-
type: string;
|
|
13
|
-
name: string;
|
|
14
|
-
description?: string | undefined;
|
|
15
|
-
image?: TImage | undefined;
|
|
16
|
-
startDate?: number | undefined;
|
|
17
|
-
endDate?: number | undefined;
|
|
18
|
-
showDate?: number | undefined;
|
|
19
|
-
constructor(mappedin: Mappedin, data: any);
|
|
20
|
-
/**
|
|
21
|
-
* Location this Event is occuring at.
|
|
22
|
-
*
|
|
23
|
-
* @property location {MappedinLocation}
|
|
24
|
-
*/
|
|
25
|
-
location(): MappedinLocation | undefined;
|
|
26
|
-
static hydrate(events: any, mappedin: Mappedin): MappedinEvent[];
|
|
27
|
-
static fetch(mappedin: Mappedin): Promise<MappedinEvent[]>;
|
|
28
|
-
toJSON(): any;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=MappedinEvent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MappedinEvent.d.ts","sourceRoot":"","sources":["../../src/MappedinEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D;;;;GAIG;AACH,qBAAa,aAAa;;IAOxB,EAAE,SAAM;IAER,IAAI,SAAM;IAEV,IAAI,SAAM;IAEV,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;gBAElB,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;IAMzC;;;;OAIG;IACH,QAAQ,IAAI,gBAAgB,GAAG,SAAS;IAkBxC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,aAAa,EAAE;WAInD,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAmBhE,MAAM;CAGP"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { addToSet, getArray } from './utils';
|
|
2
|
-
/**
|
|
3
|
-
* An event.
|
|
4
|
-
*
|
|
5
|
-
* @class MappedinEvent
|
|
6
|
-
*/
|
|
7
|
-
export class MappedinEvent {
|
|
8
|
-
constructor(mappedin, data) {
|
|
9
|
-
this.#cache = {};
|
|
10
|
-
this.id = '';
|
|
11
|
-
this.type = '';
|
|
12
|
-
this.name = '';
|
|
13
|
-
this.#data = data;
|
|
14
|
-
this.#mappedin = mappedin;
|
|
15
|
-
Object.assign(this, data);
|
|
16
|
-
}
|
|
17
|
-
#mappedin;
|
|
18
|
-
#data;
|
|
19
|
-
#cache;
|
|
20
|
-
/**
|
|
21
|
-
* Location this Event is occuring at.
|
|
22
|
-
*
|
|
23
|
-
* @property location {MappedinLocation}
|
|
24
|
-
*/
|
|
25
|
-
location() {
|
|
26
|
-
const cache = this.#cache.location;
|
|
27
|
-
if (typeof cache !== 'undefined') {
|
|
28
|
-
return cache;
|
|
29
|
-
}
|
|
30
|
-
let related;
|
|
31
|
-
const through = this.#mappedin._locationsById;
|
|
32
|
-
const locationId = this.#data.location;
|
|
33
|
-
if (locationId != null) {
|
|
34
|
-
const location = through[locationId];
|
|
35
|
-
if (location != null) {
|
|
36
|
-
related = location;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
this.#cache.location = related;
|
|
40
|
-
return related;
|
|
41
|
-
}
|
|
42
|
-
static hydrate(events, mappedin) {
|
|
43
|
-
return events.map((e) => new MappedinEvent(mappedin, e));
|
|
44
|
-
}
|
|
45
|
-
static async fetch(mappedin) {
|
|
46
|
-
const fields = mappedin.options.things.events.slice();
|
|
47
|
-
if (mappedin.options.things.locations) {
|
|
48
|
-
addToSet(fields, 'location');
|
|
49
|
-
}
|
|
50
|
-
const query = {
|
|
51
|
-
fields,
|
|
52
|
-
venue: mappedin.options.venue,
|
|
53
|
-
activeAtOrAfter: Date.now(),
|
|
54
|
-
};
|
|
55
|
-
try {
|
|
56
|
-
const data = await getArray(mappedin.options, 'event', query);
|
|
57
|
-
return data.map((e) => new MappedinEvent(mappedin, e));
|
|
58
|
-
}
|
|
59
|
-
catch (e) {
|
|
60
|
-
console.error('Fetch Events:', e);
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
toJSON() {
|
|
65
|
-
return this.#data;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Mappedin } from './Mappedin';
|
|
2
|
-
export declare class MappedinJSONScene {
|
|
3
|
-
#private;
|
|
4
|
-
data: any;
|
|
5
|
-
constructor(mappedin: Mappedin, data: any);
|
|
6
|
-
static fetch(mappedin: Mappedin, mapId: string, scene: any): Promise<any>;
|
|
7
|
-
toJSON(): any;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=MappedinJSONScene.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MappedinJSONScene.d.ts","sourceRoot":"","sources":["../../src/MappedinJSONScene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,iBAAiB;;IAK5B,IAAI,EAAE,GAAG,CAAC;gBAEE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;WAK5B,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;IAkBhE,MAAM;CAGP"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export class MappedinJSONScene {
|
|
2
|
-
constructor(mappedin, data) {
|
|
3
|
-
this.#data = data;
|
|
4
|
-
this.#mappedin = mappedin;
|
|
5
|
-
}
|
|
6
|
-
#data;
|
|
7
|
-
#mappedin;
|
|
8
|
-
static async fetch(mappedin, mapId, scene) {
|
|
9
|
-
console.log(scene.images.map((a) => a.filename));
|
|
10
|
-
// scene.images.forEach(
|
|
11
|
-
// ({ url, filename }: { url: string; filename: string }) => {
|
|
12
|
-
// mappedin.images[filename] = url;
|
|
13
|
-
// },
|
|
14
|
-
// );
|
|
15
|
-
// const res = await fetch(scene.polygons);
|
|
16
|
-
// const jsonScene = new MappedinJSONScene(mappedin, await res.json());
|
|
17
|
-
// mappedin.scenes[mapId] = jsonScene;
|
|
18
|
-
// return jsonScene;
|
|
19
|
-
return scene;
|
|
20
|
-
}
|
|
21
|
-
toJSON() {
|
|
22
|
-
return this.#data;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { TCategory, TLocation, TColor, TGalleryImage, TLogo, TOpeningHours, TPhone, TPicture, TSiblingGroup, TSocial } from './Mappedin.API.types';
|
|
2
|
-
import type { Mappedin } from './Mappedin';
|
|
3
|
-
import type { MappedinLocationState } from './MappedinLocationState';
|
|
4
|
-
import type { MappedinNode } from './MappedinNode';
|
|
5
|
-
import type { MappedinPolygon } from './MappedinPolygon';
|
|
6
|
-
import { MappedinNavigatable } from './MappedinNavigatable';
|
|
7
|
-
export declare function getCurrentLocationState(location: MappedinLocation, states: MappedinLocationState[], date?: Date): MappedinLocationState | undefined;
|
|
8
|
-
export declare type TOperationHoursMap = {
|
|
9
|
-
[key in string]: TOpeningHours[];
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* A {@link MappedinLocation} is something like a store or washroom on a {@link MappedinMap}. It has an ID and will be linked to zero or more {@link MappedinNode}s and {@link MappedinPolygon}s.
|
|
13
|
-
*
|
|
14
|
-
* A Location's Nodes and Polygons can be on multiple Maps, or in multiple non-adjacent places on the same Map.
|
|
15
|
-
* For example, all washroom at a given Venue could belong to one Location, or a department store could live on multiple floors. A Washroom Location might a have a few Polygons spread throughout the Venue for each one that exists, but a single store might just have one presence, and therefore one Polygon. Some Locations just have a single point and only have Nodes.
|
|
16
|
-
*
|
|
17
|
-
* A Location can have more properties (typically things like 'name', 'externalId', 'type', 'categories', 'description', 'logo', etc).
|
|
18
|
-
*
|
|
19
|
-
* The {@link Mappedin} 'things' object is where you would specify what properties you want to download for Locations. Only specify what you will actually use, to minmimze transfer time. Work with your Mappedin developer relations contact to set up any custom properties you need.
|
|
20
|
-
*
|
|
21
|
-
* See below for an example a 'things' object with available Location properties specified:
|
|
22
|
-
*
|
|
23
|
-
* things: {
|
|
24
|
-
* venue: [],
|
|
25
|
-
* locations: ['venue', 'name', 'type', 'icon', 'logo', 'language', 'externalId', 'description', 'categories', 'phone', 'operationHours', 'social', 'tags', 'parents', 'sortOrder'],
|
|
26
|
-
* categories: [],
|
|
27
|
-
* maps: []
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* @class MappedinLocation
|
|
31
|
-
*/
|
|
32
|
-
export declare class MappedinLocation extends MappedinNavigatable {
|
|
33
|
-
#private;
|
|
34
|
-
states: TLocation['states'];
|
|
35
|
-
id: string;
|
|
36
|
-
name: string;
|
|
37
|
-
type: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
sortOrder?: number;
|
|
40
|
-
logo?: TLogo;
|
|
41
|
-
phone?: TPhone;
|
|
42
|
-
social?: TSocial;
|
|
43
|
-
color?: TColor;
|
|
44
|
-
shortName?: string;
|
|
45
|
-
detailsUrl?: string;
|
|
46
|
-
tags?: string[];
|
|
47
|
-
externalId?: string;
|
|
48
|
-
picture?: TPicture;
|
|
49
|
-
operationHours?: TOpeningHours[] | undefined;
|
|
50
|
-
siblingGroups?: TSiblingGroup[] | undefined;
|
|
51
|
-
gallery?: TGalleryImage[] | undefined;
|
|
52
|
-
constructor(mappedin: Mappedin, data: any);
|
|
53
|
-
categories: TCategory[];
|
|
54
|
-
/**
|
|
55
|
-
* Polygons this Location is attached to.
|
|
56
|
-
*
|
|
57
|
-
* @property polygons
|
|
58
|
-
* @type [MappedinPolygon]
|
|
59
|
-
*/
|
|
60
|
-
get polygons(): MappedinPolygon[];
|
|
61
|
-
set polygons(polygons: MappedinPolygon[]);
|
|
62
|
-
/**
|
|
63
|
-
* Ranking for this location.
|
|
64
|
-
*/
|
|
65
|
-
get rank(): number | null;
|
|
66
|
-
/**
|
|
67
|
-
* Nodes this Location is attached to.
|
|
68
|
-
*
|
|
69
|
-
* @property nodes
|
|
70
|
-
* @type [MappedinNode]
|
|
71
|
-
*/
|
|
72
|
-
get nodes(): MappedinNode[] | undefined;
|
|
73
|
-
set nodes(nodes: MappedinNode[] | undefined);
|
|
74
|
-
/**
|
|
75
|
-
* Parent of this Location, if any. Used in cases where one Location is inside another, more "important" Location.
|
|
76
|
-
*
|
|
77
|
-
* @property parent
|
|
78
|
-
* @type MappedinLocation
|
|
79
|
-
*/
|
|
80
|
-
get parent(): MappedinLocation | undefined;
|
|
81
|
-
set parent(parent: MappedinLocation | undefined);
|
|
82
|
-
get state(): MappedinLocationState | undefined;
|
|
83
|
-
clone(): MappedinLocation;
|
|
84
|
-
get nodeOperationHours(): TOperationHoursMap;
|
|
85
|
-
static hydrate(locations: any, mappedin: Mappedin): MappedinLocation[];
|
|
86
|
-
static fetch(mappedin: Mappedin): Promise<MappedinLocation[]>;
|
|
87
|
-
toJSON(): any;
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=MappedinLocation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MappedinLocation.d.ts","sourceRoot":"","sources":["../../src/MappedinLocation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,MAAM,EACN,aAAa,EACb,KAAK,EACL,aAAa,EACb,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAM5D,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,qBAAqB,EAAE,EAC/B,IAAI,GAAE,IAAiB,GACtB,qBAAqB,GAAG,SAAS,CAUnC;AAED,oBAAY,kBAAkB,GAAG;KAAG,GAAG,IAAI,MAAM,GAAG,aAAa,EAAE;CAAE,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,gBAAiB,SAAQ,mBAAmB;;IAOvD,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAE5B,EAAE,SAAM;IAER,IAAI,SAAM;IAEV,IAAI,SAAM;IAEV,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,EAAE,KAAK,CAAC;IAEb,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB,cAAc,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IAE7C,aAAa,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IAE5C,OAAO,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;gBAE1B,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;IAOzC,UAAU,EAAE,SAAS,EAAE,CAAM;IAI7B;;;;;OAKG;IACH,IAAI,QAAQ,IAAI,eAAe,EAAE,CAqBhC;IAED,IAAI,QAAQ,CAAC,QAAQ,EAvBL,eAAe,EAuBV,EAEpB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,GAAG,IAAI,CAkBxB;IAID;;;;;OAKG;IACH,IAAI,KAAK,IAAI,YAAY,EAAE,GAAG,SAAS,CAmBtC;IAED,IAAI,KAAK,CAAC,KAAK,EArBF,YAAY,EAAE,GAAG,SAqBf,EAEd;IAID;;;;;OAKG;IACH,IAAI,MAAM,IAAI,gBAAgB,GAAG,SAAS,CAczC;IAED,IAAI,MAAM,CAAC,MAAM,EAhBH,gBAAgB,GAAG,SAgBhB,EAEhB;IAED,IAAI,KAAK,sCAER;IAED,KAAK;IAIL,IAAI,kBAAkB,IAAI,kBAAkB,CAoB3C;IAED,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,EAAE;WAIzD,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAgCnE,MAAM;CAGP"}
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { MappedinNavigatable } from './MappedinNavigatable';
|
|
2
|
-
import { addToSet, getArray } from './utils';
|
|
3
|
-
const DISTANT_PAST = 0; // start of epoch
|
|
4
|
-
const FAR_FUTURE = '9999-12-31T00:00:00.000Z';
|
|
5
|
-
export function getCurrentLocationState(location, states, date = new Date()) {
|
|
6
|
-
if (!location.states)
|
|
7
|
-
return;
|
|
8
|
-
const now = date || new Date();
|
|
9
|
-
const currentState = location.states.find((state) => {
|
|
10
|
-
const start = new Date(state.start || DISTANT_PAST);
|
|
11
|
-
const end = new Date(state.end || FAR_FUTURE);
|
|
12
|
-
return start < now && end > now;
|
|
13
|
-
});
|
|
14
|
-
if (!currentState)
|
|
15
|
-
return;
|
|
16
|
-
return states.find((state) => state.value === currentState.type);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* A {@link MappedinLocation} is something like a store or washroom on a {@link MappedinMap}. It has an ID and will be linked to zero or more {@link MappedinNode}s and {@link MappedinPolygon}s.
|
|
20
|
-
*
|
|
21
|
-
* A Location's Nodes and Polygons can be on multiple Maps, or in multiple non-adjacent places on the same Map.
|
|
22
|
-
* For example, all washroom at a given Venue could belong to one Location, or a department store could live on multiple floors. A Washroom Location might a have a few Polygons spread throughout the Venue for each one that exists, but a single store might just have one presence, and therefore one Polygon. Some Locations just have a single point and only have Nodes.
|
|
23
|
-
*
|
|
24
|
-
* A Location can have more properties (typically things like 'name', 'externalId', 'type', 'categories', 'description', 'logo', etc).
|
|
25
|
-
*
|
|
26
|
-
* The {@link Mappedin} 'things' object is where you would specify what properties you want to download for Locations. Only specify what you will actually use, to minmimze transfer time. Work with your Mappedin developer relations contact to set up any custom properties you need.
|
|
27
|
-
*
|
|
28
|
-
* See below for an example a 'things' object with available Location properties specified:
|
|
29
|
-
*
|
|
30
|
-
* things: {
|
|
31
|
-
* venue: [],
|
|
32
|
-
* locations: ['venue', 'name', 'type', 'icon', 'logo', 'language', 'externalId', 'description', 'categories', 'phone', 'operationHours', 'social', 'tags', 'parents', 'sortOrder'],
|
|
33
|
-
* categories: [],
|
|
34
|
-
* maps: []
|
|
35
|
-
* }
|
|
36
|
-
*
|
|
37
|
-
* @class MappedinLocation
|
|
38
|
-
*/
|
|
39
|
-
export class MappedinLocation extends MappedinNavigatable {
|
|
40
|
-
constructor(mappedin, data) {
|
|
41
|
-
super(mappedin);
|
|
42
|
-
this.#cache = {};
|
|
43
|
-
this.id = '';
|
|
44
|
-
this.name = '';
|
|
45
|
-
this.type = '';
|
|
46
|
-
this.categories = [];
|
|
47
|
-
this.#nodes = [];
|
|
48
|
-
this.#mappedin = mappedin;
|
|
49
|
-
this.#data = data;
|
|
50
|
-
Object.assign(this, data);
|
|
51
|
-
}
|
|
52
|
-
#mappedin;
|
|
53
|
-
#data;
|
|
54
|
-
#cache;
|
|
55
|
-
#polygons;
|
|
56
|
-
/**
|
|
57
|
-
* Polygons this Location is attached to.
|
|
58
|
-
*
|
|
59
|
-
* @property polygons
|
|
60
|
-
* @type [MappedinPolygon]
|
|
61
|
-
*/
|
|
62
|
-
get polygons() {
|
|
63
|
-
const cache = this.#cache.polygons;
|
|
64
|
-
if (typeof cache !== 'undefined') {
|
|
65
|
-
return cache;
|
|
66
|
-
}
|
|
67
|
-
const related = [];
|
|
68
|
-
const through = this.#polygons;
|
|
69
|
-
const index = this.#mappedin._polygonsById;
|
|
70
|
-
if (Array.isArray(through)) {
|
|
71
|
-
for (let i = 0, iLen = through.length; i < iLen; ++i) {
|
|
72
|
-
const polygonId = through[i].id;
|
|
73
|
-
const polygon = index[polygonId];
|
|
74
|
-
// TODO: fix!
|
|
75
|
-
// @ts-ignore
|
|
76
|
-
if (polygon != null && polygon.geometry.visible) {
|
|
77
|
-
related.push(polygon);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
this.#cache.polygons = related;
|
|
82
|
-
return related;
|
|
83
|
-
}
|
|
84
|
-
set polygons(polygons) {
|
|
85
|
-
this.#polygons = polygons;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Ranking for this location.
|
|
89
|
-
*/
|
|
90
|
-
get rank() {
|
|
91
|
-
const cache = this.#cache.rank;
|
|
92
|
-
if (typeof cache !== 'undefined') {
|
|
93
|
-
return cache;
|
|
94
|
-
}
|
|
95
|
-
const rankings = this.#mappedin.locationRankings;
|
|
96
|
-
// TODO: fix!
|
|
97
|
-
// @ts-ignore
|
|
98
|
-
if (!(rankings && rankings.locations))
|
|
99
|
-
return null;
|
|
100
|
-
const findById = (datum) => datum.ids.find((x) => x === this.id);
|
|
101
|
-
// TODO: fix!
|
|
102
|
-
// @ts-ignore
|
|
103
|
-
const thisRankData = rankings.locations.find(findById);
|
|
104
|
-
if (thisRankData) {
|
|
105
|
-
this.#cache.rank = thisRankData.score;
|
|
106
|
-
return thisRankData.score;
|
|
107
|
-
}
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
#nodes;
|
|
111
|
-
/**
|
|
112
|
-
* Nodes this Location is attached to.
|
|
113
|
-
*
|
|
114
|
-
* @property nodes
|
|
115
|
-
* @type [MappedinNode]
|
|
116
|
-
*/
|
|
117
|
-
get nodes() {
|
|
118
|
-
const cache = this.#cache.nodes;
|
|
119
|
-
if (typeof cache !== 'undefined') {
|
|
120
|
-
return cache;
|
|
121
|
-
}
|
|
122
|
-
const related = [];
|
|
123
|
-
const through = this.#nodes;
|
|
124
|
-
const index = this.#mappedin._nodesById;
|
|
125
|
-
if (through) {
|
|
126
|
-
for (let i = 0, iLen = through.length; i < iLen; ++i) {
|
|
127
|
-
const nodeId = through[i].node;
|
|
128
|
-
const node = index[nodeId];
|
|
129
|
-
if (node != null) {
|
|
130
|
-
related.push(node);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
this.#cache.nodes = related;
|
|
135
|
-
return related;
|
|
136
|
-
}
|
|
137
|
-
set nodes(nodes) {
|
|
138
|
-
this.#nodes = nodes;
|
|
139
|
-
}
|
|
140
|
-
#parent;
|
|
141
|
-
/**
|
|
142
|
-
* Parent of this Location, if any. Used in cases where one Location is inside another, more "important" Location.
|
|
143
|
-
*
|
|
144
|
-
* @property parent
|
|
145
|
-
* @type MappedinLocation
|
|
146
|
-
*/
|
|
147
|
-
get parent() {
|
|
148
|
-
const cache = this.#cache.parent;
|
|
149
|
-
if (typeof cache !== 'undefined') {
|
|
150
|
-
return cache;
|
|
151
|
-
}
|
|
152
|
-
let related;
|
|
153
|
-
const locations = this.#mappedin._locationsById;
|
|
154
|
-
const parentId = this.#parent;
|
|
155
|
-
if (parentId !== undefined) {
|
|
156
|
-
related = locations[parentId];
|
|
157
|
-
}
|
|
158
|
-
this.#cache.parent = related;
|
|
159
|
-
return related;
|
|
160
|
-
}
|
|
161
|
-
set parent(parent) {
|
|
162
|
-
this.#parent = parent;
|
|
163
|
-
}
|
|
164
|
-
get state() {
|
|
165
|
-
return getCurrentLocationState(this, this.#mappedin.locationStates);
|
|
166
|
-
}
|
|
167
|
-
clone() {
|
|
168
|
-
return new MappedinLocation(this.#mappedin, this.#data);
|
|
169
|
-
}
|
|
170
|
-
get nodeOperationHours() {
|
|
171
|
-
const cache = this.#cache.nodeOperationHours;
|
|
172
|
-
if (typeof cache !== 'undefined') {
|
|
173
|
-
return cache;
|
|
174
|
-
}
|
|
175
|
-
if (this.nodes == null) {
|
|
176
|
-
return {};
|
|
177
|
-
}
|
|
178
|
-
const result = this.#data.nodes.reduce((map, node) => {
|
|
179
|
-
if (node.operationHours != null) {
|
|
180
|
-
map[node.node] = node.operationHours;
|
|
181
|
-
}
|
|
182
|
-
return map;
|
|
183
|
-
}, {});
|
|
184
|
-
this.#cache.nodeOperationHours = result;
|
|
185
|
-
return result;
|
|
186
|
-
}
|
|
187
|
-
static hydrate(locations, mappedin) {
|
|
188
|
-
return locations.map((l) => new MappedinLocation(mappedin, l));
|
|
189
|
-
}
|
|
190
|
-
static async fetch(mappedin) {
|
|
191
|
-
const fields = mappedin.options.things.locations.slice();
|
|
192
|
-
if (mappedin.options.things.categories) {
|
|
193
|
-
addToSet(fields, 'categories');
|
|
194
|
-
}
|
|
195
|
-
if (mappedin.options.things.nodes) {
|
|
196
|
-
addToSet(fields, 'nodes');
|
|
197
|
-
}
|
|
198
|
-
if (mappedin.options.things.polygons) {
|
|
199
|
-
addToSet(fields, 'polygons');
|
|
200
|
-
}
|
|
201
|
-
if (mappedin.options.things.locationStates) {
|
|
202
|
-
addToSet(fields, 'states');
|
|
203
|
-
}
|
|
204
|
-
const query = {
|
|
205
|
-
fields,
|
|
206
|
-
venue: mappedin.options.venue,
|
|
207
|
-
};
|
|
208
|
-
try {
|
|
209
|
-
let data = await getArray(mappedin.options, 'location', query);
|
|
210
|
-
if (!mappedin.options.includeHidden) {
|
|
211
|
-
data = data.filter((datum) => !datum.hidden);
|
|
212
|
-
}
|
|
213
|
-
return data.map((l) => new MappedinLocation(mappedin, l));
|
|
214
|
-
}
|
|
215
|
-
catch (e) {
|
|
216
|
-
console.error('Fetch Locations:', e);
|
|
217
|
-
return [];
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
toJSON() {
|
|
221
|
-
return this.#data;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Mappedin } from './Mappedin';
|
|
2
|
-
import type { TLocation } from './Mappedin.API.types';
|
|
3
|
-
/** One of these contains all the venue's rankings. * */
|
|
4
|
-
export declare class MappedinLocationRankings {
|
|
5
|
-
#private;
|
|
6
|
-
constructor(data: any);
|
|
7
|
-
locations: TLocation[];
|
|
8
|
-
static hydrate(locationRankings: any): MappedinLocationRankings;
|
|
9
|
-
static fetch(mappedin: Mappedin): Promise<MappedinLocationRankings>;
|
|
10
|
-
toJSON(): any;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=MappedinLocationRankings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MappedinLocationRankings.d.ts","sourceRoot":"","sources":["../../src/MappedinLocationRankings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,wDAAwD;AACxD,qBAAa,wBAAwB;;gBAGvB,IAAI,EAAE,GAAG;IAKrB,SAAS,EAAE,SAAS,EAAE,CAAM;IAE5B,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,GAAG,wBAAwB;WAIlD,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAezE,MAAM;CAGP"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { getObject } from './utils';
|
|
2
|
-
/** One of these contains all the venue's rankings. * */
|
|
3
|
-
export class MappedinLocationRankings {
|
|
4
|
-
constructor(data) {
|
|
5
|
-
this.locations = [];
|
|
6
|
-
this.#data = data;
|
|
7
|
-
Object.assign(this, data);
|
|
8
|
-
}
|
|
9
|
-
#data;
|
|
10
|
-
static hydrate(locationRankings) {
|
|
11
|
-
return new MappedinLocationRankings(locationRankings);
|
|
12
|
-
}
|
|
13
|
-
static async fetch(mappedin) {
|
|
14
|
-
try {
|
|
15
|
-
const data = await getObject(mappedin.options, 'smart-labels/location-label-ranking', { venue: mappedin.options.venue }, true);
|
|
16
|
-
return new MappedinLocationRankings(data);
|
|
17
|
-
}
|
|
18
|
-
catch (e) {
|
|
19
|
-
console.error('Fetch Location Rankings:', e);
|
|
20
|
-
return {};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
toJSON() {
|
|
24
|
-
return this.#data;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Mappedin } from './Mappedin';
|
|
2
|
-
/**
|
|
3
|
-
* A location state, that can belong to any number of {@link MappedinLocation}s.
|
|
4
|
-
* @class MappedinLocationState
|
|
5
|
-
*/
|
|
6
|
-
export declare class MappedinLocationState {
|
|
7
|
-
#private;
|
|
8
|
-
constructor(data: any);
|
|
9
|
-
static hydrate(locationStates: any): MappedinLocationState[];
|
|
10
|
-
value: any;
|
|
11
|
-
static fetch(mappedin: Mappedin): Promise<MappedinLocationState[]>;
|
|
12
|
-
toJSON(): any;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=MappedinLocationState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MappedinLocationState.d.ts","sourceRoot":"","sources":["../../src/MappedinLocationState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C;;;GAGG;AACH,qBAAa,qBAAqB;;gBAGpB,IAAI,EAAE,GAAG;IAKrB,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,GAAG,qBAAqB,EAAE;IAI5D,KAAK,EAAE,GAAG,CAAC;WAEE,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAexE,MAAM;CAGP"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { getArray } from './utils';
|
|
2
|
-
/**
|
|
3
|
-
* A location state, that can belong to any number of {@link MappedinLocation}s.
|
|
4
|
-
* @class MappedinLocationState
|
|
5
|
-
*/
|
|
6
|
-
export class MappedinLocationState {
|
|
7
|
-
constructor(data) {
|
|
8
|
-
this.#data = data;
|
|
9
|
-
Object.assign(this, data);
|
|
10
|
-
}
|
|
11
|
-
#data;
|
|
12
|
-
static hydrate(locationStates) {
|
|
13
|
-
return locationStates.map((ls) => new MappedinLocationState(ls));
|
|
14
|
-
}
|
|
15
|
-
static async fetch(mappedin) {
|
|
16
|
-
const fields = mappedin.options.things.locationStates.slice();
|
|
17
|
-
const query = {
|
|
18
|
-
fields,
|
|
19
|
-
venue: mappedin.options.venue,
|
|
20
|
-
};
|
|
21
|
-
try {
|
|
22
|
-
const data = await getArray(mappedin.options, 'location-state', query);
|
|
23
|
-
return data.map((ls) => new MappedinLocationState(ls));
|
|
24
|
-
}
|
|
25
|
-
catch (e) {
|
|
26
|
-
console.error('Fetch Location States:', e);
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
toJSON() {
|
|
31
|
-
return this.#data;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { MappedinPolygon } from './MappedinPolygon';
|
|
2
|
-
import type { Mappedin } from './Mappedin';
|
|
3
|
-
import type { TGeoReference } from './Mappedin.API.types';
|
|
4
|
-
import type { MappedinMapGroup } from './MappedinMapGroup';
|
|
5
|
-
import { MappedinCoordinate } from './MappedinCoordinate';
|
|
6
|
-
/**
|
|
7
|
-
* A {@link MappedinMap} belonging to a specific {@link MappedinVenue}. Typically represents a certain floor. Give this to a {@link MiMapView} to display to the user.
|
|
8
|
-
*
|
|
9
|
-
* A Map can have more properties such as 'elevation', 'name' (e.g. Level 1), and 'shortName' (e.g. L1). The elevation property can be used to determine the order of the floors (first, second, etc). Elevation is 0 based, going up and down in integers representing the number of floors above or below 0, which is ground level.
|
|
10
|
-
*
|
|
11
|
-
* The {@link Mappedin} 'things' object is where you would specify what properties you want to download for Maps. Only specify what you will actually use, to minmimze transfer time. Work with your Mappedin developer relations contact to set up any custom properties you need.
|
|
12
|
-
*
|
|
13
|
-
* See below for an example a 'things' object with available Map properties specified:
|
|
14
|
-
*
|
|
15
|
-
* things: {
|
|
16
|
-
* venue: [],
|
|
17
|
-
* locations: [],
|
|
18
|
-
* categories: [],
|
|
19
|
-
* maps: ['name', 'elevation', 'shortName']
|
|
20
|
-
* }
|
|
21
|
-
*
|
|
22
|
-
* @class MappedinMap
|
|
23
|
-
*/
|
|
24
|
-
export declare class MappedinMap {
|
|
25
|
-
#private;
|
|
26
|
-
id: string;
|
|
27
|
-
group: string;
|
|
28
|
-
name: string;
|
|
29
|
-
shortName: string;
|
|
30
|
-
elevation?: number;
|
|
31
|
-
scale?: number;
|
|
32
|
-
x_scale?: number;
|
|
33
|
-
georeference: TGeoReference[];
|
|
34
|
-
constructor(mappedin: Mappedin, data: any);
|
|
35
|
-
_scale: number;
|
|
36
|
-
/**
|
|
37
|
-
* Polygons on this Map.
|
|
38
|
-
*
|
|
39
|
-
* @property polygons {[MappedinPolygon]}
|
|
40
|
-
*/
|
|
41
|
-
get polygons(): MappedinPolygon[] | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Map Group this map belongs to.
|
|
44
|
-
*
|
|
45
|
-
* @property mapGroup {MappedinMapGroup}
|
|
46
|
-
*/
|
|
47
|
-
get mapGroup(): MappedinMapGroup | null;
|
|
48
|
-
/**
|
|
49
|
-
* Create coordinate using lat/lon
|
|
50
|
-
*
|
|
51
|
-
* @param lat latitude of coordinate
|
|
52
|
-
* @param lon longitude of coordinate
|
|
53
|
-
*/
|
|
54
|
-
createCoordinate(lat: number, lon: number): MappedinCoordinate;
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
* @returns map rotation in degrees from North
|
|
58
|
-
*/
|
|
59
|
-
getNorth(): number;
|
|
60
|
-
static hydrate(maps: any, mappedin: Mappedin): MappedinMap[];
|
|
61
|
-
static fetch(mappedin: Mappedin): Promise<MappedinMap[]>;
|
|
62
|
-
toJSON(): any;
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=MappedinMap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MappedinMap.d.ts","sourceRoot":"","sources":["../../src/MappedinMap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAK1D;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAW;;IAOtB,EAAE,SAAM;IAER,KAAK,SAAM;IAEX,IAAI,SAAM;IAEV,SAAS,SAAM;IAEf,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,MAAM,CAAK;IAEnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,YAAY,EAAE,aAAa,EAAE,CAAM;gBAEvB,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;IASzC,MAAM,SAAK;IAEX;;;;OAIG;IACH,IAAI,QAAQ,IAAI,eAAe,EAAE,GAAG,SAAS,CAgB5C;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,gBAAgB,GAAG,IAAI,CAUtC;IAED;;;;;OAKG;IACH,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,kBAAkB;IAkC9D;;;OAGG;IACH,QAAQ;IA6BR,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,WAAW,EAAE;WAI/C,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAgF9D,MAAM;CAGP"}
|