@mappedin/react-native-sdk 4.1.3 → 4.1.5
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 +16 -22
- package/dist/index.d.ts +37 -8
- package/dist/index.js +198 -198
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -336,33 +336,28 @@ Example:
|
|
|
336
336
|
|
|
337
337
|
```
|
|
338
338
|
|
|
339
|
-
## Get
|
|
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
|
-
|
|
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={{
|
|
357
|
+
style={{flex: 1}}
|
|
360
358
|
ref={mapView}
|
|
361
359
|
options={options}
|
|
362
|
-
|
|
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
|
|
377
|
+
await mapView.current?.Journey.draw(directions);
|
|
383
378
|
// focus on the path
|
|
384
|
-
|
|
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
|
|
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
|
@@ -662,11 +662,14 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue' {
|
|
|
662
662
|
};
|
|
663
663
|
};
|
|
664
664
|
export { MAP_RENDER_MODE };
|
|
665
|
-
export function getVenueMVF(userOptions: TGetVenueBundleOptions): Promise<Mappedin>;
|
|
666
665
|
/**
|
|
667
666
|
* Get Venue Data for a Mappedin Venue
|
|
668
667
|
*/
|
|
669
668
|
export function getVenue(userOptions: TGetVenueOptions): Promise<Mappedin>;
|
|
669
|
+
/**
|
|
670
|
+
* @internal
|
|
671
|
+
*/
|
|
672
|
+
export function __setGetVenueMock(fn: any): void;
|
|
670
673
|
export type TGetVenueBundleOptions = TGetVenueOptions & {
|
|
671
674
|
bundleBaseUri?: string;
|
|
672
675
|
version?: string;
|
|
@@ -978,7 +981,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView.types'
|
|
|
978
981
|
icon: string;
|
|
979
982
|
location?: MappedinLocation;
|
|
980
983
|
};
|
|
981
|
-
export type TMarkerTemplateFn = ({ icon
|
|
984
|
+
export type TMarkerTemplateFn = ({ icon, location }: TMarkerTemplateProps) => string;
|
|
982
985
|
export type TJourneyOptions = {
|
|
983
986
|
/**
|
|
984
987
|
* What color to highlight departure and destination polygons
|
|
@@ -1324,7 +1327,6 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView.types'
|
|
|
1324
1327
|
};
|
|
1325
1328
|
export type TFloatingLabelPolygonOptions = TCommonLabelOptions & {
|
|
1326
1329
|
scale?: number;
|
|
1327
|
-
flatLabels?: false | undefined;
|
|
1328
1330
|
/**
|
|
1329
1331
|
* Ranking tier to determine how likely a {@link FloatingLabel} will appear
|
|
1330
1332
|
*/
|
|
@@ -1642,7 +1644,12 @@ declare module '@mappedin/react-native-sdk/wrappers/common/events' {
|
|
|
1642
1644
|
MAP_CHANGED = "MAP_CHANGED",
|
|
1643
1645
|
ROTATION_CHANGED = "ROTATION_CHANGED",
|
|
1644
1646
|
TILT_CHANGED = "TILT_CHANGED",
|
|
1647
|
+
ZOOM_CHANGED = "ZOOM_CHANGED",
|
|
1645
1648
|
CAMERA_SET = "CAMERA_SET",
|
|
1649
|
+
/**
|
|
1650
|
+
* @deprecated
|
|
1651
|
+
*/
|
|
1652
|
+
SET_ZOOM = "SET_ZOOM",
|
|
1646
1653
|
/**
|
|
1647
1654
|
* @deprecated
|
|
1648
1655
|
*/
|
|
@@ -1793,6 +1800,9 @@ declare module '@mappedin/react-native-sdk/wrappers/common/payloads' {
|
|
|
1793
1800
|
[EVENT.TILT_CHANGED]: {
|
|
1794
1801
|
tilt: number;
|
|
1795
1802
|
};
|
|
1803
|
+
[EVENT.ZOOM_CHANGED]: {
|
|
1804
|
+
zoom: number;
|
|
1805
|
+
};
|
|
1796
1806
|
[EVENT.UPDATE_GEOLOCATION]: {
|
|
1797
1807
|
msgID: undefined;
|
|
1798
1808
|
data: unknown;
|
|
@@ -1852,6 +1862,9 @@ declare module '@mappedin/react-native-sdk/wrappers/common/payloads' {
|
|
|
1852
1862
|
[EVENT.SET_TILT]: {
|
|
1853
1863
|
tilt: number;
|
|
1854
1864
|
};
|
|
1865
|
+
[EVENT.SET_ZOOM]: {
|
|
1866
|
+
zoom: number;
|
|
1867
|
+
};
|
|
1855
1868
|
[EVENT.CAMERA_SET_SAFE_AREA_INSETS]: {
|
|
1856
1869
|
safeAreaInsets: {
|
|
1857
1870
|
top: number;
|
|
@@ -2408,6 +2421,12 @@ declare module '@mappedin/react-native-sdk/wrappers/common/controller' {
|
|
|
2408
2421
|
tilt: number;
|
|
2409
2422
|
};
|
|
2410
2423
|
};
|
|
2424
|
+
ZOOM_CHANGED: {
|
|
2425
|
+
msgID?: string | undefined;
|
|
2426
|
+
data: {
|
|
2427
|
+
zoom: number;
|
|
2428
|
+
};
|
|
2429
|
+
};
|
|
2411
2430
|
UPDATE_GEOLOCATION: {
|
|
2412
2431
|
msgID?: string | undefined;
|
|
2413
2432
|
data: {
|
|
@@ -2483,6 +2502,12 @@ declare module '@mappedin/react-native-sdk/wrappers/common/controller' {
|
|
|
2483
2502
|
tilt: number;
|
|
2484
2503
|
};
|
|
2485
2504
|
};
|
|
2505
|
+
SET_ZOOM: {
|
|
2506
|
+
msgID?: string | undefined;
|
|
2507
|
+
data: {
|
|
2508
|
+
zoom: number;
|
|
2509
|
+
};
|
|
2510
|
+
};
|
|
2486
2511
|
CAMERA_SET_SAFE_AREA_INSETS: {
|
|
2487
2512
|
msgID?: string | undefined;
|
|
2488
2513
|
data: {
|
|
@@ -4391,6 +4416,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
|
|
|
4391
4416
|
};
|
|
4392
4417
|
};
|
|
4393
4418
|
export type TFloatingLabelOptionsInternal = {
|
|
4419
|
+
id: string;
|
|
4394
4420
|
position?: Vector3;
|
|
4395
4421
|
polygon: MappedinPolygon;
|
|
4396
4422
|
polygonHeight?: number;
|
|
@@ -4420,6 +4446,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
|
|
|
4420
4446
|
contextConfigured: boolean;
|
|
4421
4447
|
fillText: TDrawFn | undefined;
|
|
4422
4448
|
newStyle: {};
|
|
4449
|
+
static testId: number;
|
|
4423
4450
|
style: TStyle;
|
|
4424
4451
|
setColor: () => void;
|
|
4425
4452
|
clearColor: () => void;
|
|
@@ -5021,7 +5048,6 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView' {
|
|
|
5021
5048
|
import { Mappedin, MappedinCoordinate, MappedinLocation, MappedinMap, MappedinNode, MappedinPolygon } from '@mappedin/react-native-sdk/core/packages/get-venue';
|
|
5022
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';
|
|
5023
5050
|
import { E_SDK_EVENT, STATE } from '@mappedin/react-native-sdk/core/packages/renderer/MapView.enums';
|
|
5024
|
-
import FloatingLabel from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.FloatingLabel';
|
|
5025
5051
|
import Marker from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.Marker';
|
|
5026
5052
|
import SmartTooltip from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.SmartTooltip';
|
|
5027
5053
|
import Camera from '@mappedin/react-native-sdk/core/packages/renderer/Camera';
|
|
@@ -5029,7 +5055,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView' {
|
|
|
5029
5055
|
import BlueDotLayer from '@mappedin/react-native-sdk/core/packages/renderer/layers/BlueDot';
|
|
5030
5056
|
import JourneyLayer from '@mappedin/react-native-sdk/core/packages/renderer/layers/Journey';
|
|
5031
5057
|
import { ThreeJSMarkerHandle } from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.MapObject';
|
|
5032
|
-
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';
|
|
5033
5059
|
export enum INTERNAL_EVENT {
|
|
5034
5060
|
CAMERA_MOVING = 0,
|
|
5035
5061
|
SET_BLUE_DOT_SIZE_FROM_ZOOM = 1,
|
|
@@ -5353,7 +5379,9 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView' {
|
|
|
5353
5379
|
*/
|
|
5354
5380
|
getPolygonsAtCoordinate(coordinate: MappedinCoordinate, includeNonInteractive?: boolean): MappedinPolygon[];
|
|
5355
5381
|
/**
|
|
5356
|
-
* Destroy instance and
|
|
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.
|
|
5357
5385
|
*/
|
|
5358
5386
|
destroy(): void;
|
|
5359
5387
|
}
|
|
@@ -6124,7 +6152,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/layers/EventSy
|
|
|
6124
6152
|
rendererDomElement: any;
|
|
6125
6153
|
currentHover: null;
|
|
6126
6154
|
hoverLabel: any;
|
|
6127
|
-
hoverColor:
|
|
6155
|
+
hoverColor: number;
|
|
6128
6156
|
options: {
|
|
6129
6157
|
disableHover: boolean;
|
|
6130
6158
|
};
|
|
@@ -6169,6 +6197,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/layers/EventSy
|
|
|
6169
6197
|
doHoverEffect: () => void;
|
|
6170
6198
|
onPolygonHoverOut: (polygonId: any) => false | undefined;
|
|
6171
6199
|
onPolygonHoverOver: (polygon: any) => false | undefined;
|
|
6200
|
+
setHoverColor: (color: string | number) => void;
|
|
6172
6201
|
destroy(): void;
|
|
6173
6202
|
}
|
|
6174
6203
|
export default EventSystemLayer;
|
|
@@ -6414,7 +6443,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
|
|
|
6414
6443
|
_visibilityLatch: boolean | null;
|
|
6415
6444
|
_objLoadedComplete: boolean;
|
|
6416
6445
|
_objLoaded(object: any): any;
|
|
6417
|
-
_objLoadedMerged(object: any):
|
|
6446
|
+
_objLoadedMerged(object: any): Promise<any>;
|
|
6418
6447
|
enableImageFlipping(polygonId: any, rotation: any): void;
|
|
6419
6448
|
elements: any;
|
|
6420
6449
|
boundingBox: {
|