venue-js 1.2.0-next.1 → 1.2.0-next.3

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/dist/index.d.mts CHANGED
@@ -3,15 +3,14 @@ export { QueryObserver } from '@tanstack/query-core';
3
3
  import * as geojson from 'geojson';
4
4
  import { Position, Geometry, GeoJsonProperties, Feature, Point, Polygon, MultiPolygon, LineString, GeometryCollection } from 'geojson';
5
5
  import * as maptalks_dist_core_Class from 'maptalks/dist/core/Class';
6
- import * as maptalks_dist_geo_Extent from 'maptalks/dist/geo/Extent';
7
- import { Map, Coordinate as Coordinate$1, Extent } from 'maptalks-gl';
6
+ import * as maptalks from 'maptalks-gl';
7
+ import { Map } from 'maptalks-gl';
8
8
  import { BaseObject, ThreeLayer } from 'maptalks.three';
9
- import * as maptalks from 'maptalks';
10
- import { Coordinate, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
11
9
  import { ExtrudePolygonOptionType } from 'maptalks.three/dist/type';
12
10
  import { PolygonOptionsType } from 'maptalks/dist/geometry/Polygon';
13
11
  import { LineStringOptionsType } from 'maptalks/dist/geometry/LineString';
14
- import { MapViewType, MapAnimationOptionsType } from 'maptalks/dist/map/Map';
12
+ import { Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
13
+ import { MapViewType, MapAnimationOptionsType, MapPaddingType } from 'maptalks/dist/map/Map';
15
14
  import { SpriteMaterial, AmbientLight, DirectionalLight } from 'three';
16
15
 
17
16
  type Id = string;
@@ -773,22 +772,36 @@ declare class RendererManager extends EventTarget {
773
772
  clearMarkers(): void;
774
773
  }
775
774
 
775
+ interface CameraManagerOptions {
776
+ defaultView?: MapViewType;
777
+ }
778
+ declare class CameraManager {
779
+ map: Map;
780
+ constructor(map: Map, options?: CameraManagerOptions);
781
+ /** Public methods */
782
+ getView: () => MapViewType;
783
+ setView: (value: MapViewType) => void;
784
+ animateTo: (view: MapViewType, options?: MapAnimationOptionsType, step?: (frame: any) => void) => void;
785
+ setMaxExtent(extent: Extent): Map;
786
+ getFeatureExtent: (feature: any, scaleFactor?: number) => Extent;
787
+ getExtentZoom: (extent: Extent, options?: {
788
+ isFraction?: boolean;
789
+ padding?: MapPaddingType;
790
+ }) => number;
791
+ set maxZoom(value: number);
792
+ set minZoom(value: number);
793
+ }
794
+
776
795
  interface IndoorMapOptions {
777
796
  onMapReady?: () => void;
778
797
  onMapLoading?: () => void;
779
798
  centerCross?: boolean;
780
799
  dataClient: VenueDataClient;
781
- camera?: {
782
- defaultCenter?: [number, number];
783
- defaultZoom?: number;
784
- defaultBearing?: number;
785
- defaultPitch?: number;
786
- };
800
+ camera?: CameraManagerOptions;
787
801
  renderer?: RendererManagerOptions;
788
802
  pixelRatio?: number;
789
803
  locale?: string;
790
804
  }
791
- type AmenityHighlightMode = "2DMarker";
792
805
  type SymbolSet = string | null;
793
806
  interface IHighlightOptions {
794
807
  symbolSet?: SymbolSet;
@@ -801,96 +814,10 @@ interface ISetHighlightElementIdsOptions {
801
814
  highlight3DOptions?: IHighlightOptions;
802
815
  highlight2DOptions?: ISetHighlight2DElementIdsOptions;
803
816
  }
804
- interface IMapExtrudeConfig {
805
- height: number;
806
- category: string;
807
- }
808
- interface ILightConfig {
809
- ambientLight: IMapLightConfig;
810
- directionalLight: IMapLightConfig;
811
- }
812
- interface IMapLightConfig {
813
- color: string;
814
- position?: number[];
815
- intensity: number;
816
- }
817
- interface IExtrudeConfig {
818
- kiosk: IMapExtrudeConfig[];
819
- unit: IMapExtrudeConfig[];
820
- }
821
- interface IShortestPathConfig {
822
- resolution: number;
823
- }
824
- interface IAllVenuesViewConfig {
825
- zoom?: number;
826
- pitch?: number;
827
- center?: Coordinate;
828
- bearing?: number;
829
- }
830
- interface IMapAnimation {
831
- [k: string]: {
832
- enable?: boolean;
833
- speed?: number;
834
- };
835
- }
836
- interface IUnitDistanceModifier {
837
- [k: string]: number;
838
- }
839
- type IGraphOptions = {
840
- baseDistance?: number;
841
- multiplier?: number;
842
- };
843
- type IVerticalGraphOptions = IGraphOptions & {
844
- scaleDistanceByLevel?: boolean;
845
- };
846
- interface IGraphFeatureOptions {
847
- traversal?: IUnitDistanceModifier;
848
- escalator?: IGraphOptions;
849
- ramp?: IGraphOptions;
850
- elevator?: IGraphOptions;
851
- stairs?: IVerticalGraphOptions;
852
- }
853
- interface IMapConfig {
854
- amenity_highlight_mode?: AmenityHighlightMode;
855
- default_zoom?: number;
856
- max_zoom?: number;
857
- min_zoom?: number;
858
- kiosk_pixel_ratio?: number;
859
- mobile_pixel_ratio?: number;
860
- extrude?: IExtrudeConfig;
861
- light?: ILightConfig;
862
- shortest_path?: IShortestPathConfig;
863
- text_marker_type?: "marker" | "ui-marker";
864
- extent_features_scale_factor?: number;
865
- extent_scale_map_view_factor?: number;
866
- all_venues_view?: IAllVenuesViewConfig;
867
- animations?: IMapAnimation[];
868
- prepare_steps?: IGraphFeatureOptions;
869
- }
870
817
 
871
- interface CameraManagerOptions {
872
- defaultView?: MapViewType;
873
- }
874
- declare class CameraManager {
875
- #private;
876
- map: Map;
877
- constructor(map: Map, options?: CameraManagerOptions);
878
- /** Public methods */
879
- getView: () => MapViewType;
880
- getZoom: () => number;
881
- setView: (value: MapViewType) => void;
882
- flyTo: (center: any, options?: MapAnimationOptionsType & MapViewType) => void;
883
- flyToAndZoomIn: (centerPoint: any, options?: MapAnimationOptionsType & MapViewType) => void;
884
- }
885
-
886
- type MapPaddingType = {
887
- paddingLeft: number;
888
- paddingRight: number;
889
- paddingTop: number;
890
- paddingBottom: number;
891
- };
892
818
  declare class IndoorMap extends EventTarget {
893
819
  #private;
820
+ options: IndoorMapOptions;
894
821
  map: Map | null;
895
822
  camera: CameraManager;
896
823
  rendererManager: RendererManager;
@@ -900,10 +827,10 @@ declare class IndoorMap extends EventTarget {
900
827
  onMapLoading: () => void;
901
828
  constructor(elementId: any, options: IndoorMapOptions);
902
829
  set dataClient(value: any);
903
- on(eventName: string, handler: any): void;
904
830
  /**
905
831
  * Events
906
832
  */
833
+ on(eventName: string, handler: any): void;
907
834
  handleMapClick: ({ coordinate }: {
908
835
  coordinate: any;
909
836
  }) => void;
@@ -919,34 +846,21 @@ declare class IndoorMap extends EventTarget {
919
846
  set mapTheme(value: any);
920
847
  get venues(): any[];
921
848
  set detectVenueInView(value: any);
922
- get ordinals(): any[];
923
- set ordinals(value: any[]);
924
849
  set billboards(value: any);
925
- set mapConfig(value: IMapConfig);
926
850
  set mapDecorations(value: any);
927
- set maxZoom(value: number);
928
- set minZoom(value: number);
929
851
  set groundLabels(value: any);
930
852
  set pixelRatio(value: number);
931
853
  set onClickElement(func: any);
932
854
  set locale(value: string);
933
855
  handleClickElement: (e: any) => void;
934
- setCenter(center: Coordinate$1, padding?: MapPaddingType): void;
935
856
  /**
936
857
  * Change Level & animate to path / geometry / view / etc.
937
858
  * ================================== */
938
859
  changeLevelByOrdinal(ordinal: null | number | number[]): void;
939
- getFeatureExtent: (feature: any, scaleFactor?: number) => Extent;
940
- getExtentCenter: (extent: Extent) => maptalks_dist_geo_Extent.PositionType;
941
- getExtentZoom: (extent: Extent, options?: {
942
- isFraction?: boolean;
943
- padding?: MapPaddingType;
944
- }) => number;
945
860
  findVenueInView: () => {
946
861
  venueId: string;
947
862
  distance: number;
948
863
  };
949
- flyTo: (center: any, options: any) => void;
950
864
  getLineStringBearing: (feature: any) => number;
951
865
  addAnimations(animation: {
952
866
  id: string;
@@ -1014,15 +928,6 @@ declare class IndoorMap extends EventTarget {
1014
928
  /**
1015
929
  * render (frame)
1016
930
  */
1017
- getTargetViewCenter: (targetView: any, options?: {
1018
- offset: {
1019
- top: number;
1020
- left: number;
1021
- right: number;
1022
- bottom: number;
1023
- };
1024
- }) => Coordinate$1;
1025
- setMaxExtent(extent: Extent): Map;
1026
931
  render(): void;
1027
932
  }
1028
933
 
package/dist/index.d.ts CHANGED
@@ -3,15 +3,14 @@ export { QueryObserver } from '@tanstack/query-core';
3
3
  import * as geojson from 'geojson';
4
4
  import { Position, Geometry, GeoJsonProperties, Feature, Point, Polygon, MultiPolygon, LineString, GeometryCollection } from 'geojson';
5
5
  import * as maptalks_dist_core_Class from 'maptalks/dist/core/Class';
6
- import * as maptalks_dist_geo_Extent from 'maptalks/dist/geo/Extent';
7
- import { Map, Coordinate as Coordinate$1, Extent } from 'maptalks-gl';
6
+ import * as maptalks from 'maptalks-gl';
7
+ import { Map } from 'maptalks-gl';
8
8
  import { BaseObject, ThreeLayer } from 'maptalks.three';
9
- import * as maptalks from 'maptalks';
10
- import { Coordinate, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
11
9
  import { ExtrudePolygonOptionType } from 'maptalks.three/dist/type';
12
10
  import { PolygonOptionsType } from 'maptalks/dist/geometry/Polygon';
13
11
  import { LineStringOptionsType } from 'maptalks/dist/geometry/LineString';
14
- import { MapViewType, MapAnimationOptionsType } from 'maptalks/dist/map/Map';
12
+ import { Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
13
+ import { MapViewType, MapAnimationOptionsType, MapPaddingType } from 'maptalks/dist/map/Map';
15
14
  import { SpriteMaterial, AmbientLight, DirectionalLight } from 'three';
16
15
 
17
16
  type Id = string;
@@ -773,22 +772,36 @@ declare class RendererManager extends EventTarget {
773
772
  clearMarkers(): void;
774
773
  }
775
774
 
775
+ interface CameraManagerOptions {
776
+ defaultView?: MapViewType;
777
+ }
778
+ declare class CameraManager {
779
+ map: Map;
780
+ constructor(map: Map, options?: CameraManagerOptions);
781
+ /** Public methods */
782
+ getView: () => MapViewType;
783
+ setView: (value: MapViewType) => void;
784
+ animateTo: (view: MapViewType, options?: MapAnimationOptionsType, step?: (frame: any) => void) => void;
785
+ setMaxExtent(extent: Extent): Map;
786
+ getFeatureExtent: (feature: any, scaleFactor?: number) => Extent;
787
+ getExtentZoom: (extent: Extent, options?: {
788
+ isFraction?: boolean;
789
+ padding?: MapPaddingType;
790
+ }) => number;
791
+ set maxZoom(value: number);
792
+ set minZoom(value: number);
793
+ }
794
+
776
795
  interface IndoorMapOptions {
777
796
  onMapReady?: () => void;
778
797
  onMapLoading?: () => void;
779
798
  centerCross?: boolean;
780
799
  dataClient: VenueDataClient;
781
- camera?: {
782
- defaultCenter?: [number, number];
783
- defaultZoom?: number;
784
- defaultBearing?: number;
785
- defaultPitch?: number;
786
- };
800
+ camera?: CameraManagerOptions;
787
801
  renderer?: RendererManagerOptions;
788
802
  pixelRatio?: number;
789
803
  locale?: string;
790
804
  }
791
- type AmenityHighlightMode = "2DMarker";
792
805
  type SymbolSet = string | null;
793
806
  interface IHighlightOptions {
794
807
  symbolSet?: SymbolSet;
@@ -801,96 +814,10 @@ interface ISetHighlightElementIdsOptions {
801
814
  highlight3DOptions?: IHighlightOptions;
802
815
  highlight2DOptions?: ISetHighlight2DElementIdsOptions;
803
816
  }
804
- interface IMapExtrudeConfig {
805
- height: number;
806
- category: string;
807
- }
808
- interface ILightConfig {
809
- ambientLight: IMapLightConfig;
810
- directionalLight: IMapLightConfig;
811
- }
812
- interface IMapLightConfig {
813
- color: string;
814
- position?: number[];
815
- intensity: number;
816
- }
817
- interface IExtrudeConfig {
818
- kiosk: IMapExtrudeConfig[];
819
- unit: IMapExtrudeConfig[];
820
- }
821
- interface IShortestPathConfig {
822
- resolution: number;
823
- }
824
- interface IAllVenuesViewConfig {
825
- zoom?: number;
826
- pitch?: number;
827
- center?: Coordinate;
828
- bearing?: number;
829
- }
830
- interface IMapAnimation {
831
- [k: string]: {
832
- enable?: boolean;
833
- speed?: number;
834
- };
835
- }
836
- interface IUnitDistanceModifier {
837
- [k: string]: number;
838
- }
839
- type IGraphOptions = {
840
- baseDistance?: number;
841
- multiplier?: number;
842
- };
843
- type IVerticalGraphOptions = IGraphOptions & {
844
- scaleDistanceByLevel?: boolean;
845
- };
846
- interface IGraphFeatureOptions {
847
- traversal?: IUnitDistanceModifier;
848
- escalator?: IGraphOptions;
849
- ramp?: IGraphOptions;
850
- elevator?: IGraphOptions;
851
- stairs?: IVerticalGraphOptions;
852
- }
853
- interface IMapConfig {
854
- amenity_highlight_mode?: AmenityHighlightMode;
855
- default_zoom?: number;
856
- max_zoom?: number;
857
- min_zoom?: number;
858
- kiosk_pixel_ratio?: number;
859
- mobile_pixel_ratio?: number;
860
- extrude?: IExtrudeConfig;
861
- light?: ILightConfig;
862
- shortest_path?: IShortestPathConfig;
863
- text_marker_type?: "marker" | "ui-marker";
864
- extent_features_scale_factor?: number;
865
- extent_scale_map_view_factor?: number;
866
- all_venues_view?: IAllVenuesViewConfig;
867
- animations?: IMapAnimation[];
868
- prepare_steps?: IGraphFeatureOptions;
869
- }
870
817
 
871
- interface CameraManagerOptions {
872
- defaultView?: MapViewType;
873
- }
874
- declare class CameraManager {
875
- #private;
876
- map: Map;
877
- constructor(map: Map, options?: CameraManagerOptions);
878
- /** Public methods */
879
- getView: () => MapViewType;
880
- getZoom: () => number;
881
- setView: (value: MapViewType) => void;
882
- flyTo: (center: any, options?: MapAnimationOptionsType & MapViewType) => void;
883
- flyToAndZoomIn: (centerPoint: any, options?: MapAnimationOptionsType & MapViewType) => void;
884
- }
885
-
886
- type MapPaddingType = {
887
- paddingLeft: number;
888
- paddingRight: number;
889
- paddingTop: number;
890
- paddingBottom: number;
891
- };
892
818
  declare class IndoorMap extends EventTarget {
893
819
  #private;
820
+ options: IndoorMapOptions;
894
821
  map: Map | null;
895
822
  camera: CameraManager;
896
823
  rendererManager: RendererManager;
@@ -900,10 +827,10 @@ declare class IndoorMap extends EventTarget {
900
827
  onMapLoading: () => void;
901
828
  constructor(elementId: any, options: IndoorMapOptions);
902
829
  set dataClient(value: any);
903
- on(eventName: string, handler: any): void;
904
830
  /**
905
831
  * Events
906
832
  */
833
+ on(eventName: string, handler: any): void;
907
834
  handleMapClick: ({ coordinate }: {
908
835
  coordinate: any;
909
836
  }) => void;
@@ -919,34 +846,21 @@ declare class IndoorMap extends EventTarget {
919
846
  set mapTheme(value: any);
920
847
  get venues(): any[];
921
848
  set detectVenueInView(value: any);
922
- get ordinals(): any[];
923
- set ordinals(value: any[]);
924
849
  set billboards(value: any);
925
- set mapConfig(value: IMapConfig);
926
850
  set mapDecorations(value: any);
927
- set maxZoom(value: number);
928
- set minZoom(value: number);
929
851
  set groundLabels(value: any);
930
852
  set pixelRatio(value: number);
931
853
  set onClickElement(func: any);
932
854
  set locale(value: string);
933
855
  handleClickElement: (e: any) => void;
934
- setCenter(center: Coordinate$1, padding?: MapPaddingType): void;
935
856
  /**
936
857
  * Change Level & animate to path / geometry / view / etc.
937
858
  * ================================== */
938
859
  changeLevelByOrdinal(ordinal: null | number | number[]): void;
939
- getFeatureExtent: (feature: any, scaleFactor?: number) => Extent;
940
- getExtentCenter: (extent: Extent) => maptalks_dist_geo_Extent.PositionType;
941
- getExtentZoom: (extent: Extent, options?: {
942
- isFraction?: boolean;
943
- padding?: MapPaddingType;
944
- }) => number;
945
860
  findVenueInView: () => {
946
861
  venueId: string;
947
862
  distance: number;
948
863
  };
949
- flyTo: (center: any, options: any) => void;
950
864
  getLineStringBearing: (feature: any) => number;
951
865
  addAnimations(animation: {
952
866
  id: string;
@@ -1014,15 +928,6 @@ declare class IndoorMap extends EventTarget {
1014
928
  /**
1015
929
  * render (frame)
1016
930
  */
1017
- getTargetViewCenter: (targetView: any, options?: {
1018
- offset: {
1019
- top: number;
1020
- left: number;
1021
- right: number;
1022
- bottom: number;
1023
- };
1024
- }) => Coordinate$1;
1025
- setMaxExtent(extent: Extent): Map;
1026
931
  render(): void;
1027
932
  }
1028
933