@mappedin/react-native-sdk 5.2.2 → 5.4.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 (3) hide show
  1. package/dist/index.d.ts +109 -15
  2. package/dist/index.js +194 -194
  3. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -305,6 +305,10 @@ declare module '@mappedin/react-native-sdk/wrappers/react-native-sdk/src/MiMapVi
305
305
  * Get all polygons that intersect with a specific coordinate.
306
306
  */
307
307
  getPolygonsAtCoordinate(coordinate: MappedinCoordinate, options?: TGetPolygonsAtCoordinateOptions): Promise<MappedinPolygon[]>;
308
+ /**
309
+ * Get all polygons that intersect with a specific screen coordinate.
310
+ */
311
+ getPolygonsAtScreenCoordinate(x: number, y: number, options?: TGetPolygonsAtCoordinateOptions): Promise<MappedinPolygon[]>;
308
312
  /**
309
313
  Camera controls interface
310
314
  */
@@ -1867,6 +1871,7 @@ declare module '@mappedin/react-native-sdk/wrappers/common/events' {
1867
1871
  ADD_SEARCH_QUERY = "ADD_SEARCH_QUERY",
1868
1872
  CLICK = "CLICK",
1869
1873
  GET_POLYGONS_AT_COORDINATE = "GET_POLYGONS_AT_COORDINATE",
1874
+ GET_POLYGONS_AT_SCREEN_COORDINATE = "GET_POLYGONS_AT_SCREEN_COORDINATE",
1870
1875
  CREATE_TOOLTIP = "CREATE_TOOLTIP",
1871
1876
  CREATE_CUSTOM_TOOLTIP = "CREATE_CUSTOM_TOOLTIP",
1872
1877
  REMOVE_TOOLTIP = "REMOVE_TOOLTIP"
@@ -2204,6 +2209,11 @@ declare module '@mappedin/react-native-sdk/wrappers/common/payloads' {
2204
2209
  coordinate: TSerializedCoordinate;
2205
2210
  options?: TGetPolygonsAtCoordinateOptions;
2206
2211
  };
2212
+ [EVENT.GET_POLYGONS_AT_SCREEN_COORDINATE]: {
2213
+ x: number;
2214
+ y: number;
2215
+ options?: TGetPolygonsAtCoordinateOptions;
2216
+ };
2207
2217
  [EVENT.CREATE_TOOLTIP]: {
2208
2218
  nodeOrCoordinate: TSerializedNode | TSerializedCoordinate;
2209
2219
  contentHtml: string;
@@ -2309,7 +2319,7 @@ declare module '@mappedin/react-native-sdk/wrappers/common/pub-sub' {
2309
2319
  declare module '@mappedin/react-native-sdk/core/packages/renderer/Core.interface' {
2310
2320
  import { MappedinMap, Mappedin, MappedinCoordinate, MappedinPolygon, MappedinNode } from '@mappedin/react-native-sdk/core/packages/get-venue';
2311
2321
  import { Vector2, Vector3 } from 'three';
2312
- import { changeListenerFn, TMapViewOptions } from '@mappedin/react-native-sdk/core/packages/renderer/MapView.types';
2322
+ import { changeListenerFn, TGetPolygonsAtCoordinateOptions, TMapViewOptions } from '@mappedin/react-native-sdk/core/packages/renderer/MapView.types';
2313
2323
  import RENDER from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.RenderTasks';
2314
2324
  import { INTERNAL_EVENT_PAYLOAD } from '@mappedin/react-native-sdk/core/packages/renderer/MapView';
2315
2325
  import { TPadding } from '@mappedin/react-native-sdk/core/packages/renderer';
@@ -2461,6 +2471,22 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/Core.interface
2461
2471
  * @param element The node to stop rotating. It won't reset the transform, just leave it as is.
2462
2472
  */
2463
2473
  unlockNorth(element: HTMLElement): void;
2474
+ /**
2475
+ * Returns all polygons that contain the specified MappedinCoordinate.
2476
+ *
2477
+ * @param coordinate The MappedinCoordinate to check
2478
+ * @param hoverableMeshChildren
2479
+ * @param options {@link TGetPolygonsAtCoordinateOptions}
2480
+ */
2481
+ getPolygonsAtScreenCoordinate(coordinate: Vector2, hoverableMeshChildren: any[], options?: TGetPolygonsAtCoordinateOptions): MappedinPolygon[];
2482
+ /**
2483
+ * Returns all polygons at the specified screen coordinate.
2484
+ *
2485
+ * @param coordinate The Vector2 coordinate to check
2486
+ * @param hoverableMeshChildren
2487
+ * @param options {@link TGetPolygonsAtCoordinateOptions}
2488
+ */
2489
+ getPolygonsAtCoordinate(coordinate: MappedinCoordinate, hoverableMeshChildren: any[], options?: TGetPolygonsAtCoordinateOptions): MappedinPolygon[];
2464
2490
  currentInteractionEvent: string;
2465
2491
  interactivePolygons: any;
2466
2492
  highlightedPolygons: any;
@@ -3072,6 +3098,14 @@ declare module '@mappedin/react-native-sdk/wrappers/common/controller' {
3072
3098
  options?: import("../../core/packages/renderer").TGetPolygonsAtCoordinateOptions | undefined;
3073
3099
  };
3074
3100
  };
3101
+ GET_POLYGONS_AT_SCREEN_COORDINATE: {
3102
+ msgID?: string | undefined;
3103
+ data: {
3104
+ x: number;
3105
+ y: number;
3106
+ options?: import("../../core/packages/renderer").TGetPolygonsAtCoordinateOptions | undefined;
3107
+ };
3108
+ };
3075
3109
  CREATE_TOOLTIP: {
3076
3110
  msgID?: string | undefined;
3077
3111
  data: {
@@ -3176,7 +3210,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
3176
3210
  }
3177
3211
  export type TFloatingLabelAppearance = {
3178
3212
  /**
3179
- * Margin around the label and marker. This will affect label density
3213
+ * Margin around the label and marker. This will affect label density, with a mininum of 7px around
3180
3214
  * @default 6
3181
3215
  */
3182
3216
  margin?: number;
@@ -3234,6 +3268,10 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
3234
3268
  */
3235
3269
  inactive?: string;
3236
3270
  };
3271
+ /**
3272
+ * Size of bounding box of SVG icon
3273
+ */
3274
+ iconSize?: number;
3237
3275
  /**
3238
3276
  * SVG of icon to place inside Floating Label
3239
3277
  */
@@ -3267,6 +3305,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
3267
3305
  active: string;
3268
3306
  inactive: string;
3269
3307
  };
3308
+ iconSize?: number;
3270
3309
  icon?: string;
3271
3310
  iconVisibilityThreshold?: number;
3272
3311
  };
@@ -3331,6 +3370,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
3331
3370
  static imagePromiseCache: {
3332
3371
  [key in number]?: Promise<HTMLImageElement>;
3333
3372
  };
3373
+ get pinCanvasSize(): number;
3334
3374
  draw(context: CanvasRenderingContext2D): void;
3335
3375
  }
3336
3376
  export default FloatingLabel;
@@ -3597,8 +3637,10 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/layers/BlueDot
3597
3637
  * @private
3598
3638
  */
3599
3639
  constructor(mapView: MapView, core: ICore, eventsLayer: EventSystemLayer);
3600
- on(eventName: any, fn: any): void;
3601
- off(eventName: any, fn: any): void;
3640
+ on<EVENT_NAME extends E_BLUEDOT_EVENT>(eventName: EVENT_NAME, fn: (payload: E_BLUEDOT_EVENT_PAYLOAD[EVENT_NAME] extends {
3641
+ data: null;
3642
+ } ? E_BLUEDOT_EVENT_PAYLOAD[EVENT_NAME]['data'] : E_BLUEDOT_EVENT_PAYLOAD[EVENT_NAME]) => void): void;
3643
+ off<EVENT_NAME extends E_BLUEDOT_EVENT>(eventName: EVENT_NAME, fn: (payload: E_BLUEDOT_EVENT_PAYLOAD[EVENT_NAME]) => void): void;
3602
3644
  /**
3603
3645
  * Enables Blue Dot. BlueDot then emits {@link TBlueDotStateChange} and {@link TBlueDotPositionUpdate} events via {@link E_BLUEDOT_EVENT}
3604
3646
  */
@@ -3983,6 +4025,8 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinLocat
3983
4025
  import type { MappedinPolygon } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinPolygon';
3984
4026
  import type { MappedinCategory } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinCategory';
3985
4027
  import { MappedinNavigatable, TDirectionToOptions } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNavigatable';
4028
+ import { MappedinDestinationSet } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinDestinationSet';
4029
+ import { MappedinDirections } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinDirections';
3986
4030
  export function getCurrentLocationState(location: MappedinLocation, states: MappedinLocationState[], date?: Date): MappedinLocationState | undefined;
3987
4031
  export type TOperationHoursMap = {
3988
4032
  [key in string]: TOpeningHours[];
@@ -4071,8 +4115,8 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinLocat
4071
4115
  *
4072
4116
  * Get Directions to a node, polygon, or location
4073
4117
  */
4074
- directionsTo(destination: any, options?: TDirectionToOptions): any;
4075
- directionsTo(destination: any, options?: TDirectionToOptions): any;
4118
+ directionsTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): MappedinDirections;
4119
+ directionsTo(destination: MappedinDestinationSet, options?: TDirectionToOptions): MappedinDirections[];
4076
4120
  distanceTo(destination: any, options: any): number;
4077
4121
  toJSON(): any;
4078
4122
  }
@@ -4084,6 +4128,8 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinPolyg
4084
4128
  import type { MappedinNode } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNode';
4085
4129
  import { MappedinNavigatable, TDirectionToOptions } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNavigatable';
4086
4130
  import { MappedinMap } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinMap';
4131
+ import { MappedinDestinationSet } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinDestinationSet';
4132
+ import { MappedinDirections } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinDirections';
4087
4133
  /**
4088
4134
  * The {@link MappedinPolygon} class represents the 3D shape of a {@link MappedinLocation} on a {{@link MappedinMap}. Polygons have access to Locations they belong to, and any entrances to the Polygon.
4089
4135
  *
@@ -4204,8 +4250,8 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinPolyg
4204
4250
  *
4205
4251
  * Get Directions to a node, polygon, or location
4206
4252
  */
4207
- directionsTo(destination: any, options?: TDirectionToOptions): any;
4208
- directionsTo(destination: any, options?: TDirectionToOptions): any;
4253
+ directionsTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): MappedinDirections;
4254
+ directionsTo(destination: MappedinDestinationSet, options?: TDirectionToOptions): MappedinDirections[];
4209
4255
  distanceTo(destination: any, options: any): number;
4210
4256
  toJSON(): any;
4211
4257
  }
@@ -4218,6 +4264,8 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNode'
4218
4264
  import type { TOpeningHours } from '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin.API.types';
4219
4265
  import { MappedinNavigatable, TDirectionToOptions } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNavigatable';
4220
4266
  import { MappedinMap } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinMap';
4267
+ import { MappedinDestinationSet } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinDestinationSet';
4268
+ import { MappedinDirections } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinDirections';
4221
4269
  /**
4222
4270
  * A {@link MappedinNode} represents a position, anchored to a specific {@link MappedinMap}.
4223
4271
  *
@@ -4287,8 +4335,8 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNode'
4287
4335
  *
4288
4336
  * Get Directions to a node, polygon, or location
4289
4337
  */
4290
- directionsTo(destination: any, options?: TDirectionToOptions): any;
4291
- directionsTo(destination: any, options?: TDirectionToOptions): any;
4338
+ directionsTo(destination: MappedinNode | MappedinLocation | MappedinPolygon, options?: TDirectionToOptions): MappedinDirections;
4339
+ directionsTo(destination: MappedinDestinationSet, options?: TDirectionToOptions): MappedinDirections[];
4292
4340
  distanceTo(destination: any, options: any): number;
4293
4341
  toJSON(): any;
4294
4342
  }
@@ -4779,7 +4827,7 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNavig
4779
4827
  import type { MappedinPolygon } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinPolygon';
4780
4828
  import type { MappedinNode } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNode';
4781
4829
  import { MappedinDestinationSet } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinDestinationSet';
4782
- import type { Mappedin } from '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin';
4830
+ import { Mappedin } from '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin';
4783
4831
  import { MappedinDirections } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinDirections';
4784
4832
  export type TDirectionToOptions = {
4785
4833
  accessible?: boolean;
@@ -4802,7 +4850,7 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNavig
4802
4850
  }
4803
4851
 
4804
4852
  declare module '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin.CustomerAnalytics' {
4805
- import { MappedinCategory, MappedinLocation } from '@mappedin/react-native-sdk/core/packages/get-venue';
4853
+ import { MappedinCategory, MappedinLocation, MappedinNavigatable } from '@mappedin/react-native-sdk/core/packages/get-venue';
4806
4854
  type AnalyticsOptions = {
4807
4855
  clientId?: string;
4808
4856
  clientSecret?: string;
@@ -4816,7 +4864,12 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin.Cust
4816
4864
  interface IAnalytics {
4817
4865
  locationSelected(location: MappedinLocation): void;
4818
4866
  categorySelected(category: MappedinCategory): void;
4819
- getDirections(start: MappedinLocation, end: MappedinLocation): void;
4867
+ /**
4868
+ * @hidden
4869
+ * @internal
4870
+ * @deprecated
4871
+ */
4872
+ getDirections(start: MappedinNavigatable, end: MappedinNavigatable): void;
4820
4873
  }
4821
4874
  interface IInternalAnalytics extends IAnalytics {
4822
4875
  track(target: string, query: any): void;
@@ -5642,6 +5695,13 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer' {
5642
5695
  export type { TSafeAreaInsets, TCameraTargets, TFocusOnCameraOptions, TCameraTransform, TCameraAnimationOptions, default as Camera } from '@mappedin/react-native-sdk/core/packages/renderer/Camera';
5643
5696
  export type { TGetVenueOptions, TShowVenueOptions, TMappedinOfflineSearchOptions, TMappedinOfflineSearchResult, TMappedinOfflineSearchSuggestions, TMappedinOfflineAllSearchMatch, TMappedinOfflineSearchAllOptions } from '@mappedin/react-native-sdk/core/packages/get-venue';
5644
5697
  export { Mappedin, MappedinDirections, MappedinLocation, MappedinPolygon, MappedinNode, MappedinCategory, MappedinMap, MappedinEvent, MappedinMapGroup, MappedinVenue, MappedinVortex, MappedinNavigatable, MappedinCoordinate, OfflineSearch, MAP_RENDER_MODE, setFetchFn, MappedinCollectionType } from '@mappedin/react-native-sdk/core/packages/get-venue';
5698
+ /**
5699
+ * @internal
5700
+ * @hidden
5701
+ *
5702
+ * Export this only so our internal pre-built products can use it. We don't want to document it for external developers.
5703
+ */
5704
+ export { CustomerAnalytics } from '@mappedin/react-native-sdk/core/packages/get-venue';
5645
5705
  export { BundleAssetManager } from '@mappedin/react-native-sdk/core/packages/renderer/bundle-asset-manager';
5646
5706
  /**
5647
5707
  * @internal
@@ -5972,6 +6032,19 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView' {
5972
6032
  * @returns MappedinPolygon[]
5973
6033
  */
5974
6034
  getPolygonsAtCoordinate(coordinate: MappedinCoordinate, options?: TGetPolygonsAtCoordinateOptions): MappedinPolygon[];
6035
+ /**
6036
+ * Finds all the polygons on a screen coordinate x and y. If multiple
6037
+ * polygons are stacked on top of each other, the array of polygons returned will be
6038
+ * in the order of farthest to closest.
6039
+ *
6040
+ * By default, this only considers interactive polygons.
6041
+ *
6042
+ * @param x
6043
+ * @param y
6044
+ * @param options {@link TGetPolygonsAtCoordinateOptions}
6045
+ * @returns MappedinPolygon[]
6046
+ */
6047
+ getPolygonsAtScreenCoordinate(x: number, y: number, options?: TGetPolygonsAtCoordinateOptions): MappedinPolygon[];
5975
6048
  /**
5976
6049
  * Destroy instance and reclaim memory. Note: this does not destroy the instance of {@link Mappedin}
5977
6050
  * that was passed in. For applications that require destroying and re-creating the mapView, it is
@@ -6547,8 +6620,8 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView.SceneM
6547
6620
 
6548
6621
  declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.SmartCollider' {
6549
6622
  import SmartCollisionEngine from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.SmartCollisionEngine';
6550
- import { Vector3 } from 'three';
6551
6623
  import { Rectangle } from '@mappedin/react-native-sdk/core/packages/renderer/internal/quad-tree';
6624
+ import { MappedinCoordinate, MappedinNode } from '@mappedin/react-native-sdk/core/packages/renderer/index.rn';
6552
6625
  export type TRange = [number, number, number, number];
6553
6626
  type TCustomCollider<T> = ICollider & T;
6554
6627
  export type TColliderStrategyProps = {
@@ -6575,6 +6648,10 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
6575
6648
  'show' = 1,
6576
6649
  'hide' = 2
6577
6650
  }
6651
+ export type TColliderPosition = {
6652
+ nodeOrCoordinate: MappedinNode | MappedinCoordinate;
6653
+ height?: number;
6654
+ };
6578
6655
  export interface ICollider {
6579
6656
  dimensions: TDimensions;
6580
6657
  screenPosition: [number, number];
@@ -6593,7 +6670,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
6593
6670
  offscreen?: boolean;
6594
6671
  setAction: (action: EColliderAction) => void;
6595
6672
  action?: EColliderAction;
6596
- position: Vector3;
6673
+ position: TColliderPosition;
6597
6674
  __engine?: SmartCollisionEngine;
6598
6675
  enable: () => void;
6599
6676
  disable: () => void;
@@ -7697,7 +7774,24 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
7697
7774
  loadMethodUsed: string | undefined;
7698
7775
  _dispose(objectToDispose: any): void;
7699
7776
  add(childObjectToAdd: any): void;
7777
+ /**
7778
+ * Convert lat/lon to local map position vector
7779
+ */
7700
7780
  getPositionLatLon(lat: any, lon: any): any;
7781
+ /**
7782
+ * Previously, each map was centered around 0,0,0 and scaled to fit the map.
7783
+ * With scene manager, each map is positioned and scaled relative to the base map/world
7784
+ * Since most 3D objects (like blue dot) are added to the map via `getPositionLatLon`, they already
7785
+ * have the map's matrix applied, on top of being affected as a child of the map's own transform
7786
+ * This method inverts the map's matrix to resolve the double matrix application issue.
7787
+ * TODO: investigate a better way to handle this
7788
+ */
7789
+ addToObject(child: any): void;
7790
+ /**
7791
+ * Translates objects that are added to the map (such as blue dot), assuming they are added via `getPositionLatLon`,
7792
+ * or `convertTo3DMapPosition`, where the map's matrix has already been applied.
7793
+ */
7794
+ translateChild(child: any, position: any): void;
7701
7795
  getMapScale(): null;
7702
7796
  getNorth(): null;
7703
7797
  disableAllImageFlipping(): void;