@maplibre/maplibre-react-native 11.0.0-beta.4 → 11.0.0-beta.6
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/ios/components/map-view/MLRNMapViewModule.mm +1 -1
- package/lib/commonjs/components/annotations/marker/Marker.js +5 -1
- package/lib/commonjs/components/annotations/marker/Marker.js.map +1 -1
- package/lib/commonjs/components/annotations/view-annotation/ViewAnnotation.js +7 -4
- package/lib/commonjs/components/annotations/view-annotation/ViewAnnotation.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/annotations/marker/Marker.js +6 -2
- package/lib/module/components/annotations/marker/Marker.js.map +1 -1
- package/lib/module/components/annotations/view-annotation/ViewAnnotation.js +7 -5
- package/lib/module/components/annotations/view-annotation/ViewAnnotation.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/components/annotations/marker/Marker.d.ts +21 -4
- package/lib/typescript/commonjs/src/components/annotations/marker/Marker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/annotations/view-annotation/ViewAnnotation.d.ts +18 -4
- package/lib/typescript/commonjs/src/components/annotations/view-annotation/ViewAnnotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/map/Map.d.ts +4 -4
- package/lib/typescript/commonjs/src/components/map/Map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +1 -1
- package/lib/typescript/module/src/components/annotations/marker/Marker.d.ts +21 -4
- package/lib/typescript/module/src/components/annotations/marker/Marker.d.ts.map +1 -1
- package/lib/typescript/module/src/components/annotations/view-annotation/ViewAnnotation.d.ts +18 -4
- package/lib/typescript/module/src/components/annotations/view-annotation/ViewAnnotation.d.ts.map +1 -1
- package/lib/typescript/module/src/components/map/Map.d.ts +4 -4
- package/lib/typescript/module/src/components/map/Map.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +2 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/animated/Animated.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/annotations/marker/Marker.tsx +38 -6
- package/src/components/annotations/view-annotation/ViewAnnotation.tsx +84 -74
- package/src/components/map/Map.tsx +4 -4
- package/src/index.ts +6 -3
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
107
107
|
reject:(RCTPromiseRejectBlock)reject {
|
|
108
108
|
CLLocationCoordinate2D coordinate =
|
|
109
|
-
CLLocationCoordinate2DMake([lngLat[
|
|
109
|
+
CLLocationCoordinate2DMake([lngLat[1] doubleValue], [lngLat[0] doubleValue]);
|
|
110
110
|
|
|
111
111
|
[self withMapView:reactTag
|
|
112
112
|
block:^(MLRNMapView *view) {
|
|
@@ -25,16 +25,20 @@ const Marker = ({
|
|
|
25
25
|
id,
|
|
26
26
|
anchor = "center",
|
|
27
27
|
offset,
|
|
28
|
+
ref,
|
|
28
29
|
...props
|
|
29
30
|
}) => {
|
|
30
31
|
const nativeRef = (0, _react.useRef)(null);
|
|
32
|
+
const viewAnnotationRef = (0, _react.useRef)(null);
|
|
31
33
|
const nativeAnchor = (0, _Anchor.anchorToNative)(anchor);
|
|
32
34
|
const nativeOffset = offset ? {
|
|
33
35
|
x: offset[0],
|
|
34
36
|
y: offset[1]
|
|
35
37
|
} : undefined;
|
|
36
|
-
const viewAnnotationRef = (0, _react.useRef)(null);
|
|
37
38
|
const frozenId = (0, _useFrozenId.useFrozenId)(id);
|
|
39
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
40
|
+
getAnimatableRef: () => _reactNative.Platform.OS === "ios" ? viewAnnotationRef.current?.getAnimatableRef() ?? null : nativeRef.current
|
|
41
|
+
}));
|
|
38
42
|
if (_reactNative.Platform.OS === "ios") {
|
|
39
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ViewAnnotation.ViewAnnotation, {
|
|
40
44
|
ref: viewAnnotationRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_MarkerViewNativeComponent","_interopRequireDefault","_useFrozenId","_Anchor","_ViewAnnotation","_jsxRuntime","e","__esModule","default","Marker","id","anchor","offset","props","nativeRef","useRef","nativeAnchor","anchorToNative","nativeOffset","x","y","undefined","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_MarkerViewNativeComponent","_interopRequireDefault","_useFrozenId","_Anchor","_ViewAnnotation","_jsxRuntime","e","__esModule","default","Marker","id","anchor","offset","ref","props","nativeRef","useRef","viewAnnotationRef","nativeAnchor","anchorToNative","nativeOffset","x","y","undefined","frozenId","useFrozenId","useImperativeHandle","getAnimatableRef","Platform","OS","current","jsx","ViewAnnotation","style","flex","alignSelf","overflow","children","View","collapsable","exports"],"sourceRoot":"../../../../../src","sources":["components/annotations/marker/Marker.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,0BAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAGA,IAAAM,eAAA,GAAAN,OAAA;AAI2C,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAG,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAiE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,MAAM,GAAGA,CAAC;EACrBC,EAAE;EACFC,MAAM,GAAG,QAAQ;EACjBC,MAAM;EACNC,GAAG;EACH,GAAGC;AACQ,CAAC,KAAK;EACjB,MAAMC,SAAS,GAAG,IAAAC,aAAM,EAAkB,IAAI,CAAC;EAC/C,MAAMC,iBAAiB,GAAG,IA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AAE;QAAEC,IAAI,EAAE,CAAC;QAAEC,SAAS,EAAE,YAAY;QAAEC,QAAQ,EAAE;MAAU,CAAE;MAAAC,QAAA,EAEhEvB,KAAK,CAACuB;IAAQ,CACX;EAAC,CACkB,CAAC;AAEhC,CAAC;AAACG,OAAA,CAAA/B,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
@@ -28,13 +28,14 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
28
28
|
* If you need interactive views please use Marker,
|
|
29
29
|
* as with ViewAnnotation on Android child views are rendered onto a bitmap for better performance.
|
|
30
30
|
*/
|
|
31
|
-
const ViewAnnotation =
|
|
31
|
+
const ViewAnnotation = ({
|
|
32
32
|
id,
|
|
33
33
|
anchor = "center",
|
|
34
34
|
draggable = false,
|
|
35
35
|
offset,
|
|
36
|
+
ref,
|
|
36
37
|
...props
|
|
37
|
-
}
|
|
38
|
+
}) => {
|
|
38
39
|
const frozenId = (0, _useFrozenId.useFrozenId)(id);
|
|
39
40
|
const nativeAnchor = (0, _Anchor.anchorToNative)(anchor);
|
|
40
41
|
const nativeOffset = offset ? {
|
|
@@ -43,7 +44,8 @@ const ViewAnnotation = exports.ViewAnnotation = /*#__PURE__*/(0, _react.forwardR
|
|
|
43
44
|
} : undefined;
|
|
44
45
|
const nativeRef = (0, _react.useRef)(null);
|
|
45
46
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
46
|
-
refresh
|
|
47
|
+
refresh,
|
|
48
|
+
getAnimatableRef: () => nativeRef.current
|
|
47
49
|
}));
|
|
48
50
|
function refresh() {
|
|
49
51
|
if (_reactNative.Platform.OS === "android" && nativeRef.current) {
|
|
@@ -84,5 +86,6 @@ const ViewAnnotation = exports.ViewAnnotation = /*#__PURE__*/(0, _react.forwardR
|
|
|
84
86
|
style: [props.style, styles.container],
|
|
85
87
|
children: wrappedChildren
|
|
86
88
|
});
|
|
87
|
-
}
|
|
89
|
+
};
|
|
90
|
+
exports.ViewAnnotation = ViewAnnotation;
|
|
88
91
|
//# sourceMappingURL=ViewAnnotation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_PointAnnotationNativeComponent","_interopRequireWildcard","_useFrozenId","_Anchor","_Callout","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","styles","StyleSheet","create","container","alignItems","justifyContent","position","ViewAnnotation","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_PointAnnotationNativeComponent","_interopRequireWildcard","_useFrozenId","_Anchor","_Callout","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","styles","StyleSheet","create","container","alignItems","justifyContent","position","ViewAnnotation","id","anchor","draggable","offset","ref","props","frozenId","useFrozenId","nativeAnchor","anchorToNative","nativeOffset","x","y","undefined","nativeRef","useRef","useImperativeHandle","refresh","getAnimatableRef","current","Platform","OS","Commands","wrappedChildren","children","childArray","Children","toArray","callout","find","child","isValidElement","type","Callout","otherChildren","filter","jsxs","Fragment","jsx","View","collapsable","style","overflow","exports"],"sourceRoot":"../../../../../src","sources":["components/annotations/view-annotation/ViewAnnotation.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAUA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,+BAAA,GAAAC,uBAAA,CAAAH,OAAA;AAGA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAIA,IAAAM,QAAA,GAAAN,OAAA;AAA6C,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAG,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,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M;QAACC,KAAK,EAAE;UAAEC,QAAQ,EAAE;QAAU,CAAE;QAAAlB,QAAA,EACtDU;MAAa,CACV,CAAC,EACNN,OAAO;IAAA,CACR,CAAC;EAEP,CAAC,EAAE,CAAC;EAEJ,oBACE,IAAAxD,WAAA,CAAAkE,GAAA,EAACvE,+BAAA,CAAAgB,OAA8B;IAC7BqB,GAAG,EAAEU,SAAU;IAAA,GACXT,KAAK;IACTL,EAAE,EAAEM,QAAS;IACbL,MAAM,EAAEO,YAAa;IACrBL,MAAM,EAAEO,YAAa;IACrBR,SAAS,EAAEA,SAAU;IACrBuC,KAAK,EAAE,CAACpC,KAAK,CAACoC,KAAK,EAAEjD,MAAM,CAACG,SAAS,CAAE;IAAA6B,QAAA,EAEtCD;EAAe,CACc,CAAC;AAErC,CAAC;AAACoB,OAAA,CAAA5C,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Camera","require","_Map","_ViewAnnotation","_LayerAnnotation","_Callout","_UserLocation","_NativeUserLocation","_useCurrentPosition","_ImageSource","_GeoJSONSource","_RasterSource","_VectorSource","_Layer","_Images","_Marker","_LocationManager","_LogManager","_NetworkManager","_OfflineManager","_OfflinePack","_StaticMapManager","_Animated"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAiBA,IAAAC,IAAA,GAAAD,OAAA;AAQA,IAAAE,eAAA,GAAAF,OAAA;
|
|
1
|
+
{"version":3,"names":["_Camera","require","_Map","_ViewAnnotation","_LayerAnnotation","_Callout","_UserLocation","_NativeUserLocation","_useCurrentPosition","_ImageSource","_GeoJSONSource","_RasterSource","_VectorSource","_Layer","_Images","_Marker","_LocationManager","_LogManager","_NetworkManager","_OfflineManager","_OfflinePack","_StaticMapManager","_Animated"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAiBA,IAAAC,IAAA,GAAAD,OAAA;AAQA,IAAAE,eAAA,GAAAF,OAAA;AAQA,IAAAG,gBAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,mBAAA,GAAAP,OAAA;AAEA,IAAAQ,YAAA,GAAAR,OAAA;AAKA,IAAAS,cAAA,GAAAT,OAAA;AAMA,IAAAU,aAAA,GAAAV,OAAA;AAKA,IAAAW,aAAA,GAAAX,OAAA;AAMA,IAAAY,MAAA,GAAAZ,OAAA;AA+CA,IAAAa,OAAA,GAAAb,OAAA;AAOA,IAAAc,OAAA,GAAAd,OAAA;AAOA,IAAAe,gBAAA,GAAAf,OAAA;AAKA,IAAAgB,WAAA,GAAAhB,OAAA;AAEA,IAAAiB,eAAA,GAAAjB,OAAA;AAEA,IAAAkB,eAAA,GAAAlB,OAAA;AAQA,IAAAmB,YAAA,GAAAnB,OAAA;AAKA,IAAAoB,iBAAA,GAAApB,OAAA;AA8BA,IAAAqB,SAAA,GAAArB,OAAA","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useRef } from "react";
|
|
3
|
+
import { useImperativeHandle, useRef } from "react";
|
|
4
4
|
import { Platform, View } from "react-native";
|
|
5
5
|
import MarkerViewNativeComponent from "./MarkerViewNativeComponent";
|
|
6
6
|
import { useFrozenId } from "../../../hooks/useFrozenId.js";
|
|
@@ -20,16 +20,20 @@ export const Marker = ({
|
|
|
20
20
|
id,
|
|
21
21
|
anchor = "center",
|
|
22
22
|
offset,
|
|
23
|
+
ref,
|
|
23
24
|
...props
|
|
24
25
|
}) => {
|
|
25
26
|
const nativeRef = useRef(null);
|
|
27
|
+
const viewAnnotationRef = useRef(null);
|
|
26
28
|
const nativeAnchor = anchorToNative(anchor);
|
|
27
29
|
const nativeOffset = offset ? {
|
|
28
30
|
x: offset[0],
|
|
29
31
|
y: offset[1]
|
|
30
32
|
} : undefined;
|
|
31
|
-
const viewAnnotationRef = useRef(null);
|
|
32
33
|
const frozenId = useFrozenId(id);
|
|
34
|
+
useImperativeHandle(ref, () => ({
|
|
35
|
+
getAnimatableRef: () => Platform.OS === "ios" ? viewAnnotationRef.current?.getAnimatableRef() ?? null : nativeRef.current
|
|
36
|
+
}));
|
|
33
37
|
if (Platform.OS === "ios") {
|
|
34
38
|
return /*#__PURE__*/_jsx(ViewAnnotation, {
|
|
35
39
|
ref: viewAnnotationRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","Platform","View","MarkerViewNativeComponent","useFrozenId","anchorToNative","ViewAnnotation","jsx","_jsx","Marker","id","anchor","offset","props","nativeRef","nativeAnchor","nativeOffset","x","y","undefined","
|
|
1
|
+
{"version":3,"names":["useImperativeHandle","useRef","Platform","View","MarkerViewNativeComponent","useFrozenId","anchorToNative","ViewAnnotation","jsx","_jsx","Marker","id","anchor","offset","ref","props","nativeRef","viewAnnotationRef","nativeAnchor","nativeOffset","x","y","undefined","frozenId","getAnimatableRef","OS","current","style","flex","alignSelf","overflow","children","collapsable"],"sourceRoot":"../../../../../src","sources":["components/annotations/marker/Marker.tsx"],"mappings":";;AAAA,SAKEA,mBAAmB,EACnBC,MAAM,QACD,OAAO;AACd,SAEEC,QAAQ,EACRC,IAAI,QAEC,cAAc;AAErB,OAAOC,yBAAyB,MAAM,6BAA6B;A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;IACrBL,MAAM,EAAEM,YAAa;IAAA,GACjBJ,KAAK;IACTY,KAAK,EAAE,CACL;MAAEC,IAAI,EAAE,CAAC;MAAEC,SAAS,EAAE,YAAY;MAAEC,QAAQ,EAAE;IAAU,CAAC,EACzDf,KAAK,CAACY,KAAK,CACX;IAAAI,QAAA,eAEFtB,IAAA,CAACN,IAAI;MACH6B,WAAW,EAAE,KAAM;MACnBL,KAAK,EAAE;QAAEC,IAAI,EAAE,CAAC;QAAEC,SAAS,EAAE,YAAY;QAAEC,QAAQ,EAAE;MAAU,CAAE;MAAAC,QAAA,EAEhEhB,KAAK,CAACgB;IAAQ,CACX;EAAC,CACkB,CAAC;AAEhC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Children,
|
|
3
|
+
import { Children, isValidElement, useImperativeHandle, useRef } from "react";
|
|
4
4
|
import { Platform, StyleSheet, View } from "react-native";
|
|
5
5
|
import PointAnnotationNativeComponent, { Commands } from "./PointAnnotationNativeComponent";
|
|
6
6
|
import { useFrozenId } from "../../../hooks/useFrozenId.js";
|
|
@@ -23,13 +23,14 @@ const styles = StyleSheet.create({
|
|
|
23
23
|
* If you need interactive views please use Marker,
|
|
24
24
|
* as with ViewAnnotation on Android child views are rendered onto a bitmap for better performance.
|
|
25
25
|
*/
|
|
26
|
-
export const ViewAnnotation =
|
|
26
|
+
export const ViewAnnotation = ({
|
|
27
27
|
id,
|
|
28
28
|
anchor = "center",
|
|
29
29
|
draggable = false,
|
|
30
30
|
offset,
|
|
31
|
+
ref,
|
|
31
32
|
...props
|
|
32
|
-
}
|
|
33
|
+
}) => {
|
|
33
34
|
const frozenId = useFrozenId(id);
|
|
34
35
|
const nativeAnchor = anchorToNative(anchor);
|
|
35
36
|
const nativeOffset = offset ? {
|
|
@@ -38,7 +39,8 @@ export const ViewAnnotation = /*#__PURE__*/forwardRef(({
|
|
|
38
39
|
} : undefined;
|
|
39
40
|
const nativeRef = useRef(null);
|
|
40
41
|
useImperativeHandle(ref, () => ({
|
|
41
|
-
refresh
|
|
42
|
+
refresh,
|
|
43
|
+
getAnimatableRef: () => nativeRef.current
|
|
42
44
|
}));
|
|
43
45
|
function refresh() {
|
|
44
46
|
if (Platform.OS === "android" && nativeRef.current) {
|
|
@@ -79,5 +81,5 @@ export const ViewAnnotation = /*#__PURE__*/forwardRef(({
|
|
|
79
81
|
style: [props.style, styles.container],
|
|
80
82
|
children: wrappedChildren
|
|
81
83
|
});
|
|
82
|
-
}
|
|
84
|
+
};
|
|
83
85
|
//# sourceMappingURL=ViewAnnotation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","
|
|
1
|
+
{"version":3,"names":["Children","isValidElement","useImperativeHandle","useRef","Platform","StyleSheet","View","PointAnnotationNativeComponent","Commands","useFrozenId","anchorToNative","Callout","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","styles","create","container","alignItems","justifyContent","position","ViewAnnotation","id","anchor","draggable","offset","ref","props","frozenId","nativeAnchor","nativeOffset","x","y","undefined","nativeRef","refresh","getAnimatableRef","current","OS","wrappedChildren","children","childArray","toArray","callout","find","child","type","otherChildren","filter","collapsable","style","overflow"],"sourceRoot":"../../../../../src","sources":["components/annotations/view-annotation/ViewAnnotation.tsx"],"mappings":";;AAAA,SACEA,QAAQ,EAGRC,cAAc,EAGdC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AACd,SAGEC,QAAQ,EACRC,UAAU,EACVC,IAAI,QAEC,cAAc;AAErB,OAAOC,8BAA8B,IACnCC,QAAQ,QACH,kCAAkC;AACzC,SAASC,WAAW,QAAQ,+BAA4B;AACxD,SAAsBC,cAAc,QAAQ,0BAAuB;AAInE,SAASC,OAAO,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7C,MAAMC,MAAM,GAAGb,UAAU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I,CAC5BC,KAAK,IAAK,aAAA/C,cAAc,CAAC+C,KAAK,CAAC,IAAIA,KAAK,CAACC,IAAI,KAAKtC,OACrD,CAAC;IACD,MAAMuC,aAAa,GAAGN,UAAU,CAACO,MAAM,CACpCH,KAAK,IAAK,eAAC/C,cAAc,CAAC+C,KAAK,CAAC,IAAIA,KAAK,CAACC,IAAI,KAAKtC,OACtD,CAAC;IAED,oBACEM,KAAA,CAAAF,SAAA;MAAA4B,QAAA,gBACE9B,IAAA,CAACP,IAAI;QAAC8C,WAAW,EAAE,KAAM;QAACC,KAAK,EAAE;UAAEC,QAAQ,EAAE;QAAU,CAAE;QAAAX,QAAA,EACtDO;MAAa,CACV,CAAC,EACNJ,OAAO;IAAA,CACR,CAAC;EAEP,CAAC,EAAE,CAAC;EAEJ,oBACEjC,IAAA,CAACN,8BAA8B;IAC7BsB,GAAG,EAAEQ,SAAU;IAAA,GACXP,KAAK;IACTL,EAAE,EAAEM,QAAS;IACbL,MAAM,EAAEM,YAAa;IACrBJ,MAAM,EAAEK,YAAa;IACrBN,SAAS,EAAEA,SAAU;IACrB0B,KAAK,EAAE,CAACvB,KAAK,CAACuB,KAAK,EAAEnC,MAAM,CAACE,SAAS,CAAE;IAAAuB,QAAA,EAEtCD;EAAe,CACc,CAAC;AAErC,CAAC","ignoreList":[]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Camera","Map","ViewAnnotation","LayerAnnotation","Callout","UserLocation","NativeUserLocation","useCurrentPosition","ImageSource","GeoJSONSource","RasterSource","VectorSource","Layer","Images","Marker","LocationManager","LogManager","NetworkManager","OfflineManager","OfflinePack","StaticMapImageManager","Animated"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAcEA,MAAM,QACD,+BAA4B;AAEnC,SAKEC,GAAG,QACE,yBAAsB;AAE7B,
|
|
1
|
+
{"version":3,"names":["Camera","Map","ViewAnnotation","LayerAnnotation","Callout","UserLocation","NativeUserLocation","useCurrentPosition","ImageSource","GeoJSONSource","RasterSource","VectorSource","Layer","Images","Marker","LocationManager","LogManager","NetworkManager","OfflineManager","OfflinePack","StaticMapImageManager","Animated"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAcEA,MAAM,QACD,+BAA4B;AAEnC,SAKEC,GAAG,QACE,yBAAsB;AAE7B,SAKEC,cAAc,QACT,4DAAyD;AAEhE,SAEEC,eAAe,QACV,6CAA0C;AAEjD,SACEC,OAAO,QAEF,6CAA0C;AAEjD,SAASC,YAAY,QAAQ,4CAAyC;AACtE,SAASC,kBAAkB,QAAQ,kDAA+C;AAClF,SAASC,kBAAkB,QAAQ,+BAA4B;AAE/D,SAEEC,WAAW,QACN,kDAA+C;AAEtD,SAGEC,aAAa,QACR,sDAAmD;AAE1D,SAEEC,YAAY,QACP,oDAAiD;AAExD,SAGEC,YAAY,QACP,oDAAiD;AAExD,SACEC,KAAK,QAWA,6BAA0B;AAmCjC,SAIEC,MAAM,QACD,+BAA4B;AAEnC,SACEC,MAAM,QAID,2CAAwC;AAE/C,SACEC,eAAe,QAEV,uCAAoC;AAE3C,SAASC,UAAU,QAAuB,6BAA0B;AAEpE,SAASC,cAAc,QAAQ,qCAAkC;AAEjE,SACEC,cAAc,QAMT,qCAAkC;AACzC,SACEC,WAAW,QAEN,kCAA+B;AAEtC,SACEC,qBAAqB,QAKhB,0CAAuC;AAwB9C,SAASC,QAAQ,QAAQ,8BAA2B","ignoreList":[]}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
2
|
-
import { type ViewProps } from "react-native";
|
|
1
|
+
import { Component, type ComponentProps, type ReactElement, type Ref } from "react";
|
|
2
|
+
import { type NativeMethods, type ViewProps } from "react-native";
|
|
3
|
+
import MarkerViewNativeComponent from "./MarkerViewNativeComponent";
|
|
3
4
|
import { type Anchor } from "../../../types/Anchor";
|
|
4
5
|
import type { LngLat } from "../../../types/LngLat";
|
|
5
6
|
import type { PixelPoint } from "../../../types/PixelPoint";
|
|
7
|
+
import { type NativeViewAnnotationRef } from "../view-annotation/ViewAnnotation";
|
|
8
|
+
export type NativeMarkerRef = Component<ComponentProps<typeof MarkerViewNativeComponent>> & Readonly<NativeMethods>;
|
|
9
|
+
export interface MarkerRef {
|
|
10
|
+
/**
|
|
11
|
+
* Returns a reference to the native component for Reanimated compatibility.
|
|
12
|
+
* This method is used by Reanimated's createAnimatedComponent to determine
|
|
13
|
+
* which component should receive animated props.
|
|
14
|
+
*
|
|
15
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent/#component
|
|
16
|
+
*/
|
|
17
|
+
getAnimatableRef(): NativeMarkerRef | NativeViewAnnotationRef | null;
|
|
18
|
+
}
|
|
6
19
|
export interface MarkerProps extends ViewProps {
|
|
7
20
|
/**
|
|
8
21
|
* A string that uniquely identifies the marker.
|
|
@@ -35,9 +48,13 @@ export interface MarkerProps extends ViewProps {
|
|
|
35
48
|
*/
|
|
36
49
|
selected?: boolean;
|
|
37
50
|
/**
|
|
38
|
-
* Expects one child - can be
|
|
51
|
+
* Expects one child - can be a View with multiple elements.
|
|
39
52
|
*/
|
|
40
53
|
children: ReactElement;
|
|
54
|
+
/**
|
|
55
|
+
* Ref to access Marker methods.
|
|
56
|
+
*/
|
|
57
|
+
ref?: Ref<MarkerRef>;
|
|
41
58
|
}
|
|
42
59
|
/**
|
|
43
60
|
* Marker allows you to place an interactive React Native View on the map.
|
|
@@ -48,5 +65,5 @@ export interface MarkerProps extends ViewProps {
|
|
|
48
65
|
* - Android: Native Views placed on the map projection
|
|
49
66
|
* - iOS: [MLNPointAnnotation](https://maplibre.org/maplibre-native/ios/latest/documentation/maplibre/mlnpointannotation/)
|
|
50
67
|
*/
|
|
51
|
-
export declare const Marker: ({ id, anchor, offset, ...props }: MarkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export declare const Marker: ({ id, anchor, offset, ref, ...props }: MarkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
69
|
//# sourceMappingURL=Marker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/annotations/marker/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/annotations/marker/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,GAAG,EAGT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,SAAS,CACrC,cAAc,CAAC,OAAO,yBAAyB,CAAC,CACjD,GACC,QAAQ,CAAC,aAAa,CAAC,CAAC;AAE1B,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,gBAAgB,IAAI,eAAe,GAAG,uBAAuB,GAAG,IAAI,CAAC;CACtE;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IAEvB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,GAAI,uCAMpB,WAAW,4CAmDb,CAAC"}
|
package/lib/typescript/commonjs/src/components/annotations/view-annotation/ViewAnnotation.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
2
|
-
import { type NativeSyntheticEvent, type ViewProps } from "react-native";
|
|
1
|
+
import { Component, type ComponentProps, type ReactElement, type Ref } from "react";
|
|
2
|
+
import { type NativeMethods, type NativeSyntheticEvent, type ViewProps } from "react-native";
|
|
3
|
+
import PointAnnotationNativeComponent from "./PointAnnotationNativeComponent";
|
|
3
4
|
import { type Anchor } from "../../../types/Anchor";
|
|
4
5
|
import type { LngLat } from "../../../types/LngLat";
|
|
5
6
|
import type { PixelPoint } from "../../../types/PixelPoint";
|
|
6
7
|
import type { PressEvent } from "../../../types/PressEvent";
|
|
8
|
+
export type NativeViewAnnotationRef = Component<ComponentProps<typeof PointAnnotationNativeComponent>> & Readonly<NativeMethods>;
|
|
7
9
|
export type ViewAnnotationEvent = PressEvent & {
|
|
8
10
|
id: string;
|
|
9
11
|
};
|
|
@@ -68,11 +70,15 @@ export interface ViewAnnotationProps {
|
|
|
68
70
|
* This callback is fired while this annotation is being dragged.
|
|
69
71
|
*/
|
|
70
72
|
onDrag?: (event: NativeSyntheticEvent<ViewAnnotationEvent>) => void;
|
|
73
|
+
style?: ViewProps["style"];
|
|
71
74
|
/**
|
|
72
75
|
* Expects one child, and an optional callout can be added as well
|
|
73
76
|
*/
|
|
74
77
|
children: ReactElement | [ReactElement, ReactElement];
|
|
75
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Ref to access ViewAnnotation methods.
|
|
80
|
+
*/
|
|
81
|
+
ref?: Ref<ViewAnnotationRef>;
|
|
76
82
|
}
|
|
77
83
|
export interface ViewAnnotationRef {
|
|
78
84
|
/**
|
|
@@ -81,6 +87,14 @@ export interface ViewAnnotationRef {
|
|
|
81
87
|
* Call this for example from Image#onLoad.
|
|
82
88
|
*/
|
|
83
89
|
refresh(): void;
|
|
90
|
+
/**
|
|
91
|
+
* Returns a reference to the native component for Reanimated compatibility.
|
|
92
|
+
* This method is used by Reanimated's createAnimatedComponent to determine
|
|
93
|
+
* which component should receive animated props.
|
|
94
|
+
*
|
|
95
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent/#component
|
|
96
|
+
*/
|
|
97
|
+
getAnimatableRef(): NativeViewAnnotationRef | null;
|
|
84
98
|
}
|
|
85
99
|
/**
|
|
86
100
|
* ViewAnnotation represents a one-dimensional shape located at a single geographical coordinate.
|
|
@@ -91,5 +105,5 @@ export interface ViewAnnotationRef {
|
|
|
91
105
|
* If you need interactive views please use Marker,
|
|
92
106
|
* as with ViewAnnotation on Android child views are rendered onto a bitmap for better performance.
|
|
93
107
|
*/
|
|
94
|
-
export declare const ViewAnnotation:
|
|
108
|
+
export declare const ViewAnnotation: ({ id, anchor, draggable, offset, ref, ...props }: ViewAnnotationProps) => import("react/jsx-runtime").JSX.Element;
|
|
95
109
|
//# sourceMappingURL=ViewAnnotation.d.ts.map
|
package/lib/typescript/commonjs/src/components/annotations/view-annotation/ViewAnnotation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewAnnotation.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/annotations/view-annotation/ViewAnnotation.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ViewAnnotation.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/annotations/view-annotation/ViewAnnotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,KAAK,cAAc,EAEnB,KAAK,YAAY,EACjB,KAAK,GAAG,EAGT,MAAM,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W,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAEzE;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAEvE;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAEpE,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAE3B;;OAEG;IACH,QAAQ,EAAE,YAAY,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAEtD;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAAC;IAEhB;;;;;;OAMG;IACH,gBAAgB,IAAI,uBAAuB,GAAG,IAAI,CAAC;CACpD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAI,kDAO5B,mBAAmB,4CA6DrB,CAAC"}
|
|
@@ -102,17 +102,17 @@ export interface MapRef {
|
|
|
102
102
|
* Converts geographic coordinates to pixel point of the view
|
|
103
103
|
*
|
|
104
104
|
* @example
|
|
105
|
-
* await mapRef.current?.
|
|
105
|
+
* await mapRef.current?.project([13.04214014753952, 47.80554907882145]);
|
|
106
106
|
*
|
|
107
|
-
* @param
|
|
107
|
+
* @param lngLat Geographic coordinate
|
|
108
108
|
* @return Pixel point
|
|
109
109
|
*/
|
|
110
|
-
project(
|
|
110
|
+
project(lngLat: LngLat): Promise<PixelPoint>;
|
|
111
111
|
/**
|
|
112
112
|
* Converts a pixel point of the view to geographic coordinates.
|
|
113
113
|
*
|
|
114
114
|
* @example
|
|
115
|
-
* await mapRef.current?.
|
|
115
|
+
* await mapRef.current?.unproject([280, 640]);
|
|
116
116
|
*
|
|
117
117
|
* @param point Pixel point
|
|
118
118
|
* @return Geographic coordinate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.d.ts","sourceRoot":"","sources":["../../../../../../src/components/map/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAML,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,oBAAoB,EAIzB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAU3D,MAAM,MAAM,oBAAoB,GAC5B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErC,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,C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K,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAEtE;;OAEG;IACH,4BAA4B,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAE3E;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACvE;AAED;;GAEG;AACH,eAAO,MAAM,GAAG,wFA6Jf,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { type CameraOptions, type CameraEasing, type CameraAnimationOptions, type CameraCenterOptions, type CameraBoundsOptions, type CameraCenterStop, type CameraBoundsStop, type CameraStop, type InitialViewState, type TrackUserLocation, type TrackUserLocationChangeEvent, type CameraRef, type CameraProps, Camera, } from "./components/camera/Camera";
|
|
2
2
|
export { type ViewState, type ViewStateChangeEvent, type MapRef, type MapProps, Map, } from "./components/map/Map";
|
|
3
|
-
export {
|
|
3
|
+
export { type ViewAnnotationEvent, type NativeViewAnnotationRef, type ViewAnnotationRef, type ViewAnnotationProps, ViewAnnotation, } from "./components/annotations/view-annotation/ViewAnnotation";
|
|
4
4
|
export { type LayerAnnotationProps, LayerAnnotation, } from "./components/annotations/LayerAnnotation";
|
|
5
5
|
export { Callout, type CalloutProps, } from "./components/annotations/callout/Callout";
|
|
6
6
|
export { UserLocation } from "./components/user-location/UserLocation";
|
|
@@ -13,7 +13,7 @@ export { type VectorSourceRef, type VectorSourceProps, VectorSource, } from "./c
|
|
|
13
13
|
export { Layer, type LayerProps, type SourceLayerProps, type FillLayerProps, type LineLayerProps, type SymbolLayerProps, type CircleLayerProps, type HeatmapLayerProps, type FillExtrusionLayerProps, type RasterLayerProps, type BackgroundLayerProps, } from "./components/layer/Layer";
|
|
14
14
|
export type { LayerSpecification, FillLayerSpecification, LineLayerSpecification, SymbolLayerSpecification, CircleLayerSpecification, HeatmapLayerSpecification, FillExtrusionLayerSpecification, RasterLayerSpecification, HillshadeLayerSpecification, BackgroundLayerSpecification, SourceSpecification, VectorSourceSpecification, RasterSourceSpecification, RasterDEMSourceSpecification, GeoJSONSourceSpecification, VideoSourceSpecification, ImageSourceSpecification, FilterSpecification, StyleSpecification, SkySpecification, LightSpecification, TerrainSpecification, ProjectionSpecification, } from "@maplibre/maplibre-gl-style-spec";
|
|
15
15
|
export { type ImageSourceWithSdf, type ImageEntry, type ImagesProps, Images, } from "./components/images/Images";
|
|
16
|
-
export { Marker, type MarkerProps, } from "./components/annotations/marker/Marker";
|
|
16
|
+
export { Marker, type NativeMarkerRef, type MarkerRef, type MarkerProps, } from "./components/annotations/marker/Marker";
|
|
17
17
|
export { LocationManager, type GeolocationPosition, } from "./modules/location/LocationManager";
|
|
18
18
|
export { LogManager, type LogLevel } from "./modules/log/LogManager";
|
|
19
19
|
export { NetworkManager } from "./modules/network/NetworkManager";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACjC,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,MAAM,GACP,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,GAAG,GACJ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,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AsB,GAC5B,MAAM,uCAAuC,CAAC;AAE/C,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,UAAU,GACX,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -10,7 +10,7 @@ export declare const Animated: {
|
|
|
10
10
|
data: string | GeoJSON.GeoJSON | AnimatedGeoJSON;
|
|
11
11
|
}>>;
|
|
12
12
|
ImageSource: RNAnimated.AnimatedComponent<import("react").MemoExoticComponent<({ id, url, ...props }: import("../..").ImageSourceProps) => import("react/jsx-runtime").JSX.Element>>;
|
|
13
|
-
Marker: RNAnimated.AnimatedComponent<({ id, anchor, offset, ...props }: import("../..").MarkerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
|
+
Marker: RNAnimated.AnimatedComponent<({ id, anchor, offset, ref, ...props }: import("../..").MarkerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
14
14
|
Layer: RNAnimated.AnimatedComponent<({ id, ...props }: import("../..").LayerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
15
|
Point: typeof AnimatedPoint;
|
|
16
16
|
CoordinatesArray: typeof AnimatedCoordinatesArray;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
2
|
-
import { type ViewProps } from "react-native";
|
|
1
|
+
import { Component, type ComponentProps, type ReactElement, type Ref } from "react";
|
|
2
|
+
import { type NativeMethods, type ViewProps } from "react-native";
|
|
3
|
+
import MarkerViewNativeComponent from "./MarkerViewNativeComponent";
|
|
3
4
|
import { type Anchor } from "../../../types/Anchor";
|
|
4
5
|
import type { LngLat } from "../../../types/LngLat";
|
|
5
6
|
import type { PixelPoint } from "../../../types/PixelPoint";
|
|
7
|
+
import { type NativeViewAnnotationRef } from "../view-annotation/ViewAnnotation";
|
|
8
|
+
export type NativeMarkerRef = Component<ComponentProps<typeof MarkerViewNativeComponent>> & Readonly<NativeMethods>;
|
|
9
|
+
export interface MarkerRef {
|
|
10
|
+
/**
|
|
11
|
+
* Returns a reference to the native component for Reanimated compatibility.
|
|
12
|
+
* This method is used by Reanimated's createAnimatedComponent to determine
|
|
13
|
+
* which component should receive animated props.
|
|
14
|
+
*
|
|
15
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent/#component
|
|
16
|
+
*/
|
|
17
|
+
getAnimatableRef(): NativeMarkerRef | NativeViewAnnotationRef | null;
|
|
18
|
+
}
|
|
6
19
|
export interface MarkerProps extends ViewProps {
|
|
7
20
|
/**
|
|
8
21
|
* A string that uniquely identifies the marker.
|
|
@@ -35,9 +48,13 @@ export interface MarkerProps extends ViewProps {
|
|
|
35
48
|
*/
|
|
36
49
|
selected?: boolean;
|
|
37
50
|
/**
|
|
38
|
-
* Expects one child - can be
|
|
51
|
+
* Expects one child - can be a View with multiple elements.
|
|
39
52
|
*/
|
|
40
53
|
children: ReactElement;
|
|
54
|
+
/**
|
|
55
|
+
* Ref to access Marker methods.
|
|
56
|
+
*/
|
|
57
|
+
ref?: Ref<MarkerRef>;
|
|
41
58
|
}
|
|
42
59
|
/**
|
|
43
60
|
* Marker allows you to place an interactive React Native View on the map.
|
|
@@ -48,5 +65,5 @@ export interface MarkerProps extends ViewProps {
|
|
|
48
65
|
* - Android: Native Views placed on the map projection
|
|
49
66
|
* - iOS: [MLNPointAnnotation](https://maplibre.org/maplibre-native/ios/latest/documentation/maplibre/mlnpointannotation/)
|
|
50
67
|
*/
|
|
51
|
-
export declare const Marker: ({ id, anchor, offset, ...props }: MarkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export declare const Marker: ({ id, anchor, offset, ref, ...props }: MarkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
69
|
//# sourceMappingURL=Marker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/annotations/marker/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/annotations/marker/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,GAAG,EAGT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,SAAS,CACrC,cAAc,CAAC,OAAO,yBAAyB,CAAC,CACjD,GACC,QAAQ,CAAC,aAAa,CAAC,CAAC;AAE1B,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,gBAAgB,IAAI,eAAe,GAAG,uBAAuB,GAAG,IAAI,CAAC;CACtE;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IAEvB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,GAAI,uCAMpB,WAAW,4CAmDb,CAAC"}
|
package/lib/typescript/module/src/components/annotations/view-annotation/ViewAnnotation.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
2
|
-
import { type NativeSyntheticEvent, type ViewProps } from "react-native";
|
|
1
|
+
import { Component, type ComponentProps, type ReactElement, type Ref } from "react";
|
|
2
|
+
import { type NativeMethods, type NativeSyntheticEvent, type ViewProps } from "react-native";
|
|
3
|
+
import PointAnnotationNativeComponent from "./PointAnnotationNativeComponent";
|
|
3
4
|
import { type Anchor } from "../../../types/Anchor";
|
|
4
5
|
import type { LngLat } from "../../../types/LngLat";
|
|
5
6
|
import type { PixelPoint } from "../../../types/PixelPoint";
|
|
6
7
|
import type { PressEvent } from "../../../types/PressEvent";
|
|
8
|
+
export type NativeViewAnnotationRef = Component<ComponentProps<typeof PointAnnotationNativeComponent>> & Readonly<NativeMethods>;
|
|
7
9
|
export type ViewAnnotationEvent = PressEvent & {
|
|
8
10
|
id: string;
|
|
9
11
|
};
|
|
@@ -68,11 +70,15 @@ export interface ViewAnnotationProps {
|
|
|
68
70
|
* This callback is fired while this annotation is being dragged.
|
|
69
71
|
*/
|
|
70
72
|
onDrag?: (event: NativeSyntheticEvent<ViewAnnotationEvent>) => void;
|
|
73
|
+
style?: ViewProps["style"];
|
|
71
74
|
/**
|
|
72
75
|
* Expects one child, and an optional callout can be added as well
|
|
73
76
|
*/
|
|
74
77
|
children: ReactElement | [ReactElement, ReactElement];
|
|
75
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Ref to access ViewAnnotation methods.
|
|
80
|
+
*/
|
|
81
|
+
ref?: Ref<ViewAnnotationRef>;
|
|
76
82
|
}
|
|
77
83
|
export interface ViewAnnotationRef {
|
|
78
84
|
/**
|
|
@@ -81,6 +87,14 @@ export interface ViewAnnotationRef {
|
|
|
81
87
|
* Call this for example from Image#onLoad.
|
|
82
88
|
*/
|
|
83
89
|
refresh(): void;
|
|
90
|
+
/**
|
|
91
|
+
* Returns a reference to the native component for Reanimated compatibility.
|
|
92
|
+
* This method is used by Reanimated's createAnimatedComponent to determine
|
|
93
|
+
* which component should receive animated props.
|
|
94
|
+
*
|
|
95
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent/#component
|
|
96
|
+
*/
|
|
97
|
+
getAnimatableRef(): NativeViewAnnotationRef | null;
|
|
84
98
|
}
|
|
85
99
|
/**
|
|
86
100
|
* ViewAnnotation represents a one-dimensional shape located at a single geographical coordinate.
|
|
@@ -91,5 +105,5 @@ export interface ViewAnnotationRef {
|
|
|
91
105
|
* If you need interactive views please use Marker,
|
|
92
106
|
* as with ViewAnnotation on Android child views are rendered onto a bitmap for better performance.
|
|
93
107
|
*/
|
|
94
|
-
export declare const ViewAnnotation:
|
|
108
|
+
export declare const ViewAnnotation: ({ id, anchor, draggable, offset, ref, ...props }: ViewAnnotationProps) => import("react/jsx-runtime").JSX.Element;
|
|
95
109
|
//# sourceMappingURL=ViewAnnotation.d.ts.map
|
package/lib/typescript/module/src/components/annotations/view-annotation/ViewAnnotation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewAnnotation.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/annotations/view-annotation/ViewAnnotation.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ViewAnnotation.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/annotations/view-annotation/ViewAnnotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,KAAK,cAAc,EAEnB,KAAK,YAAY,EACjB,KAAK,GAAG,EAGT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAIzB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,8BAEN,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAW5D,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAC7C,cAAc,CAAC,OAAO,8BAA8B,CAAC,CACtD,GACC,QAAQ,CAAC,aAAa,CAAC,CAAC;AAE1B,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG;IAC7C,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAExE;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAE1E;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAEzE;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAEvE;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAEpE,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAE3B;;OAEG;IACH,QAAQ,EAAE,YAAY,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAEtD;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAAC;IAEhB;;;;;;OAMG;IACH,gBAAgB,IAAI,uBAAuB,GAAG,IAAI,CAAC;CACpD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAI,kDAO5B,mBAAmB,4CA6DrB,CAAC"}
|
|
@@ -102,17 +102,17 @@ export interface MapRef {
|
|
|
102
102
|
* Converts geographic coordinates to pixel point of the view
|
|
103
103
|
*
|
|
104
104
|
* @example
|
|
105
|
-
* await mapRef.current?.
|
|
105
|
+
* await mapRef.current?.project([13.04214014753952, 47.80554907882145]);
|
|
106
106
|
*
|
|
107
|
-
* @param
|
|
107
|
+
* @param lngLat Geographic coordinate
|
|
108
108
|
* @return Pixel point
|
|
109
109
|
*/
|
|
110
|
-
project(
|
|
110
|
+
project(lngLat: LngLat): Promise<PixelPoint>;
|
|
111
111
|
/**
|
|
112
112
|
* Converts a pixel point of the view to geographic coordinates.
|
|
113
113
|
*
|
|
114
114
|
* @example
|
|
115
|
-
* await mapRef.current?.
|
|
115
|
+
* await mapRef.current?.unproject([280, 640]);
|
|
116
116
|
*
|
|
117
117
|
* @param point Pixel point
|
|
118
118
|
* @return Geographic coordinate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.d.ts","sourceRoot":"","sources":["../../../../../../src/components/map/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAML,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,oBAAoB,EAIzB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAU3D,MAAM,MAAM,oBAAoB,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AAI,CAAC,KAAK,IAAI,CAAC;IAExE;;OAEG;IACH,yBAAyB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAExE;;OAEG;IACH,8BAA8B,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAE7E;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAEtE;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAEtE;;OAEG;IACH,4BAA4B,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAE3E;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACvE;AAED;;GAEG;AACH,eAAO,MAAM,GAAG,wFA6Jf,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { type CameraOptions, type CameraEasing, type CameraAnimationOptions, type CameraCenterOptions, type CameraBoundsOptions, type CameraCenterStop, type CameraBoundsStop, type CameraStop, type InitialViewState, type TrackUserLocation, type TrackUserLocationChangeEvent, type CameraRef, type CameraProps, Camera, } from "./components/camera/Camera";
|
|
2
2
|
export { type ViewState, type ViewStateChangeEvent, type MapRef, type MapProps, Map, } from "./components/map/Map";
|
|
3
|
-
export {
|
|
3
|
+
export { type ViewAnnotationEvent, type NativeViewAnnotationRef, type ViewAnnotationRef, type ViewAnnotationProps, ViewAnnotation, } from "./components/annotations/view-annotation/ViewAnnotation";
|
|
4
4
|
export { type LayerAnnotationProps, LayerAnnotation, } from "./components/annotations/LayerAnnotation";
|
|
5
5
|
export { Callout, type CalloutProps, } from "./components/annotations/callout/Callout";
|
|
6
6
|
export { UserLocation } from "./components/user-location/UserLocation";
|
|
@@ -13,7 +13,7 @@ export { type VectorSourceRef, type VectorSourceProps, VectorSource, } from "./c
|
|
|
13
13
|
export { Layer, type LayerProps, type SourceLayerProps, type FillLayerProps, type LineLayerProps, type SymbolLayerProps, type CircleLayerProps, type HeatmapLayerProps, type FillExtrusionLayerProps, type RasterLayerProps, type BackgroundLayerProps, } from "./components/layer/Layer";
|
|
14
14
|
export type { LayerSpecification, FillLayerSpecification, LineLayerSpecification, SymbolLayerSpecification, CircleLayerSpecification, HeatmapLayerSpecification, FillExtrusionLayerSpecification, RasterLayerSpecification, HillshadeLayerSpecification, BackgroundLayerSpecification, SourceSpecification, VectorSourceSpecification, RasterSourceSpecification, RasterDEMSourceSpecification, GeoJSONSourceSpecification, VideoSourceSpecification, ImageSourceSpecification, FilterSpecification, StyleSpecification, SkySpecification, LightSpecification, TerrainSpecification, ProjectionSpecification, } from "@maplibre/maplibre-gl-style-spec";
|
|
15
15
|
export { type ImageSourceWithSdf, type ImageEntry, type ImagesProps, Images, } from "./components/images/Images";
|
|
16
|
-
export { Marker, type MarkerProps, } from "./components/annotations/marker/Marker";
|
|
16
|
+
export { Marker, type NativeMarkerRef, type MarkerRef, type MarkerProps, } from "./components/annotations/marker/Marker";
|
|
17
17
|
export { LocationManager, type GeolocationPosition, } from "./modules/location/LocationManager";
|
|
18
18
|
export { LogManager, type LogLevel } from "./modules/log/LogManager";
|
|
19
19
|
export { NetworkManager } from "./modules/network/NetworkManager";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACjC,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,MAAM,GACP,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,GAAG,GACJ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACjC,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,MAAM,GACP,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,GAAG,GACJ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,cAAc,GACf,MAAM,yDAAyD,CAAC;AAEjE,OAAO,EACL,KAAK,oBAAoB,EACzB,eAAe,GAChB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EACL,OAAO,EACP,KAAK,YAAY,GAClB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EACL,KAAK,gBAAgB,EACrB,WAAW,GACZ,MAAM,+C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12
|
ImageSource: RNAnimated.AnimatedComponent<import("react").MemoExoticComponent<({ id, url, ...props }: import("../..").ImageSourceProps) => import("react/jsx-runtime").JSX.Element>>;
|
|
13
|
-
Marker: RNAnimated.AnimatedComponent<({ id, anchor, offset, ...props }: import("../..").MarkerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
|
+
Marker: RNAnimated.AnimatedComponent<({ id, anchor, offset, ref, ...props }: import("../..").MarkerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
14
14
|
Layer: RNAnimated.AnimatedComponent<({ id, ...props }: import("../..").LayerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
15
|
Point: typeof AnimatedPoint;
|
|
16
16
|
CoordinatesArray: typeof AnimatedCoordinatesArray;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maplibre/maplibre-react-native",
|
|
3
3
|
"description": "React Native library for creating maps with MapLibre Native for Android & iOS",
|
|
4
|
-
"version": "11.0.0-beta.
|
|
4
|
+
"version": "11.0.0-beta.6",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": true
|
|
@@ -2,6 +2,8 @@ import {
|
|
|
2
2
|
Component,
|
|
3
3
|
type ComponentProps,
|
|
4
4
|
type ReactElement,
|
|
5
|
+
type Ref,
|
|
6
|
+
useImperativeHandle,
|
|
5
7
|
useRef,
|
|
6
8
|
} from "react";
|
|
7
9
|
import {
|
|
@@ -17,10 +19,27 @@ import { type Anchor, anchorToNative } from "../../../types/Anchor";
|
|
|
17
19
|
import type { LngLat } from "../../../types/LngLat";
|
|
18
20
|
import type { PixelPoint } from "../../../types/PixelPoint";
|
|
19
21
|
import {
|
|
22
|
+
type NativeViewAnnotationRef,
|
|
20
23
|
ViewAnnotation,
|
|
21
24
|
type ViewAnnotationRef,
|
|
22
25
|
} from "../view-annotation/ViewAnnotation";
|
|
23
26
|
|
|
27
|
+
export type NativeMarkerRef = Component<
|
|
28
|
+
ComponentProps<typeof MarkerViewNativeComponent>
|
|
29
|
+
> &
|
|
30
|
+
Readonly<NativeMethods>;
|
|
31
|
+
|
|
32
|
+
export interface MarkerRef {
|
|
33
|
+
/**
|
|
34
|
+
* Returns a reference to the native component for Reanimated compatibility.
|
|
35
|
+
* This method is used by Reanimated's createAnimatedComponent to determine
|
|
36
|
+
* which component should receive animated props.
|
|
37
|
+
*
|
|
38
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent/#component
|
|
39
|
+
*/
|
|
40
|
+
getAnimatableRef(): NativeMarkerRef | NativeViewAnnotationRef | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
24
43
|
export interface MarkerProps extends ViewProps {
|
|
25
44
|
/**
|
|
26
45
|
* A string that uniquely identifies the marker.
|
|
@@ -58,9 +77,14 @@ export interface MarkerProps extends ViewProps {
|
|
|
58
77
|
selected?: boolean;
|
|
59
78
|
|
|
60
79
|
/**
|
|
61
|
-
* Expects one child - can be
|
|
80
|
+
* Expects one child - can be a View with multiple elements.
|
|
62
81
|
*/
|
|
63
82
|
children: ReactElement;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Ref to access Marker methods.
|
|
86
|
+
*/
|
|
87
|
+
ref?: Ref<MarkerRef>;
|
|
64
88
|
}
|
|
65
89
|
|
|
66
90
|
/**
|
|
@@ -76,19 +100,27 @@ export const Marker = ({
|
|
|
76
100
|
id,
|
|
77
101
|
anchor = "center",
|
|
78
102
|
offset,
|
|
103
|
+
ref,
|
|
79
104
|
...props
|
|
80
105
|
}: MarkerProps) => {
|
|
81
|
-
const nativeRef = useRef<
|
|
82
|
-
|
|
83
|
-
Readonly<NativeMethods>
|
|
84
|
-
>(null);
|
|
106
|
+
const nativeRef = useRef<NativeMarkerRef>(null);
|
|
107
|
+
const viewAnnotationRef = useRef<ViewAnnotationRef>(null);
|
|
85
108
|
|
|
86
109
|
const nativeAnchor = anchorToNative(anchor);
|
|
87
110
|
const nativeOffset = offset ? { x: offset[0], y: offset[1] } : undefined;
|
|
88
111
|
|
|
89
|
-
const viewAnnotationRef = useRef<ViewAnnotationRef>(null);
|
|
90
112
|
const frozenId = useFrozenId(id);
|
|
91
113
|
|
|
114
|
+
useImperativeHandle(
|
|
115
|
+
ref,
|
|
116
|
+
(): MarkerRef => ({
|
|
117
|
+
getAnimatableRef: () =>
|
|
118
|
+
Platform.OS === "ios"
|
|
119
|
+
? (viewAnnotationRef.current?.getAnimatableRef() ?? null)
|
|
120
|
+
: nativeRef.current,
|
|
121
|
+
}),
|
|
122
|
+
);
|
|
123
|
+
|
|
92
124
|
if (Platform.OS === "ios") {
|
|
93
125
|
return (
|
|
94
126
|
<ViewAnnotation
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
Children,
|
|
3
3
|
Component,
|
|
4
4
|
type ComponentProps,
|
|
5
|
-
forwardRef,
|
|
6
5
|
isValidElement,
|
|
7
6
|
type ReactElement,
|
|
7
|
+
type Ref,
|
|
8
8
|
useImperativeHandle,
|
|
9
9
|
useRef,
|
|
10
10
|
} from "react";
|
|
@@ -35,6 +35,11 @@ const styles = StyleSheet.create({
|
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
export type NativeViewAnnotationRef = Component<
|
|
39
|
+
ComponentProps<typeof PointAnnotationNativeComponent>
|
|
40
|
+
> &
|
|
41
|
+
Readonly<NativeMethods>;
|
|
42
|
+
|
|
38
43
|
export type ViewAnnotationEvent = PressEvent & {
|
|
39
44
|
id: string;
|
|
40
45
|
};
|
|
@@ -113,12 +118,17 @@ export interface ViewAnnotationProps {
|
|
|
113
118
|
*/
|
|
114
119
|
onDrag?: (event: NativeSyntheticEvent<ViewAnnotationEvent>) => void;
|
|
115
120
|
|
|
121
|
+
style?: ViewProps["style"];
|
|
122
|
+
|
|
116
123
|
/**
|
|
117
124
|
* Expects one child, and an optional callout can be added as well
|
|
118
125
|
*/
|
|
119
126
|
children: ReactElement | [ReactElement, ReactElement];
|
|
120
127
|
|
|
121
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Ref to access ViewAnnotation methods.
|
|
130
|
+
*/
|
|
131
|
+
ref?: Ref<ViewAnnotationRef>;
|
|
122
132
|
}
|
|
123
133
|
|
|
124
134
|
export interface ViewAnnotationRef {
|
|
@@ -128,6 +138,15 @@ export interface ViewAnnotationRef {
|
|
|
128
138
|
* Call this for example from Image#onLoad.
|
|
129
139
|
*/
|
|
130
140
|
refresh(): void;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Returns a reference to the native component for Reanimated compatibility.
|
|
144
|
+
* This method is used by Reanimated's createAnimatedComponent to determine
|
|
145
|
+
* which component should receive animated props.
|
|
146
|
+
*
|
|
147
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent/#component
|
|
148
|
+
*/
|
|
149
|
+
getAnimatableRef(): NativeViewAnnotationRef | null;
|
|
131
150
|
}
|
|
132
151
|
|
|
133
152
|
/**
|
|
@@ -139,81 +158,72 @@ export interface ViewAnnotationRef {
|
|
|
139
158
|
* If you need interactive views please use Marker,
|
|
140
159
|
* as with ViewAnnotation on Android child views are rendered onto a bitmap for better performance.
|
|
141
160
|
*/
|
|
142
|
-
export const ViewAnnotation =
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
161
|
+
export const ViewAnnotation = ({
|
|
162
|
+
id,
|
|
163
|
+
anchor = "center",
|
|
164
|
+
draggable = false,
|
|
165
|
+
offset,
|
|
166
|
+
ref,
|
|
167
|
+
...props
|
|
168
|
+
}: ViewAnnotationProps) => {
|
|
169
|
+
const frozenId = useFrozenId(id);
|
|
170
|
+
const nativeAnchor = anchorToNative(anchor);
|
|
171
|
+
const nativeOffset = offset ? { x: offset[0], y: offset[1] } : undefined;
|
|
172
|
+
const nativeRef = useRef<NativeViewAnnotationRef>(null);
|
|
173
|
+
|
|
174
|
+
useImperativeHandle(
|
|
154
175
|
ref,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
176
|
+
(): ViewAnnotationRef => ({
|
|
177
|
+
refresh,
|
|
178
|
+
getAnimatableRef: () => nativeRef.current,
|
|
179
|
+
}),
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
function refresh(): void {
|
|
183
|
+
if (Platform.OS === "android" && nativeRef.current) {
|
|
184
|
+
Commands.refresh(nativeRef.current);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// On Android, wrap children in a non-collapsable View to prevent Fabric
|
|
189
|
+
// from flattening the view hierarchy. Without this, Fabric may flatten
|
|
190
|
+
// intermediate Views, causing their backgrounds to disappear.
|
|
191
|
+
// We need to keep Callout separate so native code can identify it.
|
|
192
|
+
const wrappedChildren = (() => {
|
|
193
|
+
if (Platform.OS !== "android") {
|
|
194
|
+
return props.children;
|
|
175
195
|
}
|
|
176
196
|
|
|
177
|
-
//
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
// Separate Callout from other children so native can identify it
|
|
187
|
-
const childArray = Children.toArray(props.children);
|
|
188
|
-
const callout = childArray.find(
|
|
189
|
-
(child) => isValidElement(child) && child.type === Callout,
|
|
190
|
-
);
|
|
191
|
-
const otherChildren = childArray.filter(
|
|
192
|
-
(child) => !isValidElement(child) || child.type !== Callout,
|
|
193
|
-
);
|
|
194
|
-
|
|
195
|
-
return (
|
|
196
|
-
<>
|
|
197
|
-
<View collapsable={false} style={{ overflow: "visible" }}>
|
|
198
|
-
{otherChildren}
|
|
199
|
-
</View>
|
|
200
|
-
{callout}
|
|
201
|
-
</>
|
|
202
|
-
);
|
|
203
|
-
})();
|
|
197
|
+
// Separate Callout from other children so native can identify it
|
|
198
|
+
const childArray = Children.toArray(props.children);
|
|
199
|
+
const callout = childArray.find(
|
|
200
|
+
(child) => isValidElement(child) && child.type === Callout,
|
|
201
|
+
);
|
|
202
|
+
const otherChildren = childArray.filter(
|
|
203
|
+
(child) => !isValidElement(child) || child.type !== Callout,
|
|
204
|
+
);
|
|
204
205
|
|
|
205
206
|
return (
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
draggable={draggable}
|
|
213
|
-
style={[props.style, styles.container]}
|
|
214
|
-
>
|
|
215
|
-
{wrappedChildren}
|
|
216
|
-
</PointAnnotationNativeComponent>
|
|
207
|
+
<>
|
|
208
|
+
<View collapsable={false} style={{ overflow: "visible" }}>
|
|
209
|
+
{otherChildren}
|
|
210
|
+
</View>
|
|
211
|
+
{callout}
|
|
212
|
+
</>
|
|
217
213
|
);
|
|
218
|
-
}
|
|
219
|
-
|
|
214
|
+
})();
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
<PointAnnotationNativeComponent
|
|
218
|
+
ref={nativeRef}
|
|
219
|
+
{...props}
|
|
220
|
+
id={frozenId}
|
|
221
|
+
anchor={nativeAnchor}
|
|
222
|
+
offset={nativeOffset}
|
|
223
|
+
draggable={draggable}
|
|
224
|
+
style={[props.style, styles.container]}
|
|
225
|
+
>
|
|
226
|
+
{wrappedChildren}
|
|
227
|
+
</PointAnnotationNativeComponent>
|
|
228
|
+
);
|
|
229
|
+
};
|
|
@@ -142,18 +142,18 @@ export interface MapRef {
|
|
|
142
142
|
* Converts geographic coordinates to pixel point of the view
|
|
143
143
|
*
|
|
144
144
|
* @example
|
|
145
|
-
* await mapRef.current?.
|
|
145
|
+
* await mapRef.current?.project([13.04214014753952, 47.80554907882145]);
|
|
146
146
|
*
|
|
147
|
-
* @param
|
|
147
|
+
* @param lngLat Geographic coordinate
|
|
148
148
|
* @return Pixel point
|
|
149
149
|
*/
|
|
150
|
-
project(
|
|
150
|
+
project(lngLat: LngLat): Promise<PixelPoint>;
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
153
|
* Converts a pixel point of the view to geographic coordinates.
|
|
154
154
|
*
|
|
155
155
|
* @example
|
|
156
|
-
* await mapRef.current?.
|
|
156
|
+
* await mapRef.current?.unproject([280, 640]);
|
|
157
157
|
*
|
|
158
158
|
* @param point Pixel point
|
|
159
159
|
* @return Geographic coordinate
|
package/src/index.ts
CHANGED
|
@@ -24,10 +24,11 @@ export {
|
|
|
24
24
|
} from "./components/map/Map";
|
|
25
25
|
|
|
26
26
|
export {
|
|
27
|
-
ViewAnnotation,
|
|
28
|
-
type ViewAnnotationProps,
|
|
29
|
-
type ViewAnnotationRef,
|
|
30
27
|
type ViewAnnotationEvent,
|
|
28
|
+
type NativeViewAnnotationRef,
|
|
29
|
+
type ViewAnnotationRef,
|
|
30
|
+
type ViewAnnotationProps,
|
|
31
|
+
ViewAnnotation,
|
|
31
32
|
} from "./components/annotations/view-annotation/ViewAnnotation";
|
|
32
33
|
|
|
33
34
|
export {
|
|
@@ -122,6 +123,8 @@ export {
|
|
|
122
123
|
|
|
123
124
|
export {
|
|
124
125
|
Marker,
|
|
126
|
+
type NativeMarkerRef,
|
|
127
|
+
type MarkerRef,
|
|
125
128
|
type MarkerProps,
|
|
126
129
|
} from "./components/annotations/marker/Marker";
|
|
127
130
|
|