@mappedin/react-native-sdk 4.1.2 → 4.1.4

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/README.md CHANGED
@@ -336,33 +336,28 @@ Example:
336
336
 
337
337
  ```
338
338
 
339
- ## Get Directions from One Location to Another and show path and connections on map
339
+ ## Get directions from one location to another and show path and connections on map
340
340
 
341
341
  ```tsx
342
342
  import { MiMapView } from '@mappedin/react-native-sdk';
343
343
  import type {
344
- TBlueDotUpdate,
345
- MapViewStore,
346
344
  MappedinLocation,
347
- MappedinNode,
345
+ MapViewStore,
346
+ MappedinPolygon,
348
347
  } from '@mappedin/react-native-sdk';
349
348
 
350
- // Imperative API
351
- const mapView = React.useRef<MapViewStore>();
352
- const [destination, setDestination] = React.useRef<MappedinLocation>();
353
- const [departure, setDeparture] = React.useState<MappedinLocation>({});
354
-
355
349
  const App = () => {
350
+ const mapView = React.useRef<MapViewStore>(null);
351
+ const [destination, setDestination] = React.useState<MappedinLocation>(null);
352
+ const [departure, setDeparture] = React.useState<MappedinLocation>(null);
353
+
356
354
  return (
357
355
  <>
358
356
  <MiMapView
359
- style={{ flex: 1 }}
357
+ style={{flex: 1}}
360
358
  ref={mapView}
361
359
  options={options}
362
- onDataLoaded={() => {
363
- mapView.current.BlueDot.enable();
364
- }}
365
- onPolygonClicked={({ polygon: MappedinPolygon }) => {
360
+ onPolygonClicked={({polygon: MappedinPolygon}) => {
366
361
  // first, let's set departure
367
362
  if (departure == null) {
368
363
  setDeparture(polygon.locations[0]);
@@ -379,25 +374,24 @@ const App = () => {
379
374
  // get Directions
380
375
  const directions = departure.directionsTo(destination);
381
376
  // draw path on map
382
- await controller.current?.Journey.draw(directions);
377
+ await mapView.current?.Journey.draw(directions);
383
378
  // focus on the path
384
- controller.current?.Camera.focusOn({ targets: {
379
+ mapView.current?.Camera.focusOn({
380
+ targets: {
385
381
  nodes: directions.path,
386
- }
382
+ },
387
383
  });
388
384
  } catch (e) {
389
385
  console.error(e);
390
386
  }
391
- }}
392
- ></Button>
387
+ }}></Button>
393
388
  <Button
394
389
  title="Reset"
395
390
  onPress={() => {
396
- mapView.current.clearAllPaths();
391
+ mapView.current?.removeAllPaths();
397
392
  setDeparture(undefined);
398
393
  setDestination(undefined);
399
- }}
400
- ></Button>
394
+ }}></Button>
401
395
  </>
402
396
  );
403
397
  };
package/dist/index.d.ts CHANGED
@@ -226,7 +226,24 @@ declare module '@mappedin/react-native-sdk/wrappers/react-native-sdk/src/MiMapVi
226
226
  /**
227
227
  * Set Polygon Color
228
228
  */
229
- setPolygonColor(polygonIdOrPolygon: MappedinPolygon['id'] | MappedinPolygon, color: string, opacity?: number, textColor?: string): Promise<unknown>;
229
+ setPolygonColor(
230
+ /**
231
+ * Polygon or PolygonId
232
+ */
233
+ polygonIdOrPolygon: MappedinPolygon['id'] | MappedinPolygon,
234
+ /**
235
+ * Color to use
236
+ */
237
+ color: string,
238
+ /**
239
+ * Opacity of polygon after setting color
240
+ * @deprecated
241
+ */
242
+ opacity?: number,
243
+ /**
244
+ * Color of flat label text on polygon
245
+ */
246
+ textColor?: string): Promise<unknown>;
230
247
  /**
231
248
  * Clear Polygon Color
232
249
  */
@@ -645,11 +662,14 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue' {
645
662
  };
646
663
  };
647
664
  export { MAP_RENDER_MODE };
648
- export function getVenueMVF(userOptions: TGetVenueBundleOptions): Promise<Mappedin>;
649
665
  /**
650
666
  * Get Venue Data for a Mappedin Venue
651
667
  */
652
668
  export function getVenue(userOptions: TGetVenueOptions): Promise<Mappedin>;
669
+ /**
670
+ * @internal
671
+ */
672
+ export function __setGetVenueMock(fn: any): void;
653
673
  export type TGetVenueBundleOptions = TGetVenueOptions & {
654
674
  bundleBaseUri?: string;
655
675
  version?: string;
@@ -961,7 +981,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView.types'
961
981
  icon: string;
962
982
  location?: MappedinLocation;
963
983
  };
964
- export type TMarkerTemplateFn = ({ icon: string, location: MappedinLocation }: TMarkerTemplateProps) => string;
984
+ export type TMarkerTemplateFn = ({ icon, location }: TMarkerTemplateProps) => string;
965
985
  export type TJourneyOptions = {
966
986
  /**
967
987
  * What color to highlight departure and destination polygons
@@ -1307,7 +1327,6 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView.types'
1307
1327
  };
1308
1328
  export type TFloatingLabelPolygonOptions = TCommonLabelOptions & {
1309
1329
  scale?: number;
1310
- flatLabels?: false | undefined;
1311
1330
  /**
1312
1331
  * Ranking tier to determine how likely a {@link FloatingLabel} will appear
1313
1332
  */
@@ -1625,7 +1644,12 @@ declare module '@mappedin/react-native-sdk/wrappers/common/events' {
1625
1644
  MAP_CHANGED = "MAP_CHANGED",
1626
1645
  ROTATION_CHANGED = "ROTATION_CHANGED",
1627
1646
  TILT_CHANGED = "TILT_CHANGED",
1647
+ ZOOM_CHANGED = "ZOOM_CHANGED",
1628
1648
  CAMERA_SET = "CAMERA_SET",
1649
+ /**
1650
+ * @deprecated
1651
+ */
1652
+ SET_ZOOM = "SET_ZOOM",
1629
1653
  /**
1630
1654
  * @deprecated
1631
1655
  */
@@ -1776,6 +1800,9 @@ declare module '@mappedin/react-native-sdk/wrappers/common/payloads' {
1776
1800
  [EVENT.TILT_CHANGED]: {
1777
1801
  tilt: number;
1778
1802
  };
1803
+ [EVENT.ZOOM_CHANGED]: {
1804
+ zoom: number;
1805
+ };
1779
1806
  [EVENT.UPDATE_GEOLOCATION]: {
1780
1807
  msgID: undefined;
1781
1808
  data: unknown;
@@ -1835,6 +1862,9 @@ declare module '@mappedin/react-native-sdk/wrappers/common/payloads' {
1835
1862
  [EVENT.SET_TILT]: {
1836
1863
  tilt: number;
1837
1864
  };
1865
+ [EVENT.SET_ZOOM]: {
1866
+ zoom: number;
1867
+ };
1838
1868
  [EVENT.CAMERA_SET_SAFE_AREA_INSETS]: {
1839
1869
  safeAreaInsets: {
1840
1870
  top: number;
@@ -2331,7 +2361,10 @@ declare module '@mappedin/react-native-sdk/wrappers/common/controller' {
2331
2361
  CACHE_IMAGE: {
2332
2362
  msgID?: string | undefined;
2333
2363
  data: {
2334
- url?: string | undefined;
2364
+ url?: string | undefined; /**
2365
+ * Send a message to the other side of the bridge
2366
+ *
2367
+ * @hidden
2335
2368
  options: import("../react-native-sdk/src").TGetVenueOptions;
2336
2369
  locationId: string;
2337
2370
  polygonHighlightColor?: string | undefined;
@@ -2388,6 +2421,12 @@ declare module '@mappedin/react-native-sdk/wrappers/common/controller' {
2388
2421
  tilt: number;
2389
2422
  };
2390
2423
  };
2424
+ ZOOM_CHANGED: {
2425
+ msgID?: string | undefined;
2426
+ data: {
2427
+ zoom: number;
2428
+ };
2429
+ };
2391
2430
  UPDATE_GEOLOCATION: {
2392
2431
  msgID?: string | undefined;
2393
2432
  data: {
@@ -2463,6 +2502,12 @@ declare module '@mappedin/react-native-sdk/wrappers/common/controller' {
2463
2502
  tilt: number;
2464
2503
  };
2465
2504
  };
2505
+ SET_ZOOM: {
2506
+ msgID?: string | undefined;
2507
+ data: {
2508
+ zoom: number;
2509
+ };
2510
+ };
2466
2511
  CAMERA_SET_SAFE_AREA_INSETS: {
2467
2512
  msgID?: string | undefined;
2468
2513
  data: {
@@ -4371,6 +4416,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
4371
4416
  };
4372
4417
  };
4373
4418
  export type TFloatingLabelOptionsInternal = {
4419
+ id: string;
4374
4420
  position?: Vector3;
4375
4421
  polygon: MappedinPolygon;
4376
4422
  polygonHeight?: number;
@@ -4400,6 +4446,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
4400
4446
  contextConfigured: boolean;
4401
4447
  fillText: TDrawFn | undefined;
4402
4448
  newStyle: {};
4449
+ static testId: number;
4403
4450
  style: TStyle;
4404
4451
  setColor: () => void;
4405
4452
  clearColor: () => void;
@@ -5001,7 +5048,6 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView' {
5001
5048
  import { Mappedin, MappedinCoordinate, MappedinLocation, MappedinMap, MappedinNode, MappedinPolygon } from '@mappedin/react-native-sdk/core/packages/get-venue';
5002
5049
  import { E_SDK_EVENT_PAYLOAD, TCreateCustomInnerHTMLTooltipOptions, TCreateCustomTooltipOptions, TCreateMarkerOptions, TCreateTextTooltipOptions, TLabelAllLocationFlatLabelOptions, TLabelAllLocationFloatingLabelOptions, TFloatingLabelPolygonOptions, TMapViewOptions, TPathOptions } from '@mappedin/react-native-sdk/core/packages/renderer/MapView.types';
5003
5050
  import { E_SDK_EVENT, STATE } from '@mappedin/react-native-sdk/core/packages/renderer/MapView.enums';
5004
- import FloatingLabel from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.FloatingLabel';
5005
5051
  import Marker from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.Marker';
5006
5052
  import SmartTooltip from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.SmartTooltip';
5007
5053
  import Camera from '@mappedin/react-native-sdk/core/packages/renderer/Camera';
@@ -5009,7 +5055,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView' {
5009
5055
  import BlueDotLayer from '@mappedin/react-native-sdk/core/packages/renderer/layers/BlueDot';
5010
5056
  import JourneyLayer from '@mappedin/react-native-sdk/core/packages/renderer/layers/Journey';
5011
5057
  import { ThreeJSMarkerHandle } from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.MapObject';
5012
- import { TCreateThreeDMarkerOptions, TFlatLabel, TFlatLabelPolygonOptions, TFloatingLabel } from '@mappedin/react-native-sdk/core/packages/renderer';
5058
+ import { FloatingLabel, TCreateThreeDMarkerOptions, TFlatLabel, TFlatLabelPolygonOptions, TFloatingLabel } from '@mappedin/react-native-sdk/core/packages/renderer';
5013
5059
  export enum INTERNAL_EVENT {
5014
5060
  CAMERA_MOVING = 0,
5015
5061
  SET_BLUE_DOT_SIZE_FROM_ZOOM = 1,
@@ -5333,7 +5379,9 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView' {
5333
5379
  */
5334
5380
  getPolygonsAtCoordinate(coordinate: MappedinCoordinate, includeNonInteractive?: boolean): MappedinPolygon[];
5335
5381
  /**
5336
- * Destroy instance and clean up memory
5382
+ * Destroy instance and reclaim memory. Note: this does not destroy the instance of {@link Mappedin}
5383
+ * that was passed in. For applications that require destroying and re-creating the mapView, it is
5384
+ * recommended to keep the {@link Mappedin} object around.
5337
5385
  */
5338
5386
  destroy(): void;
5339
5387
  }
@@ -6104,7 +6152,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/layers/EventSy
6104
6152
  rendererDomElement: any;
6105
6153
  currentHover: null;
6106
6154
  hoverLabel: any;
6107
- hoverColor: string | number;
6155
+ hoverColor: number;
6108
6156
  options: {
6109
6157
  disableHover: boolean;
6110
6158
  };
@@ -6149,6 +6197,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/layers/EventSy
6149
6197
  doHoverEffect: () => void;
6150
6198
  onPolygonHoverOut: (polygonId: any) => false | undefined;
6151
6199
  onPolygonHoverOver: (polygon: any) => false | undefined;
6200
+ setHoverColor: (color: string | number) => void;
6152
6201
  destroy(): void;
6153
6202
  }
6154
6203
  export default EventSystemLayer;
@@ -6394,7 +6443,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
6394
6443
  _visibilityLatch: boolean | null;
6395
6444
  _objLoadedComplete: boolean;
6396
6445
  _objLoaded(object: any): any;
6397
- _objLoadedMerged(object: any): void;
6446
+ _objLoadedMerged(object: any): Promise<any>;
6398
6447
  enableImageFlipping(polygonId: any, rotation: any): void;
6399
6448
  elements: any;
6400
6449
  boundingBox: {