@mapxus/mapxus-map-jp 7.4.0 → 7.5.0

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.
Files changed (4) hide show
  1. package/README.md +5 -2
  2. package/index.d.ts +358 -178
  3. package/index.js +1 -1
  4. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -58,7 +58,7 @@ export interface IMapOption {
58
58
  */
59
59
  poiId?: string;
60
60
  hiddenOutdoor?: boolean;
61
- theme?: ThemeType;
61
+ theme?: ThemeType | string;
62
62
  collapseCopyright?: boolean;
63
63
  selectedBuildingBorderStyle?: ISelectedBuildingBorderStyle;
64
64
  floorsControlStyle?: IFloorsControlStyle;
@@ -551,6 +551,18 @@ export declare class Map extends Evented {
551
551
  private _updatePermission;
552
552
  }
553
553
  export type TAnchorPosition = "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
554
+ export interface IMarkerOptions {
555
+ lngLat: [
556
+ number,
557
+ number
558
+ ];
559
+ properties?: {
560
+ [k: string]: string;
561
+ };
562
+ }
563
+ export interface IMarkerOptionsWithFeatureId extends IMarkerOptions {
564
+ featureId: number;
565
+ }
554
566
  export declare class Marker {
555
567
  private readonly _maplibreMap;
556
568
  private readonly _layerId;
@@ -560,19 +572,11 @@ export declare class Marker {
560
572
  private _iconAnchor;
561
573
  constructor(maplibreMap: MaplibreMap);
562
574
  /**
563
- * @description Set marker by sprite name.
564
- * This method must be called after map style loaded if you set an external URL.
565
- * @param icon Sprite name in map style or the image url, png format.
566
- * @param callback Called when the image(from an external URL) has loaded
567
- * or with an error argument if there is an error.
568
- */
569
- setIconImage(icon: string, callback?: VoidFunction): void;
570
- /**
571
- * @description Set marker by image url.
572
- * @deprecated Use 'setIconImage' instead.
573
- * @param imageUrl Network url, png format.
575
+ * @description Set custom marker image.
576
+ * @param icon Sprite name in map style or the URL of the image file.
577
+ * Image file must be in png, webp, or jpg format.
574
578
  */
575
- setIconImageUrl(imageUrl: string): void;
579
+ setIcon(icon: string): Promise<void>;
576
580
  /**
577
581
  * @description Set marker image size.
578
582
  * @param imageScale Default is 1.
@@ -592,30 +596,45 @@ export declare class Marker {
592
596
  */
593
597
  get sourceId(): string;
594
598
  /**
595
- * @description Create marker[s] source and layer.
596
- * @param array Coordinate and properties arrays of marker[s].
599
+ * @description Draw marker[s] on map.
600
+ * @param array {IMarkerOptions | IMarkerOptionsWithFeatureId[]} Coordinate and properties arrays of marker[s].
601
+ * If you need to use updateData(), the parameter must be IMarkerOptionsWithFeatureId[].
597
602
  */
598
- create(array: Array<{
599
- lngLat: [
600
- number,
601
- number
602
- ];
603
- properties?: {
604
- [k: string]: string;
605
- };
606
- }>): void;
603
+ create(array: Array<IMarkerOptions | IMarkerOptionsWithFeatureId>): void;
604
+ /**
605
+ * @description Add, delete or update features of this marker layer.
606
+ * This approach requires unique IDs for every feature in the source!!! Including create() parameters.
607
+ * @param diff {remove: number[], add: IMarkerOptionsWithFeatureId[], update: IMarkerOptionsWithFeatureId[]}
608
+ * remove: Array of feature IDs to remove.
609
+ * add: Array of new features to add.
610
+ * update: Array of features to update, the new properties will replace the old ones.
611
+ */
612
+ updateData(diff: {
613
+ remove?: number[];
614
+ add?: IMarkerOptionsWithFeatureId[];
615
+ update?: IMarkerOptionsWithFeatureId[];
616
+ }): void;
607
617
  /**
608
618
  * @description Remove marker[s] layer and source.
609
619
  */
610
620
  remove(): void;
611
621
  /**
612
622
  * @description Add marker event listener.
623
+ * @deprecated Use 'on' method instead.
613
624
  * @param eventKey
614
625
  * @param callback
615
626
  */
616
627
  onEventListener(eventKey: keyof MapLayerEventType, callback: (marker: MapGeoJSONFeature) => void): {
617
628
  offEventListener: VoidFunction;
618
629
  };
630
+ /**
631
+ * @description Add marker event listener.
632
+ * @param eventKey
633
+ * @param callback
634
+ */
635
+ on(eventKey: keyof MapLayerEventType, callback: (marker: MapGeoJSONFeature) => void): {
636
+ off: () => MaplibreMap;
637
+ };
619
638
  /**
620
639
  * @description Filter marker by custom properties.
621
640
  * @param filterExpression A expression specifying conditions on source features.
@@ -768,95 +787,108 @@ export declare class BuildingFilterControl implements IControl {
768
787
  private _$showLayout;
769
788
  private _$hideLayout;
770
789
  }
771
- export interface IResponse<T> {
772
- code: number;
773
- message: string;
774
- result: T;
775
- }
776
- export type IPresetLanguage = "en" | "zh-Hans" | "zh-Hant" | "ja" | "ko";
777
- export interface IMultiLangName extends Partial<Record<IPresetLanguage, string>> {
790
+ export type TPresetLanguage = "en" | "zh-Hans" | "zh-Hant" | "ja" | "ko";
791
+ export interface IMultilingualName extends Partial<Record<TPresetLanguage, string>> {
778
792
  default: string;
779
793
  }
780
- export type IMultiLangAddress = Record<keyof IMultiLangName, {
794
+ export type IMultilingualAddress = Record<keyof IMultilingualName, {
781
795
  housenumber: string;
782
796
  street: string;
783
797
  }>;
798
+ export interface ILocation {
799
+ lat: number;
800
+ lon: number;
801
+ }
784
802
  export interface IBbox {
785
803
  maxLat: number;
786
804
  maxLon: number;
787
805
  minLat: number;
788
806
  minLon: number;
789
807
  }
790
- export interface ILabelCenter {
791
- lat: number;
792
- lon: number;
808
+ export interface IResponse<T> {
809
+ code: number;
810
+ message: string;
811
+ result: T;
793
812
  }
794
- export interface IBuildingFloor {
795
- id: string;
813
+ export interface IBuildingInlineFloor {
796
814
  code: string;
815
+ id: string;
797
816
  ordinal: number;
798
- visualMap: boolean;
799
817
  signalMap: boolean;
818
+ visualMap: boolean;
800
819
  }
801
820
  export interface IBuilding {
802
- address: IMultiLangAddress;
821
+ address: IMultilingualAddress;
803
822
  bbox: IBbox;
804
823
  buildingId: string;
805
824
  buildingOutlineId: number;
806
825
  city?: string;
807
826
  country: string;
808
- floors: IBuildingFloor[];
827
+ defaultFloor?: string;
828
+ floors: IBuildingInlineFloor[];
809
829
  groundFloor: string;
810
830
  isPrivate: "yes" | "no";
811
- labelCenter: ILabelCenter;
812
- name: IMultiLangName;
831
+ labelCenter: ILocation;
832
+ name: IMultilingualName;
813
833
  organization: string;
814
834
  region: string;
815
835
  signalMap: boolean;
816
836
  type: string;
817
837
  venueId: string;
818
- venueName: IMultiLangName;
819
- defaultFloor?: string;
838
+ venueName: IMultilingualName;
839
+ visualMap: boolean;
820
840
  }
821
- export interface IEntityPoint {
822
- type: string;
823
- coordinates: [
824
- number,
825
- number
826
- ];
841
+ export interface IResponseBuildings {
842
+ buildings: IBuilding[];
843
+ total: number;
827
844
  }
845
+ export type TPromiseBuildings = AxiosPromise<IResponse<IResponseBuildings>>;
828
846
  export interface IVenueInlineBuilding {
829
- id: string;
830
- name: IMultiLangName;
831
847
  buildingOutlineId: number;
832
- point: IEntityPoint;
833
- floors: IBuildingFloor[];
834
- visualMap: boolean;
848
+ defaultFloor?: string;
849
+ floors: IBuildingInlineFloor[];
850
+ id: string;
851
+ labelCenter: ILocation;
852
+ name: IMultilingualName;
853
+ point: {
854
+ type: string;
855
+ coordinates: [
856
+ number,
857
+ number
858
+ ];
859
+ };
835
860
  signalMap: boolean;
861
+ visualMap: boolean;
836
862
  }
837
863
  export interface IVenue {
838
- id: string;
839
- name: IMultiLangName;
840
- address: IMultiLangAddress;
841
- type: string;
842
- venueOutlineId: number;
864
+ address: IMultilingualAddress;
843
865
  bbox: IBbox;
844
- labelCenter: ILabelCenter;
845
- point: IEntityPoint;
866
+ buildings: IVenueInlineBuilding[];
867
+ businessStatus?: {
868
+ status: string;
869
+ };
870
+ country: string;
871
+ defaultBuilding?: string;
872
+ id: string;
873
+ labelCenter: ILocation;
874
+ name: IMultilingualName;
846
875
  organization: string[];
847
- restricted: boolean;
848
876
  owner: string;
849
- country: string;
877
+ publicData?: string[];
878
+ photos?: object[];
850
879
  region: string;
851
- buildings: IVenueInlineBuilding[];
852
- visualMap: boolean;
880
+ restricted: boolean;
853
881
  signalMap: boolean;
854
- defaultBuilding?: string;
882
+ totalPhotoCount?: number;
883
+ type: string;
884
+ venueOutlineId: number;
885
+ visualMap: boolean;
855
886
  }
856
887
  export interface IResponseVenues {
857
888
  venues: IVenue[];
858
889
  total: number;
859
890
  }
891
+ export type TPromiseVenues = AxiosPromise<IResponse<IResponseVenues>>;
860
892
  export declare class VenuesService {
861
893
  private _api;
862
894
  private _request;
@@ -865,7 +897,7 @@ export declare class VenuesService {
865
897
  * @description Search venues by ids.
866
898
  * @param ids The number of IDs cannot exceed 10.
867
899
  */
868
- searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponseVenues>>;
900
+ searchByIds(ids: string | string[]): TPromiseVenues;
869
901
  /**
870
902
  * @description Search venues by center and distance.
871
903
  * @param keywords
@@ -877,7 +909,7 @@ export declare class VenuesService {
877
909
  searchByDistance(keywords: string, center: [
878
910
  number,
879
911
  number
880
- ], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponseVenues>>;
912
+ ], distance: number, offset?: number, page?: number): TPromiseVenues;
881
913
  /**
882
914
  * @description Search venues in specified bbox.
883
915
  * @param keywords
@@ -890,20 +922,16 @@ export declare class VenuesService {
890
922
  number,
891
923
  number,
892
924
  number
893
- ], offset?: number, page?: number): AxiosPromise<IResponse<IResponseVenues>>;
925
+ ], offset?: number, page?: number): TPromiseVenues;
894
926
  /**
895
927
  * @description Search venues by global.
896
928
  * @param keywords
897
929
  * @param offset The maximum value is 100, default is 10.
898
930
  * @param page Default is 1.
899
931
  */
900
- searchByGlobal(keywords: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponseVenues>>;
932
+ searchByGlobal(keywords: string, offset?: number, page?: number): TPromiseVenues;
901
933
  private _changedRes;
902
934
  }
903
- export interface IResponseBuildings {
904
- buildings: IBuilding[];
905
- total: number;
906
- }
907
935
  export declare class BuildingsService {
908
936
  private _api;
909
937
  private _request;
@@ -912,7 +940,7 @@ export declare class BuildingsService {
912
940
  * @description Search buildings by id[s].
913
941
  * @param ids Single id string or id string array. The number of IDs cannot exceed 10.
914
942
  */
915
- searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponseBuildings>>;
943
+ searchByIds(ids: string | string[]): TPromiseBuildings;
916
944
  /**
917
945
  * @description Search buildings by center and distance.
918
946
  * @param keywords
@@ -921,7 +949,7 @@ export declare class BuildingsService {
921
949
  * @param offset The maximum value is 100, default is 10.
922
950
  * @param page Default is 1.
923
951
  */
924
- searchByDistance(keywords: string, center: number[], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
952
+ searchByDistance(keywords: string, center: number[], distance: number, offset?: number, page?: number): TPromiseBuildings;
925
953
  /**
926
954
  * @description Search buildings in specified bbox.
927
955
  * @param keywords
@@ -929,34 +957,31 @@ export declare class BuildingsService {
929
957
  * @param offset The maximum value is 100, default is 10.
930
958
  * @param page Default is 1.
931
959
  */
932
- searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
960
+ searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): TPromiseBuildings;
933
961
  /**
934
962
  * @description Search buildings global.
935
963
  * @param keywords
936
964
  * @param offset The maximum value is 100, default is 10.
937
965
  * @param page Default is 1.
938
966
  */
939
- searchByGlobal(keywords: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
967
+ searchByGlobal(keywords: string, offset?: number, page?: number): TPromiseBuildings;
940
968
  /**
941
969
  * @description Search building by floor id.
942
970
  * @param floorId
943
971
  */
944
- searchByFloorId(floorId: string): AxiosPromise<IResponse<IResponseBuildings>>;
972
+ searchByFloorId(floorId: string): TPromiseBuildings;
945
973
  private _changedRes;
946
974
  }
947
- export interface ILocation {
948
- lat: number;
949
- lon: number;
950
- }
951
975
  export interface IPoi {
952
976
  accessibilityDetail: object;
953
977
  buildingId: string;
954
978
  category: string[];
979
+ distance: number;
955
980
  floor: string;
956
981
  floorId: string;
957
982
  id: string;
958
983
  location: ILocation;
959
- name: IMultiLangName;
984
+ name: IMultilingualName;
960
985
  osmRefId: number;
961
986
  poiId: string;
962
987
  venueId: string;
@@ -970,6 +995,9 @@ export interface IResponsePois {
970
995
  pois: IPoi[];
971
996
  total: number;
972
997
  }
998
+ export type TPromisePois = AxiosPromise<IResponse<IResponsePois>>;
999
+ export type TPromiseCategories = AxiosPromise<IResponse<IPoiCategory[]>>;
1000
+ export type TPromiseOrientationPois = AxiosPromise<IResponse<IOrientationPoi[]>>;
973
1001
  export declare enum DistanceSearchType {
974
1002
  POINT = "Point",
975
1003
  POLYGON = "Polygon",
@@ -977,9 +1005,9 @@ export declare enum DistanceSearchType {
977
1005
  }
978
1006
  export interface IPoiCategory {
979
1007
  category: string;
980
- description: string;
1008
+ description: string | null;
981
1009
  id: string;
982
- title: Partial<Record<keyof IMultiLangName, string>>;
1010
+ title: Partial<Record<keyof IMultilingualName, string>>;
983
1011
  }
984
1012
  export interface IOrientationPoi {
985
1013
  angle: number;
@@ -991,9 +1019,148 @@ export interface IOrientationPoi {
991
1019
  floorId: string;
992
1020
  id: string;
993
1021
  location: ILocation;
994
- name: IMultiLangName;
1022
+ name: IMultilingualName;
995
1023
  osmRefId: number;
996
1024
  poiId: string;
1025
+ description?: string;
1026
+ email?: string;
1027
+ openingHours?: string;
1028
+ phone?: string;
1029
+ website?: string;
1030
+ }
1031
+ export interface ISearchDistance {
1032
+ /**
1033
+ * The center of searching range, [lng, lat].
1034
+ */
1035
+ center: [
1036
+ number,
1037
+ number
1038
+ ];
1039
+ /**
1040
+ * Radius from center, unit is meter, cannot exceed 10,000.
1041
+ */
1042
+ distance: number;
1043
+ /**
1044
+ * The maximum value is 100, default is 10.
1045
+ */
1046
+ offset?: number;
1047
+ /**
1048
+ * Results for specified page number. Default is 1.
1049
+ */
1050
+ page?: number;
1051
+ }
1052
+ export interface IPoiSearchByCategoryOptions extends ISearchDistance {
1053
+ category: string;
1054
+ }
1055
+ export interface IPoiSearchByExcludedCategoriesOptions extends ISearchDistance {
1056
+ excludedCategories: string | string[];
1057
+ }
1058
+ export type TPoiSearchByCategoryOptions = IPoiSearchByCategoryOptions | IPoiSearchByExcludedCategoriesOptions;
1059
+ export interface IPoiSearchByDistanceOptions extends ISearchDistance {
1060
+ /**
1061
+ * Keywords of POI name.
1062
+ */
1063
+ keywords?: string;
1064
+ }
1065
+ export interface ISearchOrientation {
1066
+ /**
1067
+ * User's position, [lng, lat].
1068
+ */
1069
+ center: [
1070
+ number,
1071
+ number
1072
+ ];
1073
+ /**
1074
+ * The angle between the user's orientation and true north.
1075
+ */
1076
+ angle: number;
1077
+ /**
1078
+ * The radius with 'center' as the center of the circle.
1079
+ */
1080
+ distance: number;
1081
+ /**
1082
+ * The type of POI, default is 'Point'.
1083
+ */
1084
+ distanceSearchType?: DistanceSearchType;
1085
+ }
1086
+ export interface IPoiSearchByOrientationAndBuildingOptions extends ISearchOrientation {
1087
+ buildingId: string;
1088
+ }
1089
+ export interface IPoiSearchByOrientationAndFloorOptions extends ISearchOrientation {
1090
+ floorId: string;
1091
+ }
1092
+ export interface IPoiSearchByOrientationAndOrdinalOptions extends ISearchOrientation {
1093
+ ordinal: string;
1094
+ }
1095
+ export type TPoiSearchByOrientationOptions = IPoiSearchByOrientationAndBuildingOptions | IPoiSearchByOrientationAndFloorOptions | IPoiSearchByOrientationAndOrdinalOptions;
1096
+ export interface IPoiSearchOrientationOptions {
1097
+ /**
1098
+ * User's current position, [lng, lat].
1099
+ */
1100
+ center: [
1101
+ number,
1102
+ number
1103
+ ];
1104
+ /**
1105
+ * The angle between cellphone's orientation and the north.
1106
+ */
1107
+ angle: number;
1108
+ /**
1109
+ * Radius.
1110
+ */
1111
+ distance: number;
1112
+ buildingId?: string;
1113
+ floorId?: string;
1114
+ /**
1115
+ * Floor order in physical space, e.g. '-1', '0'(ground floor), '1'...
1116
+ */
1117
+ ordinal?: string;
1118
+ /**
1119
+ * Search type.
1120
+ */
1121
+ distanceSearchType?: DistanceSearchType;
1122
+ }
1123
+ export declare enum PoisOrderBy {
1124
+ DEFAULT_NAME = "DefaultName"
1125
+ }
1126
+ export interface ISearchKeywords {
1127
+ keywords?: string;
1128
+ /**
1129
+ * Quantity per page, the maximum is 100, default is 10.
1130
+ */
1131
+ offset?: number;
1132
+ /**
1133
+ * Results for specified page number. Default is 1.
1134
+ */
1135
+ page?: number;
1136
+ }
1137
+ export interface IPoiSearchByBuildingOptions extends ISearchKeywords {
1138
+ buildingId: string;
1139
+ orderBy?: PoisOrderBy;
1140
+ }
1141
+ export interface IPoiSearchByVenueOptions extends ISearchKeywords {
1142
+ venueId: string;
1143
+ orderBy?: PoisOrderBy;
1144
+ }
1145
+ export interface IPoiSearchByFloorOptions extends ISearchKeywords {
1146
+ floorId: string;
1147
+ orderBy?: PoisOrderBy;
1148
+ }
1149
+ export interface IPoiSearchByBoundsOptions extends ISearchKeywords {
1150
+ /**
1151
+ * An array of LngLat coordinates in [sw, ne] order
1152
+ */
1153
+ bounds: [
1154
+ [
1155
+ number,
1156
+ number
1157
+ ],
1158
+ [
1159
+ number,
1160
+ number
1161
+ ]
1162
+ ];
1163
+ orderBy?: PoisOrderBy;
997
1164
  }
998
1165
  export declare class PoisService {
999
1166
  private _api;
@@ -1004,40 +1171,63 @@ export declare class PoisService {
1004
1171
  * @description Search POIs by id[s].
1005
1172
  * @param ids Single id string or id string array. The number of IDs cannot exceed 100.
1006
1173
  */
1007
- searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponsePois>>;
1174
+ searchByIds(ids: string | string[]): TPromisePois;
1008
1175
  /**
1009
1176
  * @description Search POIs by radius distance of the center point.
1010
- * @param category
1011
- * @param center
1012
- * @param distance Radius from center, unit is meter, cannot exceed 10,000.
1013
- * @param offset The maximum value is 100, default is 10.
1014
- * @param page Default is 1.
1177
+ * @param options {IPoiSearchByDistanceOptions}
1015
1178
  */
1016
- searchByDistance(category: string, center: number[], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
1179
+ searchByDistance(options: IPoiSearchByDistanceOptions): TPromisePois;
1017
1180
  /**
1018
1181
  * @description Search POIs in a bbox.
1182
+ * @deprecated Use searchByBounds instead.
1019
1183
  * @param keywords
1020
1184
  * @param bbox Rectangular area, [minLon, minLat, maxLon, maxLat].
1021
1185
  * @param offset The maximum value is 100, default is 10.
1022
1186
  * @param page Default is 1.
1023
1187
  */
1024
- searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
1188
+ searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): TPromisePois;
1189
+ /**
1190
+ * @description Search POIs in a rectangular area.
1191
+ * @param options {IPoiSearchByBoundsOptions}
1192
+ * 'orderBy' cannot be used with 'keywords'.
1193
+ */
1194
+ searchByBounds(options: IPoiSearchByBoundsOptions): TPromisePois;
1025
1195
  /**
1026
1196
  * @description Search POIs of a building.
1197
+ * @deprecated Use searchByBuilding instead.
1027
1198
  * @param keywords
1028
1199
  * @param buildingId
1029
1200
  * @param offset The maximum value is 100, default is 10.
1030
1201
  * @param page Default is 1.
1031
1202
  */
1032
- searchByBuildingId(keywords: string, buildingId: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
1203
+ searchByBuildingId(keywords: string, buildingId: string, offset?: number, page?: number): TPromisePois;
1204
+ /**
1205
+ * @description Search POIs of a building.
1206
+ * @param options {IPoiSearchByBuildingOptions}
1207
+ * 'orderBy' cannot be used with 'keywords'.
1208
+ */
1209
+ searchByBuilding(options: IPoiSearchByBuildingOptions): TPromisePois;
1033
1210
  /**
1034
1211
  * @description Search POIs of a venue.
1212
+ * @deprecated Use searchByVenue instead.
1035
1213
  * @param keywords
1036
1214
  * @param venueId
1037
1215
  * @param offset
1038
1216
  * @param page
1039
1217
  */
1040
- searchByVenueId(keywords: string, venueId: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
1218
+ searchByVenueId(keywords: string, venueId: string, offset?: number, page?: number): TPromisePois;
1219
+ /**
1220
+ * @description Search POIs of a venue.
1221
+ * @param options {IPoiSearchByVenueOptions}
1222
+ * 'orderBy' cannot be used with 'keywords'.
1223
+ */
1224
+ searchByVenue(options: IPoiSearchByVenueOptions): TPromisePois;
1225
+ /**
1226
+ * @description Search POIs of a floor.
1227
+ * @param options {IPoiSearchByFloorOptions}
1228
+ * 'orderBy' cannot be used with 'keywords'.
1229
+ */
1230
+ searchByFloor(options: IPoiSearchByFloorOptions): TPromisePois;
1041
1231
  /**
1042
1232
  * @description Search poi categories by venue id, building id, or floor id.
1043
1233
  * Search scope priority: floorId > buildingId > venueId.
@@ -1047,44 +1237,31 @@ export declare class PoisService {
1047
1237
  venueId?: string;
1048
1238
  buildingId?: string;
1049
1239
  floorId?: string;
1050
- }): AxiosPromise<IResponse<IPoiCategory[]>>;
1240
+ }): TPromiseCategories;
1051
1241
  /**
1052
- * @description Search orientation and poi.
1242
+ * @description Search surrounding POIs based on the user's location and orientation.
1053
1243
  * BuildingId, floorId and ordinal are mutually exclusive, priority: ordinal > floorId > buildingId.
1054
- * @param paramObj
1244
+ * @deprecated Use searchByOrientation instead.
1245
+ * @param options
1055
1246
  */
1056
- searchOrientation(paramObj: {
1057
- /**
1058
- * User's current position, [lon, lat].
1059
- */
1060
- center: [
1061
- number,
1062
- number
1063
- ];
1064
- /**
1065
- * The angle between cellphone's orientation and the north.
1066
- */
1067
- angle: number;
1068
- /**
1069
- * Radius.
1070
- */
1071
- distance: number;
1072
- buildingId?: string;
1073
- floorId?: string;
1074
- /**
1075
- * Floor order in physical space, e.g. '-1', '0'(ground floor), '1'...
1076
- */
1077
- ordinal?: string;
1078
- /**
1079
- * Search type.
1080
- */
1081
- distanceSearchType?: DistanceSearchType;
1082
- }): AxiosPromise<IResponse<IOrientationPoi[]>>;
1247
+ searchOrientation(options: IPoiSearchOrientationOptions): TPromiseOrientationPois;
1248
+ /**
1249
+ * @description Search surrounding POIs based on the user's location and orientation.
1250
+ * @param options {TPoiSearchByOrientationOptions}
1251
+ */
1252
+ searchByOrientation(options: TPoiSearchByOrientationOptions): TPromiseOrientationPois;
1253
+ /**
1254
+ * @description Search POIs by category or excluded categories.
1255
+ * @param options {TPoiSearchByCategoryOptions}
1256
+ */
1257
+ searchByCategory(options: TPoiSearchByCategoryOptions): TPromisePois;
1083
1258
  private _changedRes;
1084
1259
  }
1085
- export interface IResponseRoute {
1086
- infos: IRouteInfo | null;
1087
- paths: IRoutePath[];
1260
+ export declare enum VehicleType {
1261
+ FOOT = "foot",
1262
+ WHEELCHAIR = "wheelchair",
1263
+ ESCALATOR = "escalator",
1264
+ EMERGENCY = "emergency"
1088
1265
  }
1089
1266
  export interface IRouteInfo {
1090
1267
  copyrights: string[];
@@ -1132,60 +1309,67 @@ export interface IRoutePath {
1132
1309
  };
1133
1310
  time: number;
1134
1311
  }
1135
- export declare enum WayFindingVehicleType {
1136
- FOOT = "foot",
1137
- WHEELCHAIR = "wheelchair",
1138
- ESCALATOR = "escalator"
1312
+ export interface IResponseRoute {
1313
+ infos: IRouteInfo | null;
1314
+ paths: IRoutePath[];
1315
+ }
1316
+ export type TPromiseRoute = AxiosPromise<IResponse<IResponseRoute>>;
1317
+ export interface IRouteSearchOptions {
1318
+ /**
1319
+ * @description Points are in order, from -> stops -> to.
1320
+ * The length of points must be: 1 < {points.length} < 6.
1321
+ */
1322
+ points: Array<{
1323
+ lat: number;
1324
+ lon: number;
1325
+ buildingId?: string;
1326
+ floorId?: string;
1327
+ }>;
1328
+ /**
1329
+ * @description Default is "foot".
1330
+ */
1331
+ vehicle?: VehicleType;
1332
+ /**
1333
+ * @description Language-specific response. Default is "en".
1334
+ */
1335
+ locale?: TPresetLanguage;
1336
+ /**
1337
+ * @description Whether the end point of the route is at the door(otherwise in the room), default is "true".
1338
+ * @deprecated
1339
+ */
1340
+ toDoor?: boolean;
1139
1341
  }
1140
1342
  export declare class RouteService {
1141
1343
  private _api;
1142
1344
  private _request;
1143
1345
  constructor();
1144
1346
  /**
1145
- * @description Search the route of any two points.
1146
- * @param fromCoordinate Coordinate [lng, lat] of start point.
1147
- * @param toCoordinate Coordinate [lng, lat] of end point.
1148
- * @param fromFloorId {string | null}
1149
- * @param toFloorId {string | null}
1150
- * @param fromBuildingId {string | null}
1151
- * @param toBuildingId {string | null}
1152
- * @param vehicle
1153
- * @param locale Language-specific response.
1154
- * @param toDoor Whether the end point of the route is in the room(otherwise at the door), default is "true".
1155
- */
1156
- search(fromCoordinate: [
1157
- number,
1158
- number
1159
- ], toCoordinate: [
1160
- number,
1161
- number
1162
- ], fromFloorId: string | null, toFloorId: string | null, fromBuildingId: string | null, toBuildingId: string | null, vehicle?: WayFindingVehicleType, locale?: string, toDoor?: boolean): AxiosPromise<IResponse<IResponseRoute>>;
1347
+ * @description Search the route of two or more points.
1348
+ * @param options {IRouteSearchOptions}
1349
+ */
1350
+ search(options: IRouteSearchOptions): TPromiseRoute;
1163
1351
  }
1164
1352
  export declare class RoutePainter {
1165
1353
  private readonly _maplibreMap;
1166
- private _fromCoordinate;
1167
- private _toCoordinate;
1168
1354
  private _fromMarkerIcon;
1169
1355
  private _toMarkerIcon;
1356
+ private _stopMarkerIcons;
1170
1357
  private _markerIconSize;
1171
1358
  private _paintProperties;
1172
1359
  constructor(maplibreMap: MaplibreMap);
1173
1360
  /**
1174
- * @description Set image of the start marker. This method must be called after map style loaded.
1175
- * This method must be called after map style loaded if you set an external URL.
1176
- * @param icon Sprite name in map style or the image url, png format.
1177
- * @param callback Called when the image(from an external URL) has loaded
1178
- * or with an error argument if there is an error.
1179
- */
1180
- setFromMarkerIcon(icon: string, callback?: VoidFunction): void;
1181
- /**
1182
- * @description Set image of the end marker. This method must be called after map style loaded.
1183
- * This method must be called after map style loaded if you set an external URL.
1184
- * @param icon Sprite name in map style or the image url, png format.
1185
- * @param callback Called when the image(from an external URL) has loaded
1186
- * or with an error argument if there is an error.
1361
+ * @description Set image[s] of the stop marker[s].
1362
+ * @param icons Array of sprite names or URLs, or the object with specifying icon.
1363
+ * Markers use images in order of icons array.
1364
+ * First is as from-marker, last is as to-marker, the middles are as stop-markers.
1365
+ * If icons array has only one element, all stop markers use this image.
1366
+ * Image file must be in png, webp, or jpg format.
1187
1367
  */
1188
- setToMarkerIcon(icon: string, callback?: VoidFunction): void;
1368
+ setMarkerIcons(icons: string[] | {
1369
+ from?: string;
1370
+ to?: string;
1371
+ stops?: string[];
1372
+ }): Promise<void>;
1189
1373
  /**
1190
1374
  * @description Set image icon scale.
1191
1375
  * @param size Default is 1.
@@ -1222,16 +1406,12 @@ export declare class RoutePainter {
1222
1406
  /**
1223
1407
  * @description Render route on the map.
1224
1408
  * @param path Route path from RouteService.search response.
1225
- * @param fromCoordinate Coordinate [lng, lat] of start point.
1226
- * @param toCoordinate Coordinate [lng, lat] of end point.
1409
+ * @param markerLocations Coordinate([lng, lat]) array of markers, order from beginning to end.
1227
1410
  */
1228
- render(path: IRoutePath, fromCoordinate: [
1229
- number,
1230
- number
1231
- ], toCoordinate: [
1411
+ render(path: IRoutePath, markerLocations: Array<[
1232
1412
  number,
1233
1413
  number
1234
- ]): void;
1414
+ ]>): void;
1235
1415
  /**
1236
1416
  * @description Remove route from the map.
1237
1417
  */
@@ -1254,7 +1434,7 @@ export declare class RoutePainter {
1254
1434
  private _renderSolidLines;
1255
1435
  private _renderDashedLines;
1256
1436
  private _renderConnectors;
1257
- private _renderFromToMarkers;
1437
+ private _renderMarkers;
1258
1438
  private _addCollectionSource;
1259
1439
  private _addLineLayer;
1260
1440
  private _addTriangleLayer;
@@ -1263,6 +1443,6 @@ export declare class RoutePainter {
1263
1443
  export declare const OFFSET: number;
1264
1444
  export declare const PAGE: number;
1265
1445
  export declare const version: string;
1266
- export type { ControlPosition, Map as MaplibreMap, MapLayerEventType, FilterSpecification, PointLike, } from "maplibre-gl";
1446
+ export type { ControlPosition, Map as MaplibreMap, MapLayerEventType, FilterSpecification, PointLike, MapGeoJSONFeature, } from "maplibre-gl";
1267
1447
 
1268
1448
  export {};