becomap 1.5.69 → 1.5.71
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 +38 -75
- package/package.json +71 -72
- package/public/README.md +902 -0
- package/public/index.html +1090 -0
- package/webpack.umd.config.js +91 -87
- package/public/index1.html +0 -52
package/lib/index.d.ts
CHANGED
|
@@ -628,6 +628,21 @@ export interface BCRouteController {
|
|
|
628
628
|
* this.showStep(routeStep);
|
|
629
629
|
*/
|
|
630
630
|
showStep(step: BCRouteStep): void;
|
|
631
|
+
/**
|
|
632
|
+
* Shows the route step by its orderIndex.
|
|
633
|
+
* @param orderIndex - The order index of the step to display.
|
|
634
|
+
*/
|
|
635
|
+
showStepByOrderIndex(orderIndex: number): void;
|
|
636
|
+
/**
|
|
637
|
+
* Shows a specific route segment by its orderIndex.
|
|
638
|
+
* @param orderIndex - The order index of the segment to display.
|
|
639
|
+
*/
|
|
640
|
+
showSegmentByOrderIndex(orderIndex: number): void;
|
|
641
|
+
/**
|
|
642
|
+
* Gets the currently stored route segments.
|
|
643
|
+
* @returns Array of BCRouteSegment objects or null if no segments are stored.
|
|
644
|
+
*/
|
|
645
|
+
get segments(): BCRouteSegment[] | null;
|
|
631
646
|
/**
|
|
632
647
|
* Clears the current route from the map by removing the route layer or data from the map view.
|
|
633
648
|
* It relies on the routeController to manage route layers or data.
|
|
@@ -649,6 +664,16 @@ export interface BCRouteOptions {
|
|
|
649
664
|
* @returns An array of BCRouteSegment objects representing each segment of the route, or `null` if a route cannot be generated.
|
|
650
665
|
*/
|
|
651
666
|
export declare function getRoute(start: BCRoutable, goal: BCRoutable, waypoints?: BCRoutable[], routeOptions?: BCRouteOptions): BCRouteSegment[] | null;
|
|
667
|
+
/**
|
|
668
|
+
* Retrieves the route using location IDs for start, goal, and waypoints.
|
|
669
|
+
*
|
|
670
|
+
* @param startId - The starting location's ID.
|
|
671
|
+
* @param goalId - The goal location's ID.
|
|
672
|
+
* @param waypointIds - Optional array of waypoint location IDs.
|
|
673
|
+
* @param routeOptions - Optional routing options.
|
|
674
|
+
* @returns An array of BCRouteSegment objects or null if not found.
|
|
675
|
+
*/
|
|
676
|
+
export declare function getRouteById(startId: string, goalId: string, waypointIds?: string[], routeOptions?: BCRouteOptions): BCRouteSegment[] | null;
|
|
652
677
|
/**
|
|
653
678
|
* Defines the events supported by the BCMapView and their corresponding arguments.
|
|
654
679
|
*/
|
|
@@ -799,52 +824,6 @@ export interface BCHappenings {
|
|
|
799
824
|
*/
|
|
800
825
|
customFields: Record<string, any>;
|
|
801
826
|
}
|
|
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
827
|
/**
|
|
849
828
|
* Constructs a new MapView instance.
|
|
850
829
|
*
|
|
@@ -901,6 +880,17 @@ export interface BCMapViewOptions {
|
|
|
901
880
|
* rendered or when the map is loading.
|
|
902
881
|
*/
|
|
903
882
|
background?: string;
|
|
883
|
+
/**
|
|
884
|
+
* Optional bounds for the map view, as [minLng, minLat, maxLng, maxLat].
|
|
885
|
+
* minLng: southwest longitude, minLat: southwest latitude,
|
|
886
|
+
* maxLng: northeast longitude, maxLat: northeast latitude
|
|
887
|
+
*/
|
|
888
|
+
bounds?: [
|
|
889
|
+
number,
|
|
890
|
+
number,
|
|
891
|
+
number,
|
|
892
|
+
number
|
|
893
|
+
];
|
|
904
894
|
}
|
|
905
895
|
/**
|
|
906
896
|
* Interface representing the public API of the BCMapView class.
|
|
@@ -954,6 +944,7 @@ export interface BCMapView {
|
|
|
954
944
|
* @param floor - The floor to be selected.
|
|
955
945
|
*/
|
|
956
946
|
selectFloor(floor: BCMapFloor): void;
|
|
947
|
+
selectFloorWithId(floorId: string): void;
|
|
957
948
|
/**
|
|
958
949
|
* Retrieves the currently selected floor.
|
|
959
950
|
* @returns The currently selected floor.
|
|
@@ -991,29 +982,13 @@ export interface BCMapView {
|
|
|
991
982
|
* @param location - The location to select.
|
|
992
983
|
*/
|
|
993
984
|
selectLocation(location: BCLocation): void;
|
|
985
|
+
selectLocationWithId(locationId: string): void;
|
|
994
986
|
/**
|
|
995
987
|
* Retrieves all available happenings of a specific type.
|
|
996
988
|
* @param type - The type of happenings to retrieve.
|
|
997
989
|
* @returns An array of happenings.
|
|
998
990
|
*/
|
|
999
991
|
getHappenings(type: BCHappeningType): BCHappenings[];
|
|
1000
|
-
/**
|
|
1001
|
-
* Retrieves the session ID for the current map view.
|
|
1002
|
-
* @returns A promise that resolves to the session ID.
|
|
1003
|
-
*/
|
|
1004
|
-
getSessionId(): Promise<string>;
|
|
1005
|
-
/**
|
|
1006
|
-
* Retrieves event suggestions based on user answers.
|
|
1007
|
-
* @param sessionId - The session ID.
|
|
1008
|
-
* @param answers - The user's answers.
|
|
1009
|
-
* @returns A promise that resolves to a list of event IDs.
|
|
1010
|
-
*/
|
|
1011
|
-
getEventSuggestions(sessionId: string, answers: BCAnswer[]): Promise<string[]>;
|
|
1012
|
-
/**
|
|
1013
|
-
* Retrieves all available questions.
|
|
1014
|
-
* @returns An array of questions.
|
|
1015
|
-
*/
|
|
1016
|
-
getQuestions(): BCQuestion[];
|
|
1017
992
|
/**
|
|
1018
993
|
* Retrieves all available amenities.
|
|
1019
994
|
* @returns An array of amenities.
|
|
@@ -1033,18 +1008,6 @@ export interface BCMapView {
|
|
|
1033
1008
|
* Clears all current selections on the map.
|
|
1034
1009
|
*/
|
|
1035
1010
|
clearSelection(): void;
|
|
1036
|
-
/**
|
|
1037
|
-
* Sets the map bounds to the specified southwest and northeast coordinates.
|
|
1038
|
-
* @param sw - The southwest coordinates.
|
|
1039
|
-
* @param ne - The northeast coordinates.
|
|
1040
|
-
*/
|
|
1041
|
-
setBounds(sw: [
|
|
1042
|
-
number,
|
|
1043
|
-
number
|
|
1044
|
-
], ne: [
|
|
1045
|
-
number,
|
|
1046
|
-
number
|
|
1047
|
-
]): void;
|
|
1048
1011
|
/**
|
|
1049
1012
|
* Resets the default viewport with the provided options.
|
|
1050
1013
|
* @param newOptions - Partial options to update the viewport.
|
package/package.json
CHANGED
|
@@ -1,72 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "becomap",
|
|
3
|
-
"version": "1.5.
|
|
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
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"@babel/
|
|
25
|
-
"@babel/preset-
|
|
26
|
-
"@
|
|
27
|
-
"@types/
|
|
28
|
-
"@types/
|
|
29
|
-
"@types/
|
|
30
|
-
"@types/
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"dotenv": "^
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"ts-
|
|
48
|
-
"ts-
|
|
49
|
-
"
|
|
50
|
-
"tslint": "^
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"webpack": "^5.
|
|
54
|
-
"webpack-
|
|
55
|
-
"webpack-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"@
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"three": "^0.
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "becomap",
|
|
3
|
+
"version": "1.5.71",
|
|
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
|
+
"html-webpack-plugin": "^5.6.3",
|
|
62
|
+
"maplibre-gl": "^4.4.1",
|
|
63
|
+
"polished": "^4.3.1",
|
|
64
|
+
"polylabel": "^2.0.1",
|
|
65
|
+
"protobufjs": "^7.4.0",
|
|
66
|
+
"rbush": "^4.0.1",
|
|
67
|
+
"three": "^0.172.0",
|
|
68
|
+
"troika-three-text": "^0.52.3",
|
|
69
|
+
"word-wrap": "^1.2.5"
|
|
70
|
+
}
|
|
71
|
+
}
|