venue-js 1.2.0-next.7 → 1.2.0-next.8
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 +156 -9
- package/dist/index.d.ts +156 -9
- package/dist/index.js +176 -333
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +169 -331
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6,12 +6,12 @@ import * as maptalks_dist_core_Class from 'maptalks/dist/core/Class';
|
|
|
6
6
|
import * as maptalks from 'maptalks-gl';
|
|
7
7
|
import { Map } from 'maptalks-gl';
|
|
8
8
|
import { BaseObject, ThreeLayer } from 'maptalks.three';
|
|
9
|
-
import {
|
|
9
|
+
import { Extent, Coordinate, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
|
|
10
|
+
import { BaseObjectOptionType, ExtrudePolygonOptionType } from 'maptalks.three/dist/type';
|
|
10
11
|
import { PolygonOptionsType } from 'maptalks/dist/geometry/Polygon';
|
|
11
12
|
import { LineStringOptionsType } from 'maptalks/dist/geometry/LineString';
|
|
12
|
-
import { Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
|
|
13
13
|
import { MapViewType, MapAnimationOptionsType, MapPaddingType } from 'maptalks/dist/map/Map';
|
|
14
|
-
import { SpriteMaterial
|
|
14
|
+
import { SpriteMaterial } from 'three';
|
|
15
15
|
|
|
16
16
|
type Id = string;
|
|
17
17
|
type MediaFile = {
|
|
@@ -182,6 +182,7 @@ type OccupantProperties = EntityTimestamps & {
|
|
|
182
182
|
kiosk_ids: Id[];
|
|
183
183
|
unit_ids: Id[];
|
|
184
184
|
website_link: string | null;
|
|
185
|
+
show_name_on_all_units: boolean;
|
|
185
186
|
};
|
|
186
187
|
type OccupantFeature = ImdfFeature<OccupantGeometry, OccupantProperties>;
|
|
187
188
|
type OpeningGeometry = LineString;
|
|
@@ -532,10 +533,13 @@ type OccupantFeaturePopulated = OccupantFeature & {
|
|
|
532
533
|
* [IMDF] Occupant's position
|
|
533
534
|
*/
|
|
534
535
|
anchor: AnchorFeaturePopulated;
|
|
536
|
+
ordinal: number;
|
|
535
537
|
/**
|
|
536
538
|
* [venue.in.th] Occupant's category
|
|
537
539
|
*/
|
|
538
540
|
local_categories: TaxonomyFeaturePopulated[];
|
|
541
|
+
unit?: UnitFeaturePopulated;
|
|
542
|
+
kiosk?: KioskFeaturePopulated;
|
|
539
543
|
/**
|
|
540
544
|
* [venue.in.th] Bind correlation between units on an occupant,
|
|
541
545
|
* which will be used for highlighting in the floor plan and
|
|
@@ -712,8 +716,86 @@ declare const safeFetchFeature: <T extends FeatureType = FeatureType>(featureTyp
|
|
|
712
716
|
baseUrl: string;
|
|
713
717
|
}) => Promise<FeatureResponseMap[T][]>;
|
|
714
718
|
|
|
719
|
+
/**
|
|
720
|
+
* Checks if a point is a valid coordinate pair.
|
|
721
|
+
*
|
|
722
|
+
* @param point - The point to be checked.
|
|
723
|
+
* @return True if the point is a valid coordinate pair, false otherwise.
|
|
724
|
+
*/
|
|
725
|
+
declare const isValidCoordinate: (point: Position) => boolean;
|
|
726
|
+
/**
|
|
727
|
+
* Checks if an input represents a valid polygon, which may include holes.
|
|
728
|
+
* The input can be a single array of coordinates for simple polygons, or
|
|
729
|
+
* an array of arrays of coordinates for polygons with holes.
|
|
730
|
+
*
|
|
731
|
+
* @param polygon - The input representing a polygon.
|
|
732
|
+
* @return True if the polygon is valid, false otherwise.
|
|
733
|
+
*/
|
|
734
|
+
declare const isValidPolygonCoordinates: (polygon: Position[] | Position[][]) => boolean;
|
|
735
|
+
/**
|
|
736
|
+
* Checks if an array of polygons forms a valid MultiPolygon.
|
|
737
|
+
*
|
|
738
|
+
* @param multipolygon - The array of polygons.
|
|
739
|
+
* @return True if the multipolygon is valid, false otherwise.
|
|
740
|
+
*/
|
|
741
|
+
declare const isValidMultiPolygonCoordinates: (multipolygon: Position[][][]) => boolean;
|
|
742
|
+
/**
|
|
743
|
+
* Checks if a set of points forms a valid LineString.
|
|
744
|
+
* A valid LineString must have at least two points, each point must be a valid coordinate,
|
|
745
|
+
* and it should not form a closed loop.
|
|
746
|
+
*
|
|
747
|
+
* @param lineString - The array of points representing a LineString.
|
|
748
|
+
* @return True if the LineString is valid, false otherwise.
|
|
749
|
+
*/
|
|
750
|
+
declare const isValidLineStringCoordinates: (lineString: Position[]) => boolean;
|
|
751
|
+
declare const isValidMultiPolygon: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
|
|
752
|
+
declare const isValidPolygon: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
|
|
753
|
+
declare const isValidLineString: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
|
|
754
|
+
declare const isValidPoint: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
|
|
755
|
+
|
|
756
|
+
declare function matchFilter(value: Value | Value[], filter: Filter): boolean;
|
|
757
|
+
declare function matchFilters<T extends Record<string, any>>(item: T, filters: Filters): boolean;
|
|
758
|
+
|
|
759
|
+
declare const getOccupantMainLocation: (occupant: OccupantFeaturePopulated) => UnitFeaturePopulated | KioskFeaturePopulated;
|
|
760
|
+
declare const getOccupantCorrelatedLocations: (occupant: OccupantFeaturePopulated) => Array<UnitFeaturePopulated | KioskFeaturePopulated>;
|
|
761
|
+
type OccupantMarkerPlacementType = 'ONCE_PER_LEVEL' | 'ALL_LOCATIONS';
|
|
762
|
+
declare const getOccupantMarkerLocations: (occupant: OccupantFeaturePopulated, options?: {
|
|
763
|
+
type: OccupantMarkerPlacementType;
|
|
764
|
+
}) => Array<UnitFeaturePopulated | KioskFeaturePopulated>;
|
|
765
|
+
|
|
766
|
+
type occupantHelper_OccupantMarkerPlacementType = OccupantMarkerPlacementType;
|
|
767
|
+
declare const occupantHelper_getOccupantCorrelatedLocations: typeof getOccupantCorrelatedLocations;
|
|
768
|
+
declare const occupantHelper_getOccupantMainLocation: typeof getOccupantMainLocation;
|
|
769
|
+
declare const occupantHelper_getOccupantMarkerLocations: typeof getOccupantMarkerLocations;
|
|
770
|
+
declare namespace occupantHelper {
|
|
771
|
+
export { type occupantHelper_OccupantMarkerPlacementType as OccupantMarkerPlacementType, occupantHelper_getOccupantCorrelatedLocations as getOccupantCorrelatedLocations, occupantHelper_getOccupantMainLocation as getOccupantMainLocation, occupantHelper_getOccupantMarkerLocations as getOccupantMarkerLocations };
|
|
772
|
+
}
|
|
773
|
+
|
|
715
774
|
declare const getDataClient: (options: VenueClientOptions) => VenueDataClient;
|
|
716
775
|
|
|
776
|
+
type TextMarkerOptions = BaseObjectOptionType & {
|
|
777
|
+
text?: string;
|
|
778
|
+
textAlign?: CanvasTextAlign;
|
|
779
|
+
color?: CanvasFillStrokeStyles["fillStyle"];
|
|
780
|
+
fontFamily?: string;
|
|
781
|
+
fontSize?: number;
|
|
782
|
+
fontWeight?: number;
|
|
783
|
+
background?: CanvasFillStrokeStyles["fillStyle"];
|
|
784
|
+
lineHeight?: number;
|
|
785
|
+
strokeColor?: CanvasFillStrokeStyles["strokeStyle"];
|
|
786
|
+
strokeWidth?: number;
|
|
787
|
+
strokeStyle?: CanvasLineJoin;
|
|
788
|
+
padding?: number;
|
|
789
|
+
maxWidth?: number;
|
|
790
|
+
scale?: number;
|
|
791
|
+
altitude?: number;
|
|
792
|
+
bottomHeight?: number;
|
|
793
|
+
opacity?: number | {
|
|
794
|
+
stops: Stop[];
|
|
795
|
+
};
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
type Stop = [zoom: number, value: number];
|
|
717
799
|
/** 2D */
|
|
718
800
|
type TypeRenderOptions<TOptionsType> = {
|
|
719
801
|
default: TOptionsType;
|
|
@@ -748,6 +830,8 @@ type RendererManagerOptions = BaseRenderManagerOptions & {
|
|
|
748
830
|
elements: Element3DRendererOptions;
|
|
749
831
|
};
|
|
750
832
|
|
|
833
|
+
type AnyMarkerOptions = TextMarkerOptions;
|
|
834
|
+
|
|
751
835
|
declare class RendererManager extends EventTarget {
|
|
752
836
|
#private;
|
|
753
837
|
map: maptalks.Map;
|
|
@@ -770,7 +854,7 @@ declare class RendererManager extends EventTarget {
|
|
|
770
854
|
* ========================================================================
|
|
771
855
|
* Markers
|
|
772
856
|
* ======================================================================== */
|
|
773
|
-
createMarker(coordinate: Position, ordinal: number, text: string, options:
|
|
857
|
+
createMarker(coordinate: Position, ordinal: number, text: string, options: AnyMarkerOptions): void;
|
|
774
858
|
clearMarkers(): void;
|
|
775
859
|
}
|
|
776
860
|
|
|
@@ -804,6 +888,7 @@ interface IndoorMapOptions {
|
|
|
804
888
|
pixelRatio?: number;
|
|
805
889
|
locale?: string;
|
|
806
890
|
}
|
|
891
|
+
type AmenityHighlightMode = "2DMarker";
|
|
807
892
|
type SymbolSet = string | null;
|
|
808
893
|
interface IHighlightOptions {
|
|
809
894
|
symbolSet?: SymbolSet;
|
|
@@ -816,6 +901,72 @@ interface ISetHighlightElementIdsOptions {
|
|
|
816
901
|
highlight3DOptions?: IHighlightOptions;
|
|
817
902
|
highlight2DOptions?: ISetHighlight2DElementIdsOptions;
|
|
818
903
|
}
|
|
904
|
+
interface IMapExtrudeConfig {
|
|
905
|
+
height: number;
|
|
906
|
+
category: string;
|
|
907
|
+
}
|
|
908
|
+
interface ILightConfig {
|
|
909
|
+
ambientLight: IMapLightConfig;
|
|
910
|
+
directionalLight: IMapLightConfig;
|
|
911
|
+
}
|
|
912
|
+
interface IMapLightConfig {
|
|
913
|
+
color: string;
|
|
914
|
+
position?: number[];
|
|
915
|
+
intensity: number;
|
|
916
|
+
}
|
|
917
|
+
interface IExtrudeConfig {
|
|
918
|
+
kiosk: IMapExtrudeConfig[];
|
|
919
|
+
unit: IMapExtrudeConfig[];
|
|
920
|
+
}
|
|
921
|
+
interface IShortestPathConfig {
|
|
922
|
+
resolution: number;
|
|
923
|
+
}
|
|
924
|
+
interface IAllVenuesViewConfig {
|
|
925
|
+
zoom?: number;
|
|
926
|
+
pitch?: number;
|
|
927
|
+
center?: Coordinate;
|
|
928
|
+
bearing?: number;
|
|
929
|
+
}
|
|
930
|
+
interface IMapAnimation {
|
|
931
|
+
[k: string]: {
|
|
932
|
+
enable?: boolean;
|
|
933
|
+
speed?: number;
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
interface IUnitDistanceModifier {
|
|
937
|
+
[k: string]: number;
|
|
938
|
+
}
|
|
939
|
+
type IGraphOptions = {
|
|
940
|
+
baseDistance?: number;
|
|
941
|
+
multiplier?: number;
|
|
942
|
+
};
|
|
943
|
+
type IVerticalGraphOptions = IGraphOptions & {
|
|
944
|
+
scaleDistanceByLevel?: boolean;
|
|
945
|
+
};
|
|
946
|
+
interface IGraphFeatureOptions {
|
|
947
|
+
traversal?: IUnitDistanceModifier;
|
|
948
|
+
escalator?: IGraphOptions;
|
|
949
|
+
ramp?: IGraphOptions;
|
|
950
|
+
elevator?: IGraphOptions;
|
|
951
|
+
stairs?: IVerticalGraphOptions;
|
|
952
|
+
}
|
|
953
|
+
interface IMapConfig {
|
|
954
|
+
amenity_highlight_mode?: AmenityHighlightMode;
|
|
955
|
+
default_zoom?: number;
|
|
956
|
+
max_zoom?: number;
|
|
957
|
+
min_zoom?: number;
|
|
958
|
+
kiosk_pixel_ratio?: number;
|
|
959
|
+
mobile_pixel_ratio?: number;
|
|
960
|
+
extrude?: IExtrudeConfig;
|
|
961
|
+
light?: ILightConfig;
|
|
962
|
+
shortest_path?: IShortestPathConfig;
|
|
963
|
+
text_marker_type?: "marker" | "ui-marker";
|
|
964
|
+
extent_features_scale_factor?: number;
|
|
965
|
+
extent_scale_map_view_factor?: number;
|
|
966
|
+
all_venues_view?: IAllVenuesViewConfig;
|
|
967
|
+
animations?: IMapAnimation[];
|
|
968
|
+
prepare_steps?: IGraphFeatureOptions;
|
|
969
|
+
}
|
|
819
970
|
|
|
820
971
|
declare class IndoorMap extends EventTarget {
|
|
821
972
|
#private;
|
|
@@ -1032,11 +1183,7 @@ declare function styledFeatureGenerator(mapTheme: any): {
|
|
|
1032
1183
|
create3DAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
|
|
1033
1184
|
create3DOccupantAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
|
|
1034
1185
|
create3DOpeningMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
|
|
1035
|
-
createVenue3DModel: (venue: any, threeLayer: any) => Promise<any[]>;
|
|
1036
|
-
create3DFixture: (fixture: any, threeLayer: any) => Promise<any[]>;
|
|
1037
1186
|
createExtrudedUnit: (unit: any, threeLayer: any, options: any) => any;
|
|
1038
|
-
createAmbientLight: (config: any) => AmbientLight;
|
|
1039
|
-
createDirectionalLight: (config: any) => DirectionalLight;
|
|
1040
1187
|
};
|
|
1041
1188
|
declare function getLocationByAmenity(feature: any): any;
|
|
1042
1189
|
declare function getLocationByOccupant(feature: any): any;
|
|
@@ -1127,4 +1274,4 @@ declare const VENUE_EVENTS: {
|
|
|
1127
1274
|
VENUE_MOVEINTOVIEW: string;
|
|
1128
1275
|
};
|
|
1129
1276
|
|
|
1130
|
-
export { ALL_FEATURE_TYPES, ALWAYS_VISIBLE_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, BASE_LAYER_NAME, DEFAULT_BASE_URL, DEFAULT_HIGHLIGHT_OPTIONS, DEFAULT_LOCALE, DEFAULT_SET_HIGHLIGHT_2DELEMENT_IDS_OPTIONS, DESTINATION_MARKER_ID, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, HIGHLIGHT_LAYER_NAME, IMDF_FEATURE_TYPES, type Id, type ImdfFeature, IndoorMap, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, LAST_USER_LOCATION_ELEMENT_ID_PREFIX, LAYERS, LAYER_FEATURE_TYPE_OBJ, LAYER_OPTIONS, LOCALE_SYMBOL_KEY, type LabelFeature, type LabelGeometry, type LabelProperties, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, MARKER_LAYER_NAME, type Media, type MediaFile, type Model3d, NONIMDF_FEATURE_TYPES, ORIGIN_MARKER_ID, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, POI_MARKER_LAYER_NAME, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, type RelationshipFeature, type RelationshipGeometry, type RelationshipProperties, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, USER_LOCATION_ELEMENT_ID, USER_LOCATION_LAYER_NAME, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, VENUE_EVENTS, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, createPolygonFromLineString, createSpriteMaterialByLabelSymbol, createStyledUIMarkerElement, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getBearingBetweenPoints, getCenterFromGeometry, getDataClient, getExtrudeConfigByFeature, getFeatureByLocationId, getLocationByAmenity, getLocationByFeature, getLocationByOccupant, getLocationIdByFeature, getOrdinalByLocationId, getRelatedLocationIdsByFeature, getRelatedLocationsByAmenity, getRelatedLocationsByFeature, getRelatedLocationsByOccupant, getSuitablyValueBetweenBearings, isClickableFeature, safeFetchFeature, styledFeatureGenerator };
|
|
1277
|
+
export { ALL_FEATURE_TYPES, ALWAYS_VISIBLE_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, BASE_LAYER_NAME, DEFAULT_BASE_URL, DEFAULT_HIGHLIGHT_OPTIONS, DEFAULT_LOCALE, DEFAULT_SET_HIGHLIGHT_2DELEMENT_IDS_OPTIONS, DESTINATION_MARKER_ID, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, HIGHLIGHT_LAYER_NAME, type IAllVenuesViewConfig, type IExtrudeConfig, type IGraphFeatureOptions, type IGraphOptions, type IHighlightOptions, IMDF_FEATURE_TYPES, type IMapAnimation, type IMapConfig, type IMapExtrudeConfig, type ISetHighlight2DElementIdsOptions, type ISetHighlightElementIdsOptions, type IUnitDistanceModifier, type IVerticalGraphOptions, type Id, type ImdfFeature, IndoorMap, type IndoorMapOptions, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, LAST_USER_LOCATION_ELEMENT_ID_PREFIX, LAYERS, LAYER_FEATURE_TYPE_OBJ, LAYER_OPTIONS, LOCALE_SYMBOL_KEY, type LabelFeature, type LabelGeometry, type LabelProperties, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, MARKER_LAYER_NAME, type Media, type MediaFile, type Model3d, NONIMDF_FEATURE_TYPES, ORIGIN_MARKER_ID, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, POI_MARKER_LAYER_NAME, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, type RelationshipFeature, type RelationshipGeometry, type RelationshipProperties, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type SymbolSet, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, USER_LOCATION_ELEMENT_ID, USER_LOCATION_LAYER_NAME, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, VENUE_EVENTS, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, createPolygonFromLineString, createSpriteMaterialByLabelSymbol, createStyledUIMarkerElement, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getBearingBetweenPoints, getCenterFromGeometry, getDataClient, getExtrudeConfigByFeature, getFeatureByLocationId, getLocationByAmenity, getLocationByFeature, getLocationByOccupant, getLocationIdByFeature, getOrdinalByLocationId, getRelatedLocationIdsByFeature, getRelatedLocationsByAmenity, getRelatedLocationsByFeature, getRelatedLocationsByOccupant, getSuitablyValueBetweenBearings, isClickableFeature, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature, styledFeatureGenerator };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,12 +6,12 @@ import * as maptalks_dist_core_Class from 'maptalks/dist/core/Class';
|
|
|
6
6
|
import * as maptalks from 'maptalks-gl';
|
|
7
7
|
import { Map } from 'maptalks-gl';
|
|
8
8
|
import { BaseObject, ThreeLayer } from 'maptalks.three';
|
|
9
|
-
import {
|
|
9
|
+
import { Extent, Coordinate, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
|
|
10
|
+
import { BaseObjectOptionType, ExtrudePolygonOptionType } from 'maptalks.three/dist/type';
|
|
10
11
|
import { PolygonOptionsType } from 'maptalks/dist/geometry/Polygon';
|
|
11
12
|
import { LineStringOptionsType } from 'maptalks/dist/geometry/LineString';
|
|
12
|
-
import { Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
|
|
13
13
|
import { MapViewType, MapAnimationOptionsType, MapPaddingType } from 'maptalks/dist/map/Map';
|
|
14
|
-
import { SpriteMaterial
|
|
14
|
+
import { SpriteMaterial } from 'three';
|
|
15
15
|
|
|
16
16
|
type Id = string;
|
|
17
17
|
type MediaFile = {
|
|
@@ -182,6 +182,7 @@ type OccupantProperties = EntityTimestamps & {
|
|
|
182
182
|
kiosk_ids: Id[];
|
|
183
183
|
unit_ids: Id[];
|
|
184
184
|
website_link: string | null;
|
|
185
|
+
show_name_on_all_units: boolean;
|
|
185
186
|
};
|
|
186
187
|
type OccupantFeature = ImdfFeature<OccupantGeometry, OccupantProperties>;
|
|
187
188
|
type OpeningGeometry = LineString;
|
|
@@ -532,10 +533,13 @@ type OccupantFeaturePopulated = OccupantFeature & {
|
|
|
532
533
|
* [IMDF] Occupant's position
|
|
533
534
|
*/
|
|
534
535
|
anchor: AnchorFeaturePopulated;
|
|
536
|
+
ordinal: number;
|
|
535
537
|
/**
|
|
536
538
|
* [venue.in.th] Occupant's category
|
|
537
539
|
*/
|
|
538
540
|
local_categories: TaxonomyFeaturePopulated[];
|
|
541
|
+
unit?: UnitFeaturePopulated;
|
|
542
|
+
kiosk?: KioskFeaturePopulated;
|
|
539
543
|
/**
|
|
540
544
|
* [venue.in.th] Bind correlation between units on an occupant,
|
|
541
545
|
* which will be used for highlighting in the floor plan and
|
|
@@ -712,8 +716,86 @@ declare const safeFetchFeature: <T extends FeatureType = FeatureType>(featureTyp
|
|
|
712
716
|
baseUrl: string;
|
|
713
717
|
}) => Promise<FeatureResponseMap[T][]>;
|
|
714
718
|
|
|
719
|
+
/**
|
|
720
|
+
* Checks if a point is a valid coordinate pair.
|
|
721
|
+
*
|
|
722
|
+
* @param point - The point to be checked.
|
|
723
|
+
* @return True if the point is a valid coordinate pair, false otherwise.
|
|
724
|
+
*/
|
|
725
|
+
declare const isValidCoordinate: (point: Position) => boolean;
|
|
726
|
+
/**
|
|
727
|
+
* Checks if an input represents a valid polygon, which may include holes.
|
|
728
|
+
* The input can be a single array of coordinates for simple polygons, or
|
|
729
|
+
* an array of arrays of coordinates for polygons with holes.
|
|
730
|
+
*
|
|
731
|
+
* @param polygon - The input representing a polygon.
|
|
732
|
+
* @return True if the polygon is valid, false otherwise.
|
|
733
|
+
*/
|
|
734
|
+
declare const isValidPolygonCoordinates: (polygon: Position[] | Position[][]) => boolean;
|
|
735
|
+
/**
|
|
736
|
+
* Checks if an array of polygons forms a valid MultiPolygon.
|
|
737
|
+
*
|
|
738
|
+
* @param multipolygon - The array of polygons.
|
|
739
|
+
* @return True if the multipolygon is valid, false otherwise.
|
|
740
|
+
*/
|
|
741
|
+
declare const isValidMultiPolygonCoordinates: (multipolygon: Position[][][]) => boolean;
|
|
742
|
+
/**
|
|
743
|
+
* Checks if a set of points forms a valid LineString.
|
|
744
|
+
* A valid LineString must have at least two points, each point must be a valid coordinate,
|
|
745
|
+
* and it should not form a closed loop.
|
|
746
|
+
*
|
|
747
|
+
* @param lineString - The array of points representing a LineString.
|
|
748
|
+
* @return True if the LineString is valid, false otherwise.
|
|
749
|
+
*/
|
|
750
|
+
declare const isValidLineStringCoordinates: (lineString: Position[]) => boolean;
|
|
751
|
+
declare const isValidMultiPolygon: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
|
|
752
|
+
declare const isValidPolygon: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
|
|
753
|
+
declare const isValidLineString: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
|
|
754
|
+
declare const isValidPoint: (geometry: Exclude<Geometry, GeometryCollection>) => boolean;
|
|
755
|
+
|
|
756
|
+
declare function matchFilter(value: Value | Value[], filter: Filter): boolean;
|
|
757
|
+
declare function matchFilters<T extends Record<string, any>>(item: T, filters: Filters): boolean;
|
|
758
|
+
|
|
759
|
+
declare const getOccupantMainLocation: (occupant: OccupantFeaturePopulated) => UnitFeaturePopulated | KioskFeaturePopulated;
|
|
760
|
+
declare const getOccupantCorrelatedLocations: (occupant: OccupantFeaturePopulated) => Array<UnitFeaturePopulated | KioskFeaturePopulated>;
|
|
761
|
+
type OccupantMarkerPlacementType = 'ONCE_PER_LEVEL' | 'ALL_LOCATIONS';
|
|
762
|
+
declare const getOccupantMarkerLocations: (occupant: OccupantFeaturePopulated, options?: {
|
|
763
|
+
type: OccupantMarkerPlacementType;
|
|
764
|
+
}) => Array<UnitFeaturePopulated | KioskFeaturePopulated>;
|
|
765
|
+
|
|
766
|
+
type occupantHelper_OccupantMarkerPlacementType = OccupantMarkerPlacementType;
|
|
767
|
+
declare const occupantHelper_getOccupantCorrelatedLocations: typeof getOccupantCorrelatedLocations;
|
|
768
|
+
declare const occupantHelper_getOccupantMainLocation: typeof getOccupantMainLocation;
|
|
769
|
+
declare const occupantHelper_getOccupantMarkerLocations: typeof getOccupantMarkerLocations;
|
|
770
|
+
declare namespace occupantHelper {
|
|
771
|
+
export { type occupantHelper_OccupantMarkerPlacementType as OccupantMarkerPlacementType, occupantHelper_getOccupantCorrelatedLocations as getOccupantCorrelatedLocations, occupantHelper_getOccupantMainLocation as getOccupantMainLocation, occupantHelper_getOccupantMarkerLocations as getOccupantMarkerLocations };
|
|
772
|
+
}
|
|
773
|
+
|
|
715
774
|
declare const getDataClient: (options: VenueClientOptions) => VenueDataClient;
|
|
716
775
|
|
|
776
|
+
type TextMarkerOptions = BaseObjectOptionType & {
|
|
777
|
+
text?: string;
|
|
778
|
+
textAlign?: CanvasTextAlign;
|
|
779
|
+
color?: CanvasFillStrokeStyles["fillStyle"];
|
|
780
|
+
fontFamily?: string;
|
|
781
|
+
fontSize?: number;
|
|
782
|
+
fontWeight?: number;
|
|
783
|
+
background?: CanvasFillStrokeStyles["fillStyle"];
|
|
784
|
+
lineHeight?: number;
|
|
785
|
+
strokeColor?: CanvasFillStrokeStyles["strokeStyle"];
|
|
786
|
+
strokeWidth?: number;
|
|
787
|
+
strokeStyle?: CanvasLineJoin;
|
|
788
|
+
padding?: number;
|
|
789
|
+
maxWidth?: number;
|
|
790
|
+
scale?: number;
|
|
791
|
+
altitude?: number;
|
|
792
|
+
bottomHeight?: number;
|
|
793
|
+
opacity?: number | {
|
|
794
|
+
stops: Stop[];
|
|
795
|
+
};
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
type Stop = [zoom: number, value: number];
|
|
717
799
|
/** 2D */
|
|
718
800
|
type TypeRenderOptions<TOptionsType> = {
|
|
719
801
|
default: TOptionsType;
|
|
@@ -748,6 +830,8 @@ type RendererManagerOptions = BaseRenderManagerOptions & {
|
|
|
748
830
|
elements: Element3DRendererOptions;
|
|
749
831
|
};
|
|
750
832
|
|
|
833
|
+
type AnyMarkerOptions = TextMarkerOptions;
|
|
834
|
+
|
|
751
835
|
declare class RendererManager extends EventTarget {
|
|
752
836
|
#private;
|
|
753
837
|
map: maptalks.Map;
|
|
@@ -770,7 +854,7 @@ declare class RendererManager extends EventTarget {
|
|
|
770
854
|
* ========================================================================
|
|
771
855
|
* Markers
|
|
772
856
|
* ======================================================================== */
|
|
773
|
-
createMarker(coordinate: Position, ordinal: number, text: string, options:
|
|
857
|
+
createMarker(coordinate: Position, ordinal: number, text: string, options: AnyMarkerOptions): void;
|
|
774
858
|
clearMarkers(): void;
|
|
775
859
|
}
|
|
776
860
|
|
|
@@ -804,6 +888,7 @@ interface IndoorMapOptions {
|
|
|
804
888
|
pixelRatio?: number;
|
|
805
889
|
locale?: string;
|
|
806
890
|
}
|
|
891
|
+
type AmenityHighlightMode = "2DMarker";
|
|
807
892
|
type SymbolSet = string | null;
|
|
808
893
|
interface IHighlightOptions {
|
|
809
894
|
symbolSet?: SymbolSet;
|
|
@@ -816,6 +901,72 @@ interface ISetHighlightElementIdsOptions {
|
|
|
816
901
|
highlight3DOptions?: IHighlightOptions;
|
|
817
902
|
highlight2DOptions?: ISetHighlight2DElementIdsOptions;
|
|
818
903
|
}
|
|
904
|
+
interface IMapExtrudeConfig {
|
|
905
|
+
height: number;
|
|
906
|
+
category: string;
|
|
907
|
+
}
|
|
908
|
+
interface ILightConfig {
|
|
909
|
+
ambientLight: IMapLightConfig;
|
|
910
|
+
directionalLight: IMapLightConfig;
|
|
911
|
+
}
|
|
912
|
+
interface IMapLightConfig {
|
|
913
|
+
color: string;
|
|
914
|
+
position?: number[];
|
|
915
|
+
intensity: number;
|
|
916
|
+
}
|
|
917
|
+
interface IExtrudeConfig {
|
|
918
|
+
kiosk: IMapExtrudeConfig[];
|
|
919
|
+
unit: IMapExtrudeConfig[];
|
|
920
|
+
}
|
|
921
|
+
interface IShortestPathConfig {
|
|
922
|
+
resolution: number;
|
|
923
|
+
}
|
|
924
|
+
interface IAllVenuesViewConfig {
|
|
925
|
+
zoom?: number;
|
|
926
|
+
pitch?: number;
|
|
927
|
+
center?: Coordinate;
|
|
928
|
+
bearing?: number;
|
|
929
|
+
}
|
|
930
|
+
interface IMapAnimation {
|
|
931
|
+
[k: string]: {
|
|
932
|
+
enable?: boolean;
|
|
933
|
+
speed?: number;
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
interface IUnitDistanceModifier {
|
|
937
|
+
[k: string]: number;
|
|
938
|
+
}
|
|
939
|
+
type IGraphOptions = {
|
|
940
|
+
baseDistance?: number;
|
|
941
|
+
multiplier?: number;
|
|
942
|
+
};
|
|
943
|
+
type IVerticalGraphOptions = IGraphOptions & {
|
|
944
|
+
scaleDistanceByLevel?: boolean;
|
|
945
|
+
};
|
|
946
|
+
interface IGraphFeatureOptions {
|
|
947
|
+
traversal?: IUnitDistanceModifier;
|
|
948
|
+
escalator?: IGraphOptions;
|
|
949
|
+
ramp?: IGraphOptions;
|
|
950
|
+
elevator?: IGraphOptions;
|
|
951
|
+
stairs?: IVerticalGraphOptions;
|
|
952
|
+
}
|
|
953
|
+
interface IMapConfig {
|
|
954
|
+
amenity_highlight_mode?: AmenityHighlightMode;
|
|
955
|
+
default_zoom?: number;
|
|
956
|
+
max_zoom?: number;
|
|
957
|
+
min_zoom?: number;
|
|
958
|
+
kiosk_pixel_ratio?: number;
|
|
959
|
+
mobile_pixel_ratio?: number;
|
|
960
|
+
extrude?: IExtrudeConfig;
|
|
961
|
+
light?: ILightConfig;
|
|
962
|
+
shortest_path?: IShortestPathConfig;
|
|
963
|
+
text_marker_type?: "marker" | "ui-marker";
|
|
964
|
+
extent_features_scale_factor?: number;
|
|
965
|
+
extent_scale_map_view_factor?: number;
|
|
966
|
+
all_venues_view?: IAllVenuesViewConfig;
|
|
967
|
+
animations?: IMapAnimation[];
|
|
968
|
+
prepare_steps?: IGraphFeatureOptions;
|
|
969
|
+
}
|
|
819
970
|
|
|
820
971
|
declare class IndoorMap extends EventTarget {
|
|
821
972
|
#private;
|
|
@@ -1032,11 +1183,7 @@ declare function styledFeatureGenerator(mapTheme: any): {
|
|
|
1032
1183
|
create3DAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
|
|
1033
1184
|
create3DOccupantAmenityMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
|
|
1034
1185
|
create3DOpeningMarker: (feature: any, threeLayer: any, config: any) => SpriteMarker;
|
|
1035
|
-
createVenue3DModel: (venue: any, threeLayer: any) => Promise<any[]>;
|
|
1036
|
-
create3DFixture: (fixture: any, threeLayer: any) => Promise<any[]>;
|
|
1037
1186
|
createExtrudedUnit: (unit: any, threeLayer: any, options: any) => any;
|
|
1038
|
-
createAmbientLight: (config: any) => AmbientLight;
|
|
1039
|
-
createDirectionalLight: (config: any) => DirectionalLight;
|
|
1040
1187
|
};
|
|
1041
1188
|
declare function getLocationByAmenity(feature: any): any;
|
|
1042
1189
|
declare function getLocationByOccupant(feature: any): any;
|
|
@@ -1127,4 +1274,4 @@ declare const VENUE_EVENTS: {
|
|
|
1127
1274
|
VENUE_MOVEINTOVIEW: string;
|
|
1128
1275
|
};
|
|
1129
1276
|
|
|
1130
|
-
export { ALL_FEATURE_TYPES, ALWAYS_VISIBLE_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, BASE_LAYER_NAME, DEFAULT_BASE_URL, DEFAULT_HIGHLIGHT_OPTIONS, DEFAULT_LOCALE, DEFAULT_SET_HIGHLIGHT_2DELEMENT_IDS_OPTIONS, DESTINATION_MARKER_ID, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, HIGHLIGHT_LAYER_NAME, IMDF_FEATURE_TYPES, type Id, type ImdfFeature, IndoorMap, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, LAST_USER_LOCATION_ELEMENT_ID_PREFIX, LAYERS, LAYER_FEATURE_TYPE_OBJ, LAYER_OPTIONS, LOCALE_SYMBOL_KEY, type LabelFeature, type LabelGeometry, type LabelProperties, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, MARKER_LAYER_NAME, type Media, type MediaFile, type Model3d, NONIMDF_FEATURE_TYPES, ORIGIN_MARKER_ID, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, POI_MARKER_LAYER_NAME, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, type RelationshipFeature, type RelationshipGeometry, type RelationshipProperties, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, USER_LOCATION_ELEMENT_ID, USER_LOCATION_LAYER_NAME, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, VENUE_EVENTS, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, createPolygonFromLineString, createSpriteMaterialByLabelSymbol, createStyledUIMarkerElement, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getBearingBetweenPoints, getCenterFromGeometry, getDataClient, getExtrudeConfigByFeature, getFeatureByLocationId, getLocationByAmenity, getLocationByFeature, getLocationByOccupant, getLocationIdByFeature, getOrdinalByLocationId, getRelatedLocationIdsByFeature, getRelatedLocationsByAmenity, getRelatedLocationsByFeature, getRelatedLocationsByOccupant, getSuitablyValueBetweenBearings, isClickableFeature, safeFetchFeature, styledFeatureGenerator };
|
|
1277
|
+
export { ALL_FEATURE_TYPES, ALWAYS_VISIBLE_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, BASE_LAYER_NAME, DEFAULT_BASE_URL, DEFAULT_HIGHLIGHT_OPTIONS, DEFAULT_LOCALE, DEFAULT_SET_HIGHLIGHT_2DELEMENT_IDS_OPTIONS, DESTINATION_MARKER_ID, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, HIGHLIGHT_LAYER_NAME, type IAllVenuesViewConfig, type IExtrudeConfig, type IGraphFeatureOptions, type IGraphOptions, type IHighlightOptions, IMDF_FEATURE_TYPES, type IMapAnimation, type IMapConfig, type IMapExtrudeConfig, type ISetHighlight2DElementIdsOptions, type ISetHighlightElementIdsOptions, type IUnitDistanceModifier, type IVerticalGraphOptions, type Id, type ImdfFeature, IndoorMap, type IndoorMapOptions, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, LAST_USER_LOCATION_ELEMENT_ID_PREFIX, LAYERS, LAYER_FEATURE_TYPE_OBJ, LAYER_OPTIONS, LOCALE_SYMBOL_KEY, type LabelFeature, type LabelGeometry, type LabelProperties, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, MARKER_LAYER_NAME, type Media, type MediaFile, type Model3d, NONIMDF_FEATURE_TYPES, ORIGIN_MARKER_ID, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, POI_MARKER_LAYER_NAME, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, type RelationshipFeature, type RelationshipGeometry, type RelationshipProperties, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type SymbolSet, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, USER_LOCATION_ELEMENT_ID, USER_LOCATION_LAYER_NAME, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, VENUE_EVENTS, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, createPolygonFromLineString, createSpriteMaterialByLabelSymbol, createStyledUIMarkerElement, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getBearingBetweenPoints, getCenterFromGeometry, getDataClient, getExtrudeConfigByFeature, getFeatureByLocationId, getLocationByAmenity, getLocationByFeature, getLocationByOccupant, getLocationIdByFeature, getOrdinalByLocationId, getRelatedLocationIdsByFeature, getRelatedLocationsByAmenity, getRelatedLocationsByFeature, getRelatedLocationsByOccupant, getSuitablyValueBetweenBearings, isClickableFeature, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature, styledFeatureGenerator };
|