becomap 1.6.1 → 1.6.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 +15 -15
- package/lib/becomap.js +1 -1
- package/lib/index.d.ts +93 -75
- package/package.json +72 -70
- package/public/README.md +375 -0
- package/public/index.html +1374 -0
- package/webpack.umd.config.js +91 -0
package/lib/index.d.ts
CHANGED
|
@@ -397,6 +397,12 @@ export interface BCLocation {
|
|
|
397
397
|
*/
|
|
398
398
|
get amenity(): BCSiteAmenity;
|
|
399
399
|
/**
|
|
400
|
+
* The area of the location.
|
|
401
|
+
*
|
|
402
|
+
* @returns The area of the location as a string.
|
|
403
|
+
*/
|
|
404
|
+
get area(): string | null;
|
|
405
|
+
/**
|
|
400
406
|
* Stores phone numbers associated with the location, where the key represents the type of phone number.
|
|
401
407
|
*
|
|
402
408
|
* @returns A record of phone numbers keyed by type (e.g., {"main": "123-456-7890"}).
|
|
@@ -628,6 +634,21 @@ export interface BCRouteController {
|
|
|
628
634
|
* this.showStep(routeStep);
|
|
629
635
|
*/
|
|
630
636
|
showStep(step: BCRouteStep): void;
|
|
637
|
+
/**
|
|
638
|
+
* Shows the route step by its orderIndex.
|
|
639
|
+
* @param orderIndex - The order index of the step to display.
|
|
640
|
+
*/
|
|
641
|
+
showStepByOrderIndex(orderIndex: number): void;
|
|
642
|
+
/**
|
|
643
|
+
* Shows a specific route segment by its orderIndex.
|
|
644
|
+
* @param orderIndex - The order index of the segment to display.
|
|
645
|
+
*/
|
|
646
|
+
showSegmentByOrderIndex(orderIndex: number): void;
|
|
647
|
+
/**
|
|
648
|
+
* Gets the currently stored route segments.
|
|
649
|
+
* @returns Array of BCRouteSegment objects or null if no segments are stored.
|
|
650
|
+
*/
|
|
651
|
+
get segments(): BCRouteSegment[] | null;
|
|
631
652
|
/**
|
|
632
653
|
* Clears the current route from the map by removing the route layer or data from the map view.
|
|
633
654
|
* It relies on the routeController to manage route layers or data.
|
|
@@ -649,6 +670,16 @@ export interface BCRouteOptions {
|
|
|
649
670
|
* @returns An array of BCRouteSegment objects representing each segment of the route, or `null` if a route cannot be generated.
|
|
650
671
|
*/
|
|
651
672
|
export declare function getRoute(start: BCRoutable, goal: BCRoutable, waypoints?: BCRoutable[], routeOptions?: BCRouteOptions): BCRouteSegment[] | null;
|
|
673
|
+
/**
|
|
674
|
+
* Retrieves the route using location IDs for start, goal, and waypoints.
|
|
675
|
+
*
|
|
676
|
+
* @param startId - The starting location's ID.
|
|
677
|
+
* @param goalId - The goal location's ID.
|
|
678
|
+
* @param waypointIds - Optional array of waypoint location IDs.
|
|
679
|
+
* @param routeOptions - Optional routing options.
|
|
680
|
+
* @returns An array of BCRouteSegment objects or null if not found.
|
|
681
|
+
*/
|
|
682
|
+
export declare function getRouteById(startId: string, goalId: string, waypointIds?: string[], routeOptions?: BCRouteOptions): BCRouteSegment[] | null;
|
|
652
683
|
/**
|
|
653
684
|
* Defines the events supported by the BCMapView and their corresponding arguments.
|
|
654
685
|
*/
|
|
@@ -799,52 +830,6 @@ export interface BCHappenings {
|
|
|
799
830
|
*/
|
|
800
831
|
customFields: Record<string, any>;
|
|
801
832
|
}
|
|
802
|
-
declare enum BCQuestionType {
|
|
803
|
-
/** Represents a multiple-choice question with a single answer. */
|
|
804
|
-
MCQ_SINGLE_ANSWER = "MCQ_SINGLE_ANSWER",
|
|
805
|
-
/** Represents an open-ended text response. */
|
|
806
|
-
TEXT = "TEXT",
|
|
807
|
-
/** Represents a numerical response. */
|
|
808
|
-
NUMBER = "NUMBER",
|
|
809
|
-
/** Represents a boolean (true/false) response. */
|
|
810
|
-
BOOLEAN = "BOOLEAN"
|
|
811
|
-
}
|
|
812
|
-
/**
|
|
813
|
-
* Interface representing a single survey question.
|
|
814
|
-
*/
|
|
815
|
-
export interface BCQuestion {
|
|
816
|
-
/**
|
|
817
|
-
* Unique identifier for the question.
|
|
818
|
-
*/
|
|
819
|
-
id: string;
|
|
820
|
-
/**
|
|
821
|
-
* The text of the question.
|
|
822
|
-
*/
|
|
823
|
-
question: string;
|
|
824
|
-
/**
|
|
825
|
-
* The type of the question, as defined in BCQuestionType.
|
|
826
|
-
*/
|
|
827
|
-
type: BCQuestionType;
|
|
828
|
-
/**
|
|
829
|
-
* The list of possible options for multiple-choice questions.
|
|
830
|
-
* Should be empty or undefined for non-MCQ question types.
|
|
831
|
-
*/
|
|
832
|
-
options?: string[];
|
|
833
|
-
}
|
|
834
|
-
/**
|
|
835
|
-
* Interface representing an answer to a survey question.
|
|
836
|
-
*/
|
|
837
|
-
export interface BCAnswer {
|
|
838
|
-
/**
|
|
839
|
-
* Unique identifier for the question being answered.
|
|
840
|
-
*/
|
|
841
|
-
questionId: string;
|
|
842
|
-
/**
|
|
843
|
-
* The answers provided by the user.
|
|
844
|
-
* This can be a list to accommodate multiple responses for certain question types.
|
|
845
|
-
*/
|
|
846
|
-
answers: string[];
|
|
847
|
-
}
|
|
848
833
|
/**
|
|
849
834
|
* Constructs a new MapView instance.
|
|
850
835
|
*
|
|
@@ -887,6 +872,31 @@ export interface BCMapViewOptions {
|
|
|
887
872
|
* Default bearing can be defined in the implementation.
|
|
888
873
|
*/
|
|
889
874
|
bearing?: number;
|
|
875
|
+
/**
|
|
876
|
+
* Whether to hide layers outside the defined map boundaries.
|
|
877
|
+
* If set to `true`, layers outside the map's visible area will
|
|
878
|
+
* be hidden. This can improve performance and focus on the
|
|
879
|
+
* relevant map content.
|
|
880
|
+
*/
|
|
881
|
+
hideOutsideLayers?: boolean;
|
|
882
|
+
/**
|
|
883
|
+
* The background color of the map container.
|
|
884
|
+
* This property allows setting a custom background color for
|
|
885
|
+
* the map container, which is visible when no map tiles are
|
|
886
|
+
* rendered or when the map is loading.
|
|
887
|
+
*/
|
|
888
|
+
background?: string;
|
|
889
|
+
/**
|
|
890
|
+
* Optional bounds for the map view, as [minLng, minLat, maxLng, maxLat].
|
|
891
|
+
* minLng: southwest longitude, minLat: southwest latitude,
|
|
892
|
+
* maxLng: northeast longitude, maxLat: northeast latitude
|
|
893
|
+
*/
|
|
894
|
+
bounds?: [
|
|
895
|
+
number,
|
|
896
|
+
number,
|
|
897
|
+
number,
|
|
898
|
+
number
|
|
899
|
+
];
|
|
890
900
|
}
|
|
891
901
|
/**
|
|
892
902
|
* Interface representing the public API of the BCMapView class.
|
|
@@ -940,6 +950,7 @@ export interface BCMapView {
|
|
|
940
950
|
* @param floor - The floor to be selected.
|
|
941
951
|
*/
|
|
942
952
|
selectFloor(floor: BCMapFloor): void;
|
|
953
|
+
selectFloorWithId(floorId: string): void;
|
|
943
954
|
/**
|
|
944
955
|
* Retrieves the currently selected floor.
|
|
945
956
|
* @returns The currently selected floor.
|
|
@@ -960,6 +971,24 @@ export interface BCMapView {
|
|
|
960
971
|
* @returns An array of amenity locations.
|
|
961
972
|
*/
|
|
962
973
|
getAllAminityLocations(): BCLocation[];
|
|
974
|
+
/**
|
|
975
|
+
* Sets the current custom location for the map view.eg: Kiosk Location
|
|
976
|
+
* @param customLocationId - The ID of the custom location to set as current.
|
|
977
|
+
*/
|
|
978
|
+
setCurrentCustomLocation(customLocationId: string): void;
|
|
979
|
+
/**
|
|
980
|
+
* Gets the current custom location ID.
|
|
981
|
+
* @returns The current custom location ID, or null if not set.
|
|
982
|
+
*/
|
|
983
|
+
getCurrentCustomLocationId(): string | null;
|
|
984
|
+
/**
|
|
985
|
+
* Retrieves amenity locations of a specific type, sorted by floor priority and distance from kiosk location.
|
|
986
|
+
* @param amenityType - The type of amenity to retrieve.
|
|
987
|
+
* @param customLocationId - Optional. The ID of the kiosk location to calculate distances from. If not provided, uses the current kiosk location.
|
|
988
|
+
* @param floorId - The preferred floor ID to prioritize in results.
|
|
989
|
+
* @returns An array of sorted amenity locations.
|
|
990
|
+
*/
|
|
991
|
+
getAminityLocations(amenityType: BCSiteAmenity, customLocationId?: string, floorId?: string): BCLocation[];
|
|
963
992
|
/**
|
|
964
993
|
* Searches for locations matching the provided search string.
|
|
965
994
|
* @param searchString - The string to search for.
|
|
@@ -977,29 +1006,18 @@ export interface BCMapView {
|
|
|
977
1006
|
* @param location - The location to select.
|
|
978
1007
|
*/
|
|
979
1008
|
selectLocation(location: BCLocation): void;
|
|
1009
|
+
selectLocationWithId(locationId: string): void;
|
|
1010
|
+
/**
|
|
1011
|
+
* Selects multiple locations on the map.
|
|
1012
|
+
* @param locations - The array of locations to select.
|
|
1013
|
+
*/
|
|
1014
|
+
selectLocations(locations: BCLocation[]): void;
|
|
980
1015
|
/**
|
|
981
1016
|
* Retrieves all available happenings of a specific type.
|
|
982
1017
|
* @param type - The type of happenings to retrieve.
|
|
983
1018
|
* @returns An array of happenings.
|
|
984
1019
|
*/
|
|
985
1020
|
getHappenings(type: BCHappeningType): BCHappenings[];
|
|
986
|
-
/**
|
|
987
|
-
* Retrieves the session ID for the current map view.
|
|
988
|
-
* @returns A promise that resolves to the session ID.
|
|
989
|
-
*/
|
|
990
|
-
getSessionId(): Promise<string>;
|
|
991
|
-
/**
|
|
992
|
-
* Retrieves event suggestions based on user answers.
|
|
993
|
-
* @param sessionId - The session ID.
|
|
994
|
-
* @param answers - The user's answers.
|
|
995
|
-
* @returns A promise that resolves to a list of event IDs.
|
|
996
|
-
*/
|
|
997
|
-
getEventSuggestions(sessionId: string, answers: BCAnswer[]): Promise<string[]>;
|
|
998
|
-
/**
|
|
999
|
-
* Retrieves all available questions.
|
|
1000
|
-
* @returns An array of questions.
|
|
1001
|
-
*/
|
|
1002
|
-
getQuestions(): BCQuestion[];
|
|
1003
1021
|
/**
|
|
1004
1022
|
* Retrieves all available amenities.
|
|
1005
1023
|
* @returns An array of amenities.
|
|
@@ -1019,18 +1037,6 @@ export interface BCMapView {
|
|
|
1019
1037
|
* Clears all current selections on the map.
|
|
1020
1038
|
*/
|
|
1021
1039
|
clearSelection(): void;
|
|
1022
|
-
/**
|
|
1023
|
-
* Sets the map bounds to the specified southwest and northeast coordinates.
|
|
1024
|
-
* @param sw - The southwest coordinates.
|
|
1025
|
-
* @param ne - The northeast coordinates.
|
|
1026
|
-
*/
|
|
1027
|
-
setBounds(sw: [
|
|
1028
|
-
number,
|
|
1029
|
-
number
|
|
1030
|
-
], ne: [
|
|
1031
|
-
number,
|
|
1032
|
-
number
|
|
1033
|
-
]): void;
|
|
1034
1040
|
/**
|
|
1035
1041
|
* Resets the default viewport with the provided options.
|
|
1036
1042
|
* @param newOptions - Partial options to update the viewport.
|
|
@@ -1041,6 +1047,18 @@ export interface BCMapView {
|
|
|
1041
1047
|
* @param newOptions - Partial options to update the viewport.
|
|
1042
1048
|
*/
|
|
1043
1049
|
setViewport(newOptions: Partial<BCMapViewOptions>): void;
|
|
1050
|
+
/**
|
|
1051
|
+
* Submits user feedback to the server.
|
|
1052
|
+
* @param feedbackData - The feedback data containing name, message, siteId, phoneNumber, and rating.
|
|
1053
|
+
* @returns Promise that resolves with the server response.
|
|
1054
|
+
*/
|
|
1055
|
+
submitFeedback(feedbackData: {
|
|
1056
|
+
name: string;
|
|
1057
|
+
message: string;
|
|
1058
|
+
siteId: string;
|
|
1059
|
+
phoneNumber: string;
|
|
1060
|
+
rating: number;
|
|
1061
|
+
}): Promise<any>;
|
|
1044
1062
|
}
|
|
1045
1063
|
/**
|
|
1046
1064
|
* Options for retrieving a specific site.
|
package/package.json
CHANGED
|
@@ -1,70 +1,72 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "becomap",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "we lib to display becomap",
|
|
5
|
-
"main": "lib/becomap.js",
|
|
6
|
-
"module": "lib/becomap.js",
|
|
7
|
-
"types": "lib/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"test": "jest --config jestconfig.json",
|
|
10
|
-
"start": "npm run build && npm run serve && npm run watch",
|
|
11
|
-
"serve": "node scripts/serve.js",
|
|
12
|
-
"build": "cross-env APP_ENV=production node scripts/build.js",
|
|
13
|
-
"watch": "webpack --watch",
|
|
14
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
15
|
-
"lint": "tslint -p tsconfig.json",
|
|
16
|
-
"proto": "./scripts/generate-proto.sh",
|
|
17
|
-
"readproto": "cd ./proto/sample && tsc readbin.ts && node ./readbin.js && cd .. && cd .."
|
|
18
|
-
},
|
|
19
|
-
"keywords": [],
|
|
20
|
-
"author": "",
|
|
21
|
-
"license": "ISC",
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@babel/core": "^7.24.7",
|
|
24
|
-
"@babel/preset-env": "^7.24.7",
|
|
25
|
-
"@babel/preset-typescript": "^7.24.7",
|
|
26
|
-
"@types/jest": "^29.5.12",
|
|
27
|
-
"@types/node": "^20.14.5",
|
|
28
|
-
"@types/rbush": "^4.0.0",
|
|
29
|
-
"@types/three": "^0.172.0",
|
|
30
|
-
"@types/webpack": "^5.28.5",
|
|
31
|
-
"babel-loader": "^9.1.3",
|
|
32
|
-
"cross-env": "^7.0.3",
|
|
33
|
-
"css-loader": "^7.1.2",
|
|
34
|
-
"dotenv": "^16.4.5",
|
|
35
|
-
"dotenv-webpack": "^8.1.0",
|
|
36
|
-
"dts-bundle-generator": "^9.5.1",
|
|
37
|
-
"fs-extra": "^11.2.0",
|
|
38
|
-
"install": "^0.13.0",
|
|
39
|
-
"javascript-obfuscator": "^4.1.1",
|
|
40
|
-
"jest": "^29.7.0",
|
|
41
|
-
"npm": "^10.8.1",
|
|
42
|
-
"prettier": "^3.3.2",
|
|
43
|
-
"rimraf": "^6.0.1",
|
|
44
|
-
"style-loader": "^4.0.0",
|
|
45
|
-
"terser-webpack-plugin": "^5.3.10",
|
|
46
|
-
"ts-jest": "^29.1.5",
|
|
47
|
-
"ts-loader": "^9.5.1",
|
|
48
|
-
"ts-proto": "^2.2.3",
|
|
49
|
-
"tslint": "^6.1.3",
|
|
50
|
-
"tslint-config-prettier": "^1.18.0",
|
|
51
|
-
"typescript": "^5.5.3",
|
|
52
|
-
"webpack": "^5.92.1",
|
|
53
|
-
"webpack-cli": "^5.1.4",
|
|
54
|
-
"webpack-dev-server": "^5.0.4",
|
|
55
|
-
"webpack-obfuscator": "^3.5.1"
|
|
56
|
-
},
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"@turf/turf": "^7.1.0",
|
|
59
|
-
"@types/polylabel": "^1.1.3",
|
|
60
|
-
"axios": "^1.7.5",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "becomap",
|
|
3
|
+
"version": "1.6.8",
|
|
4
|
+
"description": "we lib to display becomap",
|
|
5
|
+
"main": "lib/becomap.js",
|
|
6
|
+
"module": "lib/becomap.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "jest --config jestconfig.json",
|
|
10
|
+
"start": "npm run build && npm run serve && npm run watch",
|
|
11
|
+
"serve": "node scripts/serve.js",
|
|
12
|
+
"build": "cross-env APP_ENV=production node scripts/build.js ",
|
|
13
|
+
"watch": "webpack --watch",
|
|
14
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
15
|
+
"lint": "tslint -p tsconfig.json",
|
|
16
|
+
"proto": "./scripts/generate-proto.sh",
|
|
17
|
+
"readproto": "cd ./proto/sample && tsc readbin.ts && node ./readbin.js && cd .. && cd .."
|
|
18
|
+
},
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@babel/core": "^7.24.7",
|
|
24
|
+
"@babel/preset-env": "^7.24.7",
|
|
25
|
+
"@babel/preset-typescript": "^7.24.7",
|
|
26
|
+
"@types/jest": "^29.5.12",
|
|
27
|
+
"@types/node": "^20.14.5",
|
|
28
|
+
"@types/rbush": "^4.0.0",
|
|
29
|
+
"@types/three": "^0.172.0",
|
|
30
|
+
"@types/webpack": "^5.28.5",
|
|
31
|
+
"babel-loader": "^9.1.3",
|
|
32
|
+
"cross-env": "^7.0.3",
|
|
33
|
+
"css-loader": "^7.1.2",
|
|
34
|
+
"dotenv": "^16.4.5",
|
|
35
|
+
"dotenv-webpack": "^8.1.0",
|
|
36
|
+
"dts-bundle-generator": "^9.5.1",
|
|
37
|
+
"fs-extra": "^11.2.0",
|
|
38
|
+
"install": "^0.13.0",
|
|
39
|
+
"javascript-obfuscator": "^4.1.1",
|
|
40
|
+
"jest": "^29.7.0",
|
|
41
|
+
"npm": "^10.8.1",
|
|
42
|
+
"prettier": "^3.3.2",
|
|
43
|
+
"rimraf": "^6.0.1",
|
|
44
|
+
"style-loader": "^4.0.0",
|
|
45
|
+
"terser-webpack-plugin": "^5.3.10",
|
|
46
|
+
"ts-jest": "^29.1.5",
|
|
47
|
+
"ts-loader": "^9.5.1",
|
|
48
|
+
"ts-proto": "^2.2.3",
|
|
49
|
+
"tslint": "^6.1.3",
|
|
50
|
+
"tslint-config-prettier": "^1.18.0",
|
|
51
|
+
"typescript": "^5.5.3",
|
|
52
|
+
"webpack": "^5.92.1",
|
|
53
|
+
"webpack-cli": "^5.1.4",
|
|
54
|
+
"webpack-dev-server": "^5.0.4",
|
|
55
|
+
"webpack-obfuscator": "^3.5.1"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@turf/turf": "^7.1.0",
|
|
59
|
+
"@types/polylabel": "^1.1.3",
|
|
60
|
+
"axios": "^1.7.5",
|
|
61
|
+
"becomap": "^1.5.72",
|
|
62
|
+
"html-webpack-plugin": "^5.6.3",
|
|
63
|
+
"maplibre-gl": "^4.4.1",
|
|
64
|
+
"polished": "^4.3.1",
|
|
65
|
+
"polylabel": "^2.0.1",
|
|
66
|
+
"protobufjs": "^7.4.0",
|
|
67
|
+
"rbush": "^4.0.1",
|
|
68
|
+
"three": "^0.172.0",
|
|
69
|
+
"troika-three-text": "^0.52.3",
|
|
70
|
+
"word-wrap": "^1.2.5"
|
|
71
|
+
}
|
|
72
|
+
}
|