@mapxus/mapxus-map-jp 8.0.0 → 8.2.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.
package/es/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
3
  import { AxiosPromise } from 'axios';
4
+ import { EventEmitter } from 'events';
4
5
  import { GeoJsonProperties, LineString, Point } from 'geojson';
5
6
  import maplibregl$1 from 'maplibre-gl';
6
7
  import { ControlPosition, ExpressionSpecification, FilterSpecification, IControl, LngLat, MapGeoJSONFeature, MapLayerEventType, PaddingOptions, PointLike, RequireAtLeastOne } from 'maplibre-gl';
@@ -32,6 +33,10 @@ export declare enum ThemeType {
32
33
  COMMON = "common",
33
34
  MAPXUS_V2 = "mapxus_v2"
34
35
  }
36
+ export declare enum AccessControlOrigin {
37
+ Self = "self",
38
+ Map = "map"
39
+ }
35
40
  export interface IBbox {
36
41
  maxLat: number;
37
42
  maxLon: number;
@@ -92,6 +97,28 @@ export interface IResponseBuildings {
92
97
  total: number;
93
98
  }
94
99
  export type TPromiseBuildings = AxiosPromise<IResponse<IResponseBuildings>>;
100
+ export interface IBuildingSearchCustomizedOptions {
101
+ bounds?: [
102
+ [
103
+ number,
104
+ number
105
+ ],
106
+ [
107
+ number,
108
+ number
109
+ ]
110
+ ];
111
+ center?: [
112
+ number,
113
+ number
114
+ ];
115
+ distance?: number;
116
+ keywords?: string;
117
+ signal?: boolean;
118
+ visual?: boolean;
119
+ offset?: number;
120
+ page?: number;
121
+ }
95
122
  export type TPointFeature = GeoJSON.Feature<Point, GeoJsonProperties>;
96
123
  export type TLineStringFeature = GeoJSON.Feature<LineString, GeoJsonProperties>;
97
124
  export interface IFloor {
@@ -200,6 +227,41 @@ export interface IPointEvent {
200
227
  coordinate: LngLat;
201
228
  point: PointLike;
202
229
  }
230
+ export declare enum DistanceSearchType {
231
+ POINT = "Point",
232
+ POLYGON = "Polygon"
233
+ }
234
+ export declare enum OrientationDistanceSearchType {
235
+ POINT = "Point",
236
+ POLYGON = "Polygon",
237
+ GATE = "Gate"
238
+ }
239
+ export interface IBoundsSpec {
240
+ /** An array of LngLat coordinates in [sw, ne] order */
241
+ bounds: [
242
+ [
243
+ number,
244
+ number
245
+ ],
246
+ [
247
+ number,
248
+ number
249
+ ]
250
+ ];
251
+ }
252
+ export interface IKeywordSpec {
253
+ keywords?: string;
254
+ }
255
+ export interface IBuildingSpec {
256
+ buildingId: string;
257
+ }
258
+ export interface IVenueSpec {
259
+ venueId: string;
260
+ }
261
+ export interface IFloorSpec {
262
+ floorId: string;
263
+ }
264
+ export type TSearchCategoriesOptions = IVenueSpec | IBuildingSpec | IFloorSpec | (IBoundsSpec & IKeywordSpec);
203
265
  export interface IPoi {
204
266
  accessibilityDetail: IMultilingualName;
205
267
  buildingId: string;
@@ -226,11 +288,6 @@ export interface IResponsePois {
226
288
  export type TPromisePois = AxiosPromise<IResponse<IResponsePois>>;
227
289
  export type TPromiseCategories = AxiosPromise<IResponse<IPoiCategory[]>>;
228
290
  export type TPromiseOrientationPois = AxiosPromise<IResponse<IOrientationPoi[]>>;
229
- export declare enum DistanceSearchType {
230
- POINT = "Point",
231
- POLYGON = "Polygon",
232
- GATE = "Gate"
233
- }
234
291
  export interface IPoiCategory {
235
292
  category: string;
236
293
  description: string | null;
@@ -309,7 +366,7 @@ export interface ISearchOrientation {
309
366
  /**
310
367
  * The type of POI, default is 'Point'.
311
368
  */
312
- distanceSearchType?: DistanceSearchType;
369
+ distanceSearchType?: OrientationDistanceSearchType;
313
370
  }
314
371
  export interface IPoiSearchByOrientationAndBuildingOptions extends ISearchOrientation {
315
372
  buildingId: string;
@@ -324,6 +381,10 @@ export type TPoiSearchByOrientationOptions = IPoiSearchByOrientationAndBuildingO
324
381
  export declare enum PoisOrderBy {
325
382
  DEFAULT_NAME = "DefaultName"
326
383
  }
384
+ export declare enum PoisSortBy {
385
+ ABSOLUTE_DISTANCE = "AbsoluteDistance",
386
+ ACTUAL_DISTANCE = "ActualDistance"
387
+ }
327
388
  export interface ISearchKeywords {
328
389
  keywords?: string;
329
390
  /**
@@ -363,6 +424,34 @@ export interface IPoiSearchByBoundsOptions extends ISearchKeywords {
363
424
  ];
364
425
  orderBy?: PoisOrderBy;
365
426
  }
427
+ export interface IPoiSearchCustomizedOptions {
428
+ bounds?: [
429
+ [
430
+ number,
431
+ number
432
+ ],
433
+ [
434
+ number,
435
+ number
436
+ ]
437
+ ];
438
+ center?: [
439
+ number,
440
+ number
441
+ ];
442
+ distance?: number;
443
+ category?: string;
444
+ excludedCategories?: string | string[];
445
+ floorId?: string;
446
+ buildingId?: string;
447
+ venueId?: string;
448
+ keywords?: string;
449
+ orderBy?: PoisOrderBy;
450
+ sort?: PoisSortBy;
451
+ distanceSearchType?: DistanceSearchType;
452
+ offset?: number;
453
+ page?: number;
454
+ }
366
455
  export interface ITokenInfo {
367
456
  "app:name": string;
368
457
  auth_time: number;
@@ -497,87 +586,9 @@ export interface IResponseVenues {
497
586
  total: number;
498
587
  }
499
588
  export type TPromiseVenues = AxiosPromise<IResponse<IResponseVenues>>;
500
- export interface IBoundsSpec {
501
- /** An array of LngLat coordinates in [sw, ne] order */
502
- bounds: [
503
- [
504
- number,
505
- number
506
- ],
507
- [
508
- number,
509
- number
510
- ]
511
- ];
589
+ export interface IVenueSearchCustomizedOptions extends IBuildingSearchCustomizedOptions {
512
590
  }
513
- export interface IKeywordSpec {
514
- keywords?: string;
515
- }
516
- export interface IBuildingSpec {
517
- buildingId: string;
518
- }
519
- export interface IVenueSpec {
520
- venueId: string;
521
- }
522
- export interface IFloorSpec {
523
- floorId: string;
524
- }
525
- export type TSearchCategoriesOptions = IVenueSpec | IBuildingSpec | IFloorSpec | (IBoundsSpec & IKeywordSpec);
526
- export type Listener = (param: any) => any;
527
- declare class Event$1 {
528
- private _type;
529
- private _target;
530
- constructor(type: string, data?: Object);
531
- get type(): string;
532
- set type(type: string);
533
- get target(): Evented;
534
- set target(target: Evented);
535
- }
536
- declare class Evented {
537
- private _listeners;
538
- private _oneTimeListeners;
539
- private _eventedParent;
540
- private _eventedParentData;
541
- /**
542
- * @description Register a new event listener
543
- * @param type name of the event(a unique string)
544
- * @param listener event handler, it will be called when the event is fired
545
- */
546
- on(type: string, listener: Listener): this;
547
- /**
548
- * @description Remove a registered event listener
549
- * @param type name of the event
550
- * @param listener event handler
551
- */
552
- off(type: string, listener: Listener): this;
553
- /**
554
- * Adds a listener that will be called only once to a specified event type.
555
- *
556
- * The listener will be called first time the event fires after the listener is registered.
557
- *
558
- * @param {string} type The event type to listen for.
559
- * @param {Function} listener The function to be called when the event is fired the first time.
560
- * @returns {Object} `this`
561
- */
562
- once(type: string, listener: Listener): this;
563
- fire(event: Event$1): this;
564
- /**
565
- * Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.
566
- *
567
- * @param {string} type The event type
568
- * @returns {boolean} `true` if there is at least one registered listener for specified event type, `false` otherwise
569
- * @private
570
- */
571
- listens(type: string): boolean;
572
- /**
573
- * Bubble all events fired by this instance of Evented to this parent instance of Evented.
574
- *
575
- * @returns {Object} `this`
576
- * @private
577
- */
578
- setEventedParent(parent: Evented, data?: Object | (() => Object)): this;
579
- }
580
- export declare class Indoor extends Evented {
591
+ export declare class Indoor extends EventEmitter {
581
592
  private _map;
582
593
  private _features;
583
594
  private _allBuildings;
@@ -603,7 +614,7 @@ export declare class Indoor extends Evented {
603
614
  private _maplibreMapLoaded;
604
615
  private _indoorMapLoaded;
605
616
  private readonly _isVenueMode;
606
- private _isMaskMode;
617
+ private readonly _isMaskMode;
607
618
  private _upperLevels;
608
619
  private _lowerLevels;
609
620
  private _featureIncomplete;
@@ -615,6 +626,10 @@ export declare class Indoor extends Evented {
615
626
  private _upperBuildings;
616
627
  private _lowerBuildings;
617
628
  private readonly _hiddenBuildings;
629
+ private _isDestroyed;
630
+ private _findBuildingTimeoutId;
631
+ private _findBuildingIntervalId;
632
+ private _debounceRendering;
618
633
  constructor(props: {
619
634
  map: maplibregl$1.Map;
620
635
  /** @deprecated */
@@ -626,6 +641,7 @@ export declare class Indoor extends Evented {
626
641
  outdoorMapShown?: boolean;
627
642
  selectedBuildingBorderStyle?: ISelectedBuildingBorderStyle;
628
643
  });
644
+ destroy(): void;
629
645
  /**
630
646
  * @description Set whether to allow exiting building.
631
647
  * @param allow
@@ -739,6 +755,7 @@ export declare class Indoor extends Evented {
739
755
  private _resetSelectedBuildingLevel;
740
756
  private _checkAndPanToBuilding;
741
757
  private _invisibleSelectedBuilding;
758
+ private _clearTimers;
742
759
  }
743
760
  export declare class BuildingFilterControl implements IControl {
744
761
  private _map;
@@ -751,29 +768,13 @@ export declare class BuildingFilterControl implements IControl {
751
768
  private _listHeight;
752
769
  private _visible;
753
770
  private _position;
754
- /**
755
- * @param map
756
- * @param position - **@deprecated** The optional parameter **'position' will be removed soon**.
757
- * @param buildingSelectorEnabled
758
- */
759
- constructor(map: Map$1, position?: ControlPosition, buildingSelectorEnabled?: boolean);
771
+ constructor(map: Map$1, buildingSelectorEnabled?: boolean);
760
772
  onAdd(map: maplibregl$1.Map): HTMLElement;
761
773
  onRemove(): void;
762
774
  get position(): ControlPosition;
763
775
  get enabled(): boolean;
764
776
  getDefaultPosition(): ControlPosition;
765
- /**
766
- * @deprecated Use 'setVisibility' instead.
767
- * @param isHidden
768
- */
769
- setLayoutHidden(isHidden: boolean): void;
770
777
  setVisibility(isVisible: boolean): void;
771
- /**
772
- * @deprecated Use 'changePosition' instead.
773
- * @param from
774
- * @param to
775
- */
776
- moveBuildingFilter(from: ControlPosition, to: ControlPosition): void;
777
778
  changePosition(from: ControlPosition, to: ControlPosition, index?: number): void;
778
779
  private _loadData;
779
780
  private _init;
@@ -819,10 +820,8 @@ export declare class FloorsControl implements IControl {
819
820
  private _isEnabled;
820
821
  private _visible;
821
822
  private _dragPan;
822
- /**
823
- * @param indoor
824
- * @param options
825
- */
823
+ private _debounceScroll;
824
+ private _clearScrollEventListener;
826
825
  constructor(indoor: Indoor, options: IFloorSelectorOptions);
827
826
  onAdd(map: maplibregl$1.Map): HTMLElement;
828
827
  onRemove(): void;
@@ -835,7 +834,7 @@ export declare class FloorsControl implements IControl {
835
834
  * @param ordinal
836
835
  * @param dragPan
837
836
  */
838
- switchByOrdinal(ordinal: string, dragPan?: boolean): void;
837
+ switchByOrdinal(ordinal: string, dragPan?: boolean): Promise<void>;
839
838
  changePosition(from: ControlPosition, to: ControlPosition, index?: number): void;
840
839
  setStyle(style: Partial<IFloorSelectorStyle>): void;
841
840
  private _setVisibility;
@@ -910,7 +909,8 @@ export declare class SwitchOutdoorHandler {
910
909
  disable(): void;
911
910
  get isEnabled(): boolean;
912
911
  }
913
- declare class Map$1 extends Evented {
912
+ declare class Map$1 {
913
+ private _appId;
914
914
  private _map;
915
915
  private _indoor;
916
916
  private _poi;
@@ -923,6 +923,9 @@ declare class Map$1 extends Evented {
923
923
  private _fitBuildingBounds;
924
924
  private _history;
925
925
  private _hiddenBuildings;
926
+ private _debounceHTTPErrorHandler;
927
+ private _debounceTilesFilter;
928
+ isDestroyed: boolean;
926
929
  switchOutdoor: SwitchOutdoorHandler;
927
930
  switchBuilding: SwitchBuildingHandler;
928
931
  buildingSelector: BuildingSelectorHandler;
@@ -933,6 +936,7 @@ declare class Map$1 extends Evented {
933
936
  * @param callback
934
937
  */
935
938
  renderComplete(callback: VoidFunction): void;
939
+ destroyed(callback: VoidFunction): void;
936
940
  /**
937
941
  * @description Get map indoor instance.
938
942
  */
@@ -1079,6 +1083,7 @@ declare class Map$1 extends Evented {
1079
1083
  * @returns Map<buildingId, buildingFeature>
1080
1084
  */
1081
1085
  private _getCenterBuildingsMap;
1086
+ private _destroy;
1082
1087
  }
1083
1088
  export declare class Marker {
1084
1089
  private readonly _maplibreMap;
@@ -1204,7 +1209,9 @@ export declare class Poi {
1204
1209
  private _map;
1205
1210
  private _layerIds;
1206
1211
  private _dispatch;
1212
+ private _debounceQueryFeatures;
1207
1213
  constructor(map: maplibregl$1.Map);
1214
+ destroy(): void;
1208
1215
  /**
1209
1216
  * @description Listen for POI click events.
1210
1217
  * @param listener
@@ -1213,7 +1220,7 @@ export declare class Poi {
1213
1220
  unsubscribe: VoidFunction;
1214
1221
  };
1215
1222
  private _bindEvents;
1216
- private _init;
1223
+ private _queryPoiLayers;
1217
1224
  private _initPoiClick;
1218
1225
  private _getFloorDataByFloorId;
1219
1226
  }
@@ -1230,7 +1237,10 @@ export interface IRouteStyle<T> {
1230
1237
  lineWidth?: number | ExpressionSpecification;
1231
1238
  dashedLineWidth?: number | ExpressionSpecification;
1232
1239
  disableDashedLine?: boolean;
1233
- inactiveRouteOpacity?: number | ExpressionSpecification;
1240
+ /** Optional number in range [0, 1]. Defaults to 0.5. "inactiveRouteOpacity" will be 1 if the parameter is greater than 1, and it will be 0 if the parameter is less than 0. */
1241
+ inactiveRouteOpacity?: number;
1242
+ /** Optional number in range [0, 1]. Defaults to 1. "outdoorLineOpacity" will be 1 if the parameter is greater than 1, and it will be 0 if the parameter is less than 0. */
1243
+ outdoorLineOpacity?: number;
1234
1244
  markers?: T;
1235
1245
  markerIconSize?: number | ExpressionSpecification;
1236
1246
  lineSymbol?: {
@@ -1345,13 +1355,44 @@ export declare class RoutePainter {
1345
1355
  private _renderMarkers;
1346
1356
  private _addCollectionSource;
1347
1357
  private _addLineLayer;
1348
- private _addTriangleLayer;
1358
+ private _renderLineSymbols;
1349
1359
  private _addIconLayer;
1350
1360
  private _updateStyleProperties;
1351
1361
  private _loadMarkerIcons;
1352
1362
  private _updateLayers;
1353
1363
  private _filterRouteOpacity;
1354
1364
  }
1365
+ /**
1366
+ * AccessControl class, for providing token and managing token lifecycle.
1367
+ * @extends EventEmitter
1368
+ * Three events are emitted:
1369
+ * - "updated": Emitted when the token is updated. Usage: accessControl.on("updated", ({ appId, token }) => {});
1370
+ * - "error": Emitted when an error occurs during token update. Usage: accessControl.on("error", (error) => {});
1371
+ * - "closed": Emitted when the access control is closed. Usage: accessControl.on("closed", () => {});
1372
+ */
1373
+ export declare class AccessControl extends EventEmitter {
1374
+ private readonly _appId;
1375
+ private readonly _secret;
1376
+ isClosed: boolean;
1377
+ private _timeoutId;
1378
+ private _isInitialized;
1379
+ private readonly _initializationPromise;
1380
+ private _tokenManager;
1381
+ private readonly _from;
1382
+ constructor(appId: string, secret: string, origin?: AccessControlOrigin);
1383
+ ready(): Promise<void>;
1384
+ get appId(): string;
1385
+ /**
1386
+ * Get the token which is kept up-to-date automatically.
1387
+ */
1388
+ get token(): string;
1389
+ /**
1390
+ * Destroy the access_control instance, stop updating token.
1391
+ */
1392
+ close(): void;
1393
+ private _initToken;
1394
+ private _loopUpdateToken;
1395
+ }
1355
1396
  export declare class VenuesService {
1356
1397
  private _api;
1357
1398
  private _request;
@@ -1393,6 +1434,7 @@ export declare class VenuesService {
1393
1434
  * @param page Default is 1.
1394
1435
  */
1395
1436
  searchByGlobal(keywords: string, offset?: number, page?: number): TPromiseVenues;
1437
+ search(options: IVenueSearchCustomizedOptions): TPromiseVenues;
1396
1438
  private _changedRes;
1397
1439
  }
1398
1440
  export declare class BuildingsService {
@@ -1433,6 +1475,7 @@ export declare class BuildingsService {
1433
1475
  * @param floorId
1434
1476
  */
1435
1477
  searchByFloorId(floorId: string): TPromiseBuildings;
1478
+ search(options: IBuildingSearchCustomizedOptions): TPromiseBuildings;
1436
1479
  private _changedRes;
1437
1480
  }
1438
1481
  export declare class PoisService {
@@ -1491,6 +1534,7 @@ export declare class PoisService {
1491
1534
  * @param options {TPoiSearchByCategoryOptions}
1492
1535
  */
1493
1536
  searchByCategory(options: TPoiSearchByCategoryOptions): TPromisePois;
1537
+ search(options: IPoiSearchCustomizedOptions): TPromisePois;
1494
1538
  private _changedRes;
1495
1539
  }
1496
1540
  export declare class RouteService {