@mapxus/mapxus-map-jp 7.3.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 +17 -9
  2. package/index.d.ts +389 -185
  3. package/index.js +1 -10
  4. package/package.json +4 -4
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Generated by dts-bundle-generator v6.13.0
1
+ // Generated by dts-bundle-generator v8.1.2
2
2
 
3
3
  import { AxiosPromise } from 'axios';
4
4
  import { ControlPosition, FilterSpecification, IControl, LngLat, Map as MaplibreMap, Map as maplibreMap, MapGeoJSONFeature, MapLayerEventType, PaddingOptions, PointLike, RequireAtLeastOne } from 'maplibre-gl';
@@ -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;
@@ -178,7 +178,17 @@ export declare class Indoor extends Evented {
178
178
  private _dispatch;
179
179
  private readonly _fitBuildingBounds;
180
180
  private readonly _boundsPadding;
181
- constructor(map: maplibreMap, isHiddenOutdoor: boolean, floorSwitchMode: FloorSwitchMode, fitBuildingBounds: boolean, boundsPadding: number | RequireAtLeastOne<PaddingOptions>);
181
+ private readonly _isInitialIndoor;
182
+ private _maplibreMapLoaded;
183
+ private _indoorMapLoaded;
184
+ constructor(props: {
185
+ map: maplibreMap;
186
+ isInitialIndoor: boolean;
187
+ isHiddenOutdoor: boolean;
188
+ floorSwitchMode: FloorSwitchMode;
189
+ fitBuildingBounds: boolean;
190
+ boundsPadding: number | RequireAtLeastOne<PaddingOptions>;
191
+ });
182
192
  /**
183
193
  * @description Turn on indoor-outdoor switching.
184
194
  */
@@ -288,7 +298,7 @@ export declare class Indoor extends Evented {
288
298
  private _getConditionsExpression;
289
299
  private _loadData;
290
300
  private _init;
291
- private _load;
301
+ private _filter;
292
302
  private _clear;
293
303
  private _updateFilter;
294
304
  private _setPoiTextColor;
@@ -362,7 +372,6 @@ export declare class Map extends Evented {
362
372
  private _poi;
363
373
  private _initialHiddenLayers;
364
374
  private _attributionControl;
365
- private _mapZoom;
366
375
  private _dispatch;
367
376
  constructor(option: IMapOption);
368
377
  /**
@@ -426,6 +435,19 @@ export declare class Map extends Evented {
426
435
  * @return {MapGeoJSONFeature | undefined}
427
436
  */
428
437
  getFeature(id: string): MapGeoJSONFeature | undefined;
438
+ /**
439
+ * @description Get features from bbox by coordinates [and ordinal].
440
+ * @param coordinates
441
+ * @param ordinal
442
+ */
443
+ getIndoorFeaturesByCoordinates(coordinates: {
444
+ lng: number;
445
+ lat: number;
446
+ }, ordinal?: number): {
447
+ venue: MapGeoJSONFeature;
448
+ building: MapGeoJSONFeature;
449
+ level: MapGeoJSONFeature;
450
+ };
429
451
  /**
430
452
  * @description Get features from bbox by id. One id may correspond to multiple features.
431
453
  * @param id
@@ -445,7 +467,7 @@ export declare class Map extends Evented {
445
467
  selectBuildingById(buildingId: string, callback?: VoidFunction): Promise<void>;
446
468
  /**
447
469
  * @description Select or exit venue by id.
448
- * @param venueId Exit venue if venueId is null.
470
+ * @param venueId 'venueId' can be string or null. Exit indoors if venueId is null.
449
471
  * @param callback Called after venue has been selected.
450
472
  */
451
473
  selectVenueById(venueId: string | null, callback?: VoidFunction): Promise<void>;
@@ -521,7 +543,7 @@ export declare class Map extends Evented {
521
543
  private _selectPoiById;
522
544
  private _getBuildingIdByVenueId;
523
545
  private _tilesRequestTransform;
524
- private _getMapZoom;
546
+ private _checkMapZoom;
525
547
  private _setMapStyle;
526
548
  private _clickEventsDispatcher;
527
549
  private _hideIndoorLayers;
@@ -529,6 +551,18 @@ export declare class Map extends Evented {
529
551
  private _updatePermission;
530
552
  }
531
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
+ }
532
566
  export declare class Marker {
533
567
  private readonly _maplibreMap;
534
568
  private readonly _layerId;
@@ -538,19 +572,11 @@ export declare class Marker {
538
572
  private _iconAnchor;
539
573
  constructor(maplibreMap: MaplibreMap);
540
574
  /**
541
- * @description Set marker by sprite name.
542
- * This method must be called after map style loaded if you set an external URL.
543
- * @param icon Sprite name in map style or the image url, png format.
544
- * @param callback Called when the image(from an external URL) has loaded
545
- * or with an error argument if there is an error.
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.
546
578
  */
547
- setIconImage(icon: string, callback?: VoidFunction): void;
548
- /**
549
- * @description Set marker by image url.
550
- * @deprecated Use 'setIconImage' instead.
551
- * @param imageUrl Network url, png format.
552
- */
553
- setIconImageUrl(imageUrl: string): void;
579
+ setIcon(icon: string): Promise<void>;
554
580
  /**
555
581
  * @description Set marker image size.
556
582
  * @param imageScale Default is 1.
@@ -570,30 +596,45 @@ export declare class Marker {
570
596
  */
571
597
  get sourceId(): string;
572
598
  /**
573
- * @description Create marker[s] source and layer.
574
- * @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[].
575
602
  */
576
- create(array: Array<{
577
- lngLat: [
578
- number,
579
- number
580
- ];
581
- properties?: {
582
- [k: string]: string;
583
- };
584
- }>): 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;
585
617
  /**
586
618
  * @description Remove marker[s] layer and source.
587
619
  */
588
620
  remove(): void;
589
621
  /**
590
622
  * @description Add marker event listener.
623
+ * @deprecated Use 'on' method instead.
591
624
  * @param eventKey
592
625
  * @param callback
593
626
  */
594
627
  onEventListener(eventKey: keyof MapLayerEventType, callback: (marker: MapGeoJSONFeature) => void): {
595
628
  offEventListener: VoidFunction;
596
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
+ };
597
638
  /**
598
639
  * @description Filter marker by custom properties.
599
640
  * @param filterExpression A expression specifying conditions on source features.
@@ -746,95 +787,108 @@ export declare class BuildingFilterControl implements IControl {
746
787
  private _$showLayout;
747
788
  private _$hideLayout;
748
789
  }
749
- export interface IResponse<T> {
750
- code: number;
751
- message: string;
752
- result: T;
753
- }
754
- export type IPresetLanguage = "en" | "zh-Hans" | "zh-Hant" | "ja" | "ko";
755
- 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>> {
756
792
  default: string;
757
793
  }
758
- export type IMultiLangAddress = Record<keyof IMultiLangName, {
794
+ export type IMultilingualAddress = Record<keyof IMultilingualName, {
759
795
  housenumber: string;
760
796
  street: string;
761
797
  }>;
798
+ export interface ILocation {
799
+ lat: number;
800
+ lon: number;
801
+ }
762
802
  export interface IBbox {
763
803
  maxLat: number;
764
804
  maxLon: number;
765
805
  minLat: number;
766
806
  minLon: number;
767
807
  }
768
- export interface ILabelCenter {
769
- lat: number;
770
- lon: number;
808
+ export interface IResponse<T> {
809
+ code: number;
810
+ message: string;
811
+ result: T;
771
812
  }
772
- export interface IBuildingFloor {
773
- id: string;
813
+ export interface IBuildingInlineFloor {
774
814
  code: string;
815
+ id: string;
775
816
  ordinal: number;
776
- visualMap: boolean;
777
817
  signalMap: boolean;
818
+ visualMap: boolean;
778
819
  }
779
820
  export interface IBuilding {
780
- address: IMultiLangAddress;
821
+ address: IMultilingualAddress;
781
822
  bbox: IBbox;
782
823
  buildingId: string;
783
824
  buildingOutlineId: number;
784
825
  city?: string;
785
826
  country: string;
786
- floors: IBuildingFloor[];
827
+ defaultFloor?: string;
828
+ floors: IBuildingInlineFloor[];
787
829
  groundFloor: string;
788
830
  isPrivate: "yes" | "no";
789
- labelCenter: ILabelCenter;
790
- name: IMultiLangName;
831
+ labelCenter: ILocation;
832
+ name: IMultilingualName;
791
833
  organization: string;
792
834
  region: string;
793
835
  signalMap: boolean;
794
836
  type: string;
795
837
  venueId: string;
796
- venueName: IMultiLangName;
797
- defaultFloor?: string;
838
+ venueName: IMultilingualName;
839
+ visualMap: boolean;
798
840
  }
799
- export interface IEntityPoint {
800
- type: string;
801
- coordinates: [
802
- number,
803
- number
804
- ];
841
+ export interface IResponseBuildings {
842
+ buildings: IBuilding[];
843
+ total: number;
805
844
  }
845
+ export type TPromiseBuildings = AxiosPromise<IResponse<IResponseBuildings>>;
806
846
  export interface IVenueInlineBuilding {
807
- id: string;
808
- name: IMultiLangName;
809
847
  buildingOutlineId: number;
810
- point: IEntityPoint;
811
- floors: IBuildingFloor[];
812
- 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
+ };
813
860
  signalMap: boolean;
861
+ visualMap: boolean;
814
862
  }
815
863
  export interface IVenue {
816
- id: string;
817
- name: IMultiLangName;
818
- address: IMultiLangAddress;
819
- type: string;
820
- venueOutlineId: number;
864
+ address: IMultilingualAddress;
821
865
  bbox: IBbox;
822
- labelCenter: ILabelCenter;
823
- 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;
824
875
  organization: string[];
825
- restricted: boolean;
826
876
  owner: string;
827
- country: string;
877
+ publicData?: string[];
878
+ photos?: object[];
828
879
  region: string;
829
- buildings: IVenueInlineBuilding[];
830
- visualMap: boolean;
880
+ restricted: boolean;
831
881
  signalMap: boolean;
832
- defaultBuilding?: string;
882
+ totalPhotoCount?: number;
883
+ type: string;
884
+ venueOutlineId: number;
885
+ visualMap: boolean;
833
886
  }
834
887
  export interface IResponseVenues {
835
888
  venues: IVenue[];
836
889
  total: number;
837
890
  }
891
+ export type TPromiseVenues = AxiosPromise<IResponse<IResponseVenues>>;
838
892
  export declare class VenuesService {
839
893
  private _api;
840
894
  private _request;
@@ -843,7 +897,7 @@ export declare class VenuesService {
843
897
  * @description Search venues by ids.
844
898
  * @param ids The number of IDs cannot exceed 10.
845
899
  */
846
- searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponseVenues>>;
900
+ searchByIds(ids: string | string[]): TPromiseVenues;
847
901
  /**
848
902
  * @description Search venues by center and distance.
849
903
  * @param keywords
@@ -855,7 +909,7 @@ export declare class VenuesService {
855
909
  searchByDistance(keywords: string, center: [
856
910
  number,
857
911
  number
858
- ], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponseVenues>>;
912
+ ], distance: number, offset?: number, page?: number): TPromiseVenues;
859
913
  /**
860
914
  * @description Search venues in specified bbox.
861
915
  * @param keywords
@@ -868,18 +922,15 @@ export declare class VenuesService {
868
922
  number,
869
923
  number,
870
924
  number
871
- ], offset?: number, page?: number): AxiosPromise<IResponse<IResponseVenues>>;
925
+ ], offset?: number, page?: number): TPromiseVenues;
872
926
  /**
873
927
  * @description Search venues by global.
874
928
  * @param keywords
875
929
  * @param offset The maximum value is 100, default is 10.
876
930
  * @param page Default is 1.
877
931
  */
878
- searchByGlobal(keywords: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponseVenues>>;
879
- }
880
- export interface IResponseBuildings {
881
- buildings: IBuilding[];
882
- total: number;
932
+ searchByGlobal(keywords: string, offset?: number, page?: number): TPromiseVenues;
933
+ private _changedRes;
883
934
  }
884
935
  export declare class BuildingsService {
885
936
  private _api;
@@ -889,7 +940,7 @@ export declare class BuildingsService {
889
940
  * @description Search buildings by id[s].
890
941
  * @param ids Single id string or id string array. The number of IDs cannot exceed 10.
891
942
  */
892
- searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponseBuildings>>;
943
+ searchByIds(ids: string | string[]): TPromiseBuildings;
893
944
  /**
894
945
  * @description Search buildings by center and distance.
895
946
  * @param keywords
@@ -898,7 +949,7 @@ export declare class BuildingsService {
898
949
  * @param offset The maximum value is 100, default is 10.
899
950
  * @param page Default is 1.
900
951
  */
901
- 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;
902
953
  /**
903
954
  * @description Search buildings in specified bbox.
904
955
  * @param keywords
@@ -906,34 +957,31 @@ export declare class BuildingsService {
906
957
  * @param offset The maximum value is 100, default is 10.
907
958
  * @param page Default is 1.
908
959
  */
909
- searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
960
+ searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): TPromiseBuildings;
910
961
  /**
911
962
  * @description Search buildings global.
912
963
  * @param keywords
913
964
  * @param offset The maximum value is 100, default is 10.
914
965
  * @param page Default is 1.
915
966
  */
916
- searchByGlobal(keywords: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
967
+ searchByGlobal(keywords: string, offset?: number, page?: number): TPromiseBuildings;
917
968
  /**
918
969
  * @description Search building by floor id.
919
970
  * @param floorId
920
971
  */
921
- searchByFloorId(floorId: string): AxiosPromise<IResponse<IResponseBuildings>>;
972
+ searchByFloorId(floorId: string): TPromiseBuildings;
922
973
  private _changedRes;
923
974
  }
924
- export interface ILocation {
925
- lat: number;
926
- lon: number;
927
- }
928
975
  export interface IPoi {
929
976
  accessibilityDetail: object;
930
977
  buildingId: string;
931
978
  category: string[];
979
+ distance: number;
932
980
  floor: string;
933
981
  floorId: string;
934
982
  id: string;
935
983
  location: ILocation;
936
- name: IMultiLangName;
984
+ name: IMultilingualName;
937
985
  osmRefId: number;
938
986
  poiId: string;
939
987
  venueId: string;
@@ -947,15 +995,19 @@ export interface IResponsePois {
947
995
  pois: IPoi[];
948
996
  total: number;
949
997
  }
998
+ export type TPromisePois = AxiosPromise<IResponse<IResponsePois>>;
999
+ export type TPromiseCategories = AxiosPromise<IResponse<IPoiCategory[]>>;
1000
+ export type TPromiseOrientationPois = AxiosPromise<IResponse<IOrientationPoi[]>>;
950
1001
  export declare enum DistanceSearchType {
951
1002
  POINT = "Point",
952
- POLYGON = "Polygon"
1003
+ POLYGON = "Polygon",
1004
+ GATE = "Gate"
953
1005
  }
954
1006
  export interface IPoiCategory {
955
1007
  category: string;
956
- description: string;
1008
+ description: string | null;
957
1009
  id: string;
958
- title: Partial<Record<keyof IMultiLangName, string>>;
1010
+ title: Partial<Record<keyof IMultilingualName, string>>;
959
1011
  }
960
1012
  export interface IOrientationPoi {
961
1013
  angle: number;
@@ -967,9 +1019,148 @@ export interface IOrientationPoi {
967
1019
  floorId: string;
968
1020
  id: string;
969
1021
  location: ILocation;
970
- name: IMultiLangName;
1022
+ name: IMultilingualName;
971
1023
  osmRefId: number;
972
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;
973
1164
  }
974
1165
  export declare class PoisService {
975
1166
  private _api;
@@ -980,40 +1171,63 @@ export declare class PoisService {
980
1171
  * @description Search POIs by id[s].
981
1172
  * @param ids Single id string or id string array. The number of IDs cannot exceed 100.
982
1173
  */
983
- searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponsePois>>;
1174
+ searchByIds(ids: string | string[]): TPromisePois;
984
1175
  /**
985
1176
  * @description Search POIs by radius distance of the center point.
986
- * @param category
987
- * @param center
988
- * @param distance Radius from center, unit is meter, cannot exceed 10,000.
989
- * @param offset The maximum value is 100, default is 10.
990
- * @param page Default is 1.
1177
+ * @param options {IPoiSearchByDistanceOptions}
991
1178
  */
992
- searchByDistance(category: string, center: number[], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
1179
+ searchByDistance(options: IPoiSearchByDistanceOptions): TPromisePois;
993
1180
  /**
994
1181
  * @description Search POIs in a bbox.
1182
+ * @deprecated Use searchByBounds instead.
995
1183
  * @param keywords
996
1184
  * @param bbox Rectangular area, [minLon, minLat, maxLon, maxLat].
997
1185
  * @param offset The maximum value is 100, default is 10.
998
1186
  * @param page Default is 1.
999
1187
  */
1000
- 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;
1001
1195
  /**
1002
1196
  * @description Search POIs of a building.
1197
+ * @deprecated Use searchByBuilding instead.
1003
1198
  * @param keywords
1004
1199
  * @param buildingId
1005
1200
  * @param offset The maximum value is 100, default is 10.
1006
1201
  * @param page Default is 1.
1007
1202
  */
1008
- 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;
1009
1210
  /**
1010
1211
  * @description Search POIs of a venue.
1212
+ * @deprecated Use searchByVenue instead.
1011
1213
  * @param keywords
1012
1214
  * @param venueId
1013
1215
  * @param offset
1014
1216
  * @param page
1015
1217
  */
1016
- 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;
1017
1231
  /**
1018
1232
  * @description Search poi categories by venue id, building id, or floor id.
1019
1233
  * Search scope priority: floorId > buildingId > venueId.
@@ -1023,44 +1237,31 @@ export declare class PoisService {
1023
1237
  venueId?: string;
1024
1238
  buildingId?: string;
1025
1239
  floorId?: string;
1026
- }): AxiosPromise<IResponse<IPoiCategory[]>>;
1240
+ }): TPromiseCategories;
1027
1241
  /**
1028
- * @description Search orientation and poi.
1242
+ * @description Search surrounding POIs based on the user's location and orientation.
1029
1243
  * BuildingId, floorId and ordinal are mutually exclusive, priority: ordinal > floorId > buildingId.
1030
- * @param paramObj
1244
+ * @deprecated Use searchByOrientation instead.
1245
+ * @param options
1031
1246
  */
1032
- searchOrientation(paramObj: {
1033
- /**
1034
- * User's current position, [lon, lat].
1035
- */
1036
- center: [
1037
- number,
1038
- number
1039
- ];
1040
- /**
1041
- * The angle between cellphone's orientation and the north.
1042
- */
1043
- angle: number;
1044
- /**
1045
- * Radius.
1046
- */
1047
- distance: number;
1048
- buildingId?: string;
1049
- floorId?: string;
1050
- /**
1051
- * Floor order in physical space, e.g. '-1', '0'(ground floor), '1'...
1052
- */
1053
- ordinal?: string;
1054
- /**
1055
- * Search type.
1056
- */
1057
- distanceSearchType?: DistanceSearchType;
1058
- }): 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;
1059
1258
  private _changedRes;
1060
1259
  }
1061
- export interface IResponseRoute {
1062
- infos: IRouteInfo | null;
1063
- paths: IRoutePath[];
1260
+ export declare enum VehicleType {
1261
+ FOOT = "foot",
1262
+ WHEELCHAIR = "wheelchair",
1263
+ ESCALATOR = "escalator",
1264
+ EMERGENCY = "emergency"
1064
1265
  }
1065
1266
  export interface IRouteInfo {
1066
1267
  copyrights: string[];
@@ -1108,60 +1309,67 @@ export interface IRoutePath {
1108
1309
  };
1109
1310
  time: number;
1110
1311
  }
1111
- export declare enum WayFindingVehicleType {
1112
- FOOT = "foot",
1113
- WHEELCHAIR = "wheelchair",
1114
- 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;
1115
1341
  }
1116
1342
  export declare class RouteService {
1117
1343
  private _api;
1118
1344
  private _request;
1119
1345
  constructor();
1120
1346
  /**
1121
- * @description Search the route of any two points.
1122
- * @param fromCoordinate Coordinate [lng, lat] of start point.
1123
- * @param toCoordinate Coordinate [lng, lat] of end point.
1124
- * @param fromFloorId {string | null}
1125
- * @param toFloorId {string | null}
1126
- * @param fromBuildingId {string | null}
1127
- * @param toBuildingId {string | null}
1128
- * @param vehicle
1129
- * @param locale Language-specific response.
1130
- * @param toDoor Whether the end point of the route is in the room(otherwise at the door), default is "true".
1131
- */
1132
- search(fromCoordinate: [
1133
- number,
1134
- number
1135
- ], toCoordinate: [
1136
- number,
1137
- number
1138
- ], 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;
1139
1351
  }
1140
1352
  export declare class RoutePainter {
1141
1353
  private readonly _maplibreMap;
1142
- private _fromCoordinate;
1143
- private _toCoordinate;
1144
1354
  private _fromMarkerIcon;
1145
1355
  private _toMarkerIcon;
1356
+ private _stopMarkerIcons;
1146
1357
  private _markerIconSize;
1147
1358
  private _paintProperties;
1148
1359
  constructor(maplibreMap: MaplibreMap);
1149
1360
  /**
1150
- * @description Set image of the start marker. This method must be called after map style loaded.
1151
- * This method must be called after map style loaded if you set an external URL.
1152
- * @param icon Sprite name in map style or the image url, png format.
1153
- * @param callback Called when the image(from an external URL) has loaded
1154
- * or with an error argument if there is an error.
1155
- */
1156
- setFromMarkerIcon(icon: string, callback?: VoidFunction): void;
1157
- /**
1158
- * @description Set image of the end marker. This method must be called after map style loaded.
1159
- * This method must be called after map style loaded if you set an external URL.
1160
- * @param icon Sprite name in map style or the image url, png format.
1161
- * @param callback Called when the image(from an external URL) has loaded
1162
- * 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.
1163
1367
  */
1164
- setToMarkerIcon(icon: string, callback?: VoidFunction): void;
1368
+ setMarkerIcons(icons: string[] | {
1369
+ from?: string;
1370
+ to?: string;
1371
+ stops?: string[];
1372
+ }): Promise<void>;
1165
1373
  /**
1166
1374
  * @description Set image icon scale.
1167
1375
  * @param size Default is 1.
@@ -1198,16 +1406,12 @@ export declare class RoutePainter {
1198
1406
  /**
1199
1407
  * @description Render route on the map.
1200
1408
  * @param path Route path from RouteService.search response.
1201
- * @param fromCoordinate Coordinate [lng, lat] of start point.
1202
- * @param toCoordinate Coordinate [lng, lat] of end point.
1409
+ * @param markerLocations Coordinate([lng, lat]) array of markers, order from beginning to end.
1203
1410
  */
1204
- render(path: IRoutePath, fromCoordinate: [
1205
- number,
1206
- number
1207
- ], toCoordinate: [
1411
+ render(path: IRoutePath, markerLocations: Array<[
1208
1412
  number,
1209
1413
  number
1210
- ]): void;
1414
+ ]>): void;
1211
1415
  /**
1212
1416
  * @description Remove route from the map.
1213
1417
  */
@@ -1230,7 +1434,7 @@ export declare class RoutePainter {
1230
1434
  private _renderSolidLines;
1231
1435
  private _renderDashedLines;
1232
1436
  private _renderConnectors;
1233
- private _renderFromToMarkers;
1437
+ private _renderMarkers;
1234
1438
  private _addCollectionSource;
1235
1439
  private _addLineLayer;
1236
1440
  private _addTriangleLayer;
@@ -1239,6 +1443,6 @@ export declare class RoutePainter {
1239
1443
  export declare const OFFSET: number;
1240
1444
  export declare const PAGE: number;
1241
1445
  export declare const version: string;
1242
- 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";
1243
1447
 
1244
1448
  export {};