@maplibre/maplibre-react-native 11.0.0-alpha.42 → 11.0.0-alpha.43

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 (137) hide show
  1. package/android/build.gradle +1 -3
  2. package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.kt +3 -3
  3. package/android/src/main/java/org/maplibre/reactnative/components/annotations/callout/MLRNCallout.kt +7 -0
  4. package/android/src/main/java/org/maplibre/reactnative/components/annotations/callout/MLRNCalloutManager.kt +29 -0
  5. package/android/src/main/java/org/maplibre/reactnative/components/annotations/markerview/MLRNMarkerView.kt +220 -0
  6. package/android/src/main/java/org/maplibre/reactnative/components/annotations/markerview/MLRNMarkerViewContent.kt +50 -0
  7. package/android/src/main/java/org/maplibre/reactnative/components/annotations/markerview/MLRNMarkerViewManager.kt +81 -0
  8. package/android/src/main/java/org/maplibre/reactnative/components/annotations/markerview/MarkerViewManager.kt +127 -0
  9. package/android/src/main/java/org/maplibre/reactnative/components/annotations/pointannotation/MLRNPointAnnotation.kt +407 -0
  10. package/android/src/main/java/org/maplibre/reactnative/components/annotations/pointannotation/MLRNPointAnnotationManager.kt +105 -0
  11. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.kt +38 -37
  12. package/android/src/main/java/org/maplibre/reactnative/events/PointAnnotationClickEvent.java +1 -1
  13. package/android/src/main/java/org/maplibre/reactnative/events/PointAnnotationDragEvent.java +1 -1
  14. package/android/src/main/java/org/maplibre/reactnative/events/PointAnnotationEvent.kt +30 -0
  15. package/ios/components/annotations/callout/MLRNCalloutComponentView.h +10 -0
  16. package/ios/components/annotations/callout/MLRNCalloutComponentView.mm +91 -0
  17. package/ios/components/annotations/point-annotation/MLRNPointAnnotation.h +44 -0
  18. package/ios/components/annotations/{MLRNPointAnnotation.m → point-annotation/MLRNPointAnnotation.m} +69 -35
  19. package/ios/components/annotations/point-annotation/MLRNPointAnnotationComponentView.h +10 -0
  20. package/ios/components/annotations/point-annotation/MLRNPointAnnotationComponentView.mm +331 -0
  21. package/ios/components/map-view/MLRNMapView.m +4 -5
  22. package/lib/commonjs/components/annotations/callout/Callout.js +94 -0
  23. package/lib/commonjs/components/annotations/callout/Callout.js.map +1 -0
  24. package/lib/commonjs/components/annotations/callout/CalloutNativeComponent.ts +11 -0
  25. package/lib/commonjs/components/annotations/marker-view/MarkerView.js +70 -0
  26. package/lib/commonjs/components/annotations/marker-view/MarkerView.js.map +1 -0
  27. package/lib/commonjs/components/annotations/marker-view/MarkerViewNativeComponent.ts +30 -0
  28. package/lib/commonjs/components/annotations/point-annotation/PointAnnotation.js +88 -0
  29. package/lib/commonjs/components/annotations/point-annotation/PointAnnotation.js.map +1 -0
  30. package/lib/commonjs/components/annotations/point-annotation/PointAnnotationNativeComponent.ts +58 -0
  31. package/lib/commonjs/index.js +3 -3
  32. package/lib/commonjs/index.js.map +1 -1
  33. package/lib/commonjs/types/Anchor.js +68 -0
  34. package/lib/commonjs/types/Anchor.js.map +1 -0
  35. package/lib/commonjs/utils/animated/Animated.js +4 -0
  36. package/lib/commonjs/utils/animated/Animated.js.map +1 -1
  37. package/lib/module/components/annotations/callout/Callout.js +88 -0
  38. package/lib/module/components/annotations/callout/Callout.js.map +1 -0
  39. package/lib/module/components/annotations/callout/CalloutNativeComponent.ts +11 -0
  40. package/lib/module/components/annotations/marker-view/MarkerView.js +64 -0
  41. package/lib/module/components/annotations/marker-view/MarkerView.js.map +1 -0
  42. package/lib/module/components/annotations/marker-view/MarkerViewNativeComponent.ts +30 -0
  43. package/lib/module/components/annotations/point-annotation/PointAnnotation.js +83 -0
  44. package/lib/module/components/annotations/point-annotation/PointAnnotation.js.map +1 -0
  45. package/lib/module/components/annotations/point-annotation/PointAnnotationNativeComponent.ts +58 -0
  46. package/lib/module/index.js +3 -3
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/module/types/Anchor.js +64 -0
  49. package/lib/module/types/Anchor.js.map +1 -0
  50. package/lib/module/utils/animated/Animated.js +4 -0
  51. package/lib/module/utils/animated/Animated.js.map +1 -1
  52. package/lib/typescript/{module/src/components/annotations → commonjs/src/components/annotations/callout}/Callout.d.ts +9 -9
  53. package/lib/typescript/commonjs/src/components/annotations/callout/Callout.d.ts.map +1 -0
  54. package/lib/typescript/commonjs/src/components/annotations/callout/CalloutNativeComponent.d.ts +6 -0
  55. package/lib/typescript/commonjs/src/components/annotations/callout/CalloutNativeComponent.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/src/components/annotations/marker-view/MarkerView.d.ts +52 -0
  57. package/lib/typescript/commonjs/src/components/annotations/marker-view/MarkerView.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/src/components/annotations/marker-view/MarkerViewNativeComponent.d.ts +21 -0
  59. package/lib/typescript/commonjs/src/components/annotations/marker-view/MarkerViewNativeComponent.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/src/components/annotations/point-annotation/PointAnnotation.d.ts +95 -0
  61. package/lib/typescript/commonjs/src/components/annotations/point-annotation/PointAnnotation.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/src/components/annotations/point-annotation/PointAnnotationNativeComponent.d.ts +43 -0
  63. package/lib/typescript/commonjs/src/components/annotations/point-annotation/PointAnnotationNativeComponent.d.ts.map +1 -0
  64. package/lib/typescript/commonjs/src/index.d.ts +4 -4
  65. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/src/types/Anchor.d.ts +17 -0
  67. package/lib/typescript/commonjs/src/types/Anchor.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts +1 -0
  69. package/lib/typescript/commonjs/src/utils/animated/Animated.d.ts.map +1 -1
  70. package/lib/typescript/{commonjs/src/components/annotations → module/src/components/annotations/callout}/Callout.d.ts +9 -9
  71. package/lib/typescript/module/src/components/annotations/callout/Callout.d.ts.map +1 -0
  72. package/lib/typescript/module/src/components/annotations/callout/CalloutNativeComponent.d.ts +6 -0
  73. package/lib/typescript/module/src/components/annotations/callout/CalloutNativeComponent.d.ts.map +1 -0
  74. package/lib/typescript/module/src/components/annotations/marker-view/MarkerView.d.ts +52 -0
  75. package/lib/typescript/module/src/components/annotations/marker-view/MarkerView.d.ts.map +1 -0
  76. package/lib/typescript/module/src/components/annotations/marker-view/MarkerViewNativeComponent.d.ts +21 -0
  77. package/lib/typescript/module/src/components/annotations/marker-view/MarkerViewNativeComponent.d.ts.map +1 -0
  78. package/lib/typescript/module/src/components/annotations/point-annotation/PointAnnotation.d.ts +95 -0
  79. package/lib/typescript/module/src/components/annotations/point-annotation/PointAnnotation.d.ts.map +1 -0
  80. package/lib/typescript/module/src/components/annotations/point-annotation/PointAnnotationNativeComponent.d.ts +43 -0
  81. package/lib/typescript/module/src/components/annotations/point-annotation/PointAnnotationNativeComponent.d.ts.map +1 -0
  82. package/lib/typescript/module/src/index.d.ts +4 -4
  83. package/lib/typescript/module/src/index.d.ts.map +1 -1
  84. package/lib/typescript/module/src/types/Anchor.d.ts +17 -0
  85. package/lib/typescript/module/src/types/Anchor.d.ts.map +1 -0
  86. package/lib/typescript/module/src/utils/animated/Animated.d.ts +1 -0
  87. package/lib/typescript/module/src/utils/animated/Animated.d.ts.map +1 -1
  88. package/package.json +3 -1
  89. package/src/components/annotations/callout/Callout.tsx +145 -0
  90. package/src/components/annotations/callout/CalloutNativeComponent.ts +11 -0
  91. package/src/components/annotations/marker-view/MarkerView.tsx +124 -0
  92. package/src/components/annotations/marker-view/MarkerViewNativeComponent.ts +30 -0
  93. package/src/components/annotations/point-annotation/PointAnnotation.tsx +219 -0
  94. package/src/components/annotations/point-annotation/PointAnnotationNativeComponent.ts +58 -0
  95. package/src/index.ts +15 -4
  96. package/src/types/Anchor.ts +44 -0
  97. package/src/utils/animated/Animated.tsx +6 -0
  98. package/android/src/main/java/org/maplibre/reactnative/components/annotations/MLRNCallout.java +0 -11
  99. package/android/src/main/java/org/maplibre/reactnative/components/annotations/MLRNCalloutManager.java +0 -18
  100. package/android/src/main/java/org/maplibre/reactnative/components/annotations/MLRNMarkerView.java +0 -112
  101. package/android/src/main/java/org/maplibre/reactnative/components/annotations/MLRNMarkerViewManager.java +0 -45
  102. package/android/src/main/java/org/maplibre/reactnative/components/annotations/MLRNPointAnnotation.java +0 -361
  103. package/android/src/main/java/org/maplibre/reactnative/components/annotations/MLRNPointAnnotationManager.java +0 -84
  104. package/android/src/main/java/org/maplibre/reactnative/components/annotations/MarkerView.java +0 -23
  105. package/android/src/main/java/org/maplibre/reactnative/components/annotations/MarkerViewManager.java +0 -69
  106. package/ios/components/annotations/MLRNCalloutManager.h +0 -5
  107. package/ios/components/annotations/MLRNCalloutManager.m +0 -12
  108. package/ios/components/annotations/MLRNPointAnnotation.h +0 -33
  109. package/ios/components/annotations/MLRNPointAnnotationManager.h +0 -5
  110. package/ios/components/annotations/MLRNPointAnnotationManager.m +0 -27
  111. package/lib/commonjs/components/annotations/Callout.js +0 -101
  112. package/lib/commonjs/components/annotations/Callout.js.map +0 -1
  113. package/lib/commonjs/components/annotations/MarkerView.js +0 -60
  114. package/lib/commonjs/components/annotations/MarkerView.js.map +0 -1
  115. package/lib/commonjs/components/annotations/PointAnnotation.js +0 -114
  116. package/lib/commonjs/components/annotations/PointAnnotation.js.map +0 -1
  117. package/lib/module/components/annotations/Callout.js +0 -96
  118. package/lib/module/components/annotations/Callout.js.map +0 -1
  119. package/lib/module/components/annotations/MarkerView.js +0 -55
  120. package/lib/module/components/annotations/MarkerView.js.map +0 -1
  121. package/lib/module/components/annotations/PointAnnotation.js +0 -110
  122. package/lib/module/components/annotations/PointAnnotation.js.map +0 -1
  123. package/lib/typescript/commonjs/src/components/annotations/Callout.d.ts.map +0 -1
  124. package/lib/typescript/commonjs/src/components/annotations/MarkerView.d.ts +0 -44
  125. package/lib/typescript/commonjs/src/components/annotations/MarkerView.d.ts.map +0 -1
  126. package/lib/typescript/commonjs/src/components/annotations/PointAnnotation.d.ts +0 -90
  127. package/lib/typescript/commonjs/src/components/annotations/PointAnnotation.d.ts.map +0 -1
  128. package/lib/typescript/module/src/components/annotations/Callout.d.ts.map +0 -1
  129. package/lib/typescript/module/src/components/annotations/MarkerView.d.ts +0 -44
  130. package/lib/typescript/module/src/components/annotations/MarkerView.d.ts.map +0 -1
  131. package/lib/typescript/module/src/components/annotations/PointAnnotation.d.ts +0 -90
  132. package/lib/typescript/module/src/components/annotations/PointAnnotation.d.ts.map +0 -1
  133. package/src/components/annotations/Callout.tsx +0 -139
  134. package/src/components/annotations/MarkerView.tsx +0 -86
  135. package/src/components/annotations/PointAnnotation.tsx +0 -240
  136. /package/ios/components/annotations/{MLRNCallout.h → callout/MLRNCallout.h} +0 -0
  137. /package/ios/components/annotations/{MLRNCallout.m → callout/MLRNCallout.m} +0 -0
@@ -1,101 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NATIVE_MODULE_NAME = exports.Callout = void 0;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
9
- var _jsxRuntime = require("react/jsx-runtime");
10
- const NATIVE_MODULE_NAME = exports.NATIVE_MODULE_NAME = "MLRNCallout";
11
- const styles = _reactNative.StyleSheet.create({
12
- container: {
13
- alignItems: "center",
14
- justifyContent: "center",
15
- width: 180,
16
- zIndex: 9999999
17
- },
18
- content: {
19
- backgroundColor: "white",
20
- borderColor: "rgba(0, 0, 0, 0.2)",
21
- borderRadius: 3,
22
- borderWidth: 1,
23
- flex: 1,
24
- padding: 8,
25
- position: "relative"
26
- },
27
- tip: {
28
- backgroundColor: "transparent",
29
- borderBottomColor: "transparent",
30
- borderBottomWidth: 0,
31
- borderLeftColor: "transparent",
32
- borderLeftWidth: 8,
33
- borderRightColor: "transparent",
34
- borderRightWidth: 8,
35
- borderTopColor: "white",
36
- borderTopWidth: 16,
37
- elevation: 0,
38
- marginTop: -2,
39
- zIndex: 1000
40
- },
41
- title: {
42
- color: "black",
43
- textAlign: "center"
44
- }
45
- });
46
- /**
47
- * Callout that displays information about a selected annotation near the annotation.
48
- */
49
- const Callout = props => {
50
- const {
51
- title,
52
- style,
53
- containerStyle,
54
- contentStyle,
55
- tipStyle,
56
- textStyle,
57
- children
58
- } = props;
59
- const _containerStyle = [{
60
- position: "absolute",
61
- zIndex: 999,
62
- backgroundColor: "transparent",
63
- ...containerStyle
64
- }];
65
- const _hasChildren = _react.Children.count(children) > 0;
66
- const _renderDefaultCallout = () => {
67
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
68
- testID: "container",
69
- style: [styles.container, style],
70
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
71
- testID: "wrapper",
72
- style: [styles.content, contentStyle],
73
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
74
- testID: "title",
75
- style: [styles.title, textStyle],
76
- children: title
77
- })
78
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
79
- testID: "tip",
80
- style: [styles.tip, tipStyle]
81
- })]
82
- });
83
- };
84
- const _renderCustomCallout = () => {
85
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
86
- testID: "container",
87
- ...props,
88
- style: style,
89
- children: children
90
- });
91
- };
92
- const calloutContent = _hasChildren ? _renderCustomCallout() : _renderDefaultCallout();
93
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(MLRNCallout, {
94
- testID: "callout",
95
- style: _containerStyle,
96
- children: calloutContent
97
- });
98
- };
99
- exports.Callout = Callout;
100
- const MLRNCallout = (0, _reactNative.requireNativeComponent)(NATIVE_MODULE_NAME);
101
- //# sourceMappingURL=Callout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_reactNative","_jsxRuntime","NATIVE_MODULE_NAME","exports","styles","StyleSheet","create","container","alignItems","justifyContent","width","zIndex","content","backgroundColor","borderColor","borderRadius","borderWidth","flex","padding","position","tip","borderBottomColor","borderBottomWidth","borderLeftColor","borderLeftWidth","borderRightColor","borderRightWidth","borderTopColor","borderTopWidth","elevation","marginTop","title","color","textAlign","Callout","props","style","containerStyle","contentStyle","tipStyle","textStyle","children","_containerStyle","_hasChildren","Children","count","_renderDefaultCallout","jsxs","Animated","View","testID","jsx","Text","_renderCustomCallout","calloutContent","MLRNCallout","requireNativeComponent"],"sourceRoot":"../../../../src","sources":["components/annotations/Callout.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASsB,IAAAE,WAAA,GAAAF,OAAA;AAEf,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,aAAa;AAE/C,MAAME,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE;EACV,CAAC;EACDC,OAAO,EAAE;IACPC,eAAe,EAAE,OAAO;IACxBC,WAAW,EAAE,oBAAoB;IACjCC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,IAAI,EAAE,CAAC;IACPC,OAAO,EAAE,CAAC;IACVC,QAAQ,EAAE;EACZ,CAAC;EACDC,GAAG,EAAE;IACHP,eAAe,EAAE,aAAa;IAC9BQ,iBAAiB,EAAE,aAAa;IAChCC,iBAAiB,EAAE,CAAC;IACpBC,eAAe,EAAE,aAAa;IAC9BC,eAAe,EAAE,CAAC;IAClBC,gBAAgB,EAAE,aAAa;IAC/BC,gBAAgB,EAAE,CAAC;IACnBC,cAAc,EAAE,OAAO;IACvBC,cAAc,EAAE,EAAE;IAClBC,SAAS,EAAE,CAAC;IACZC,SAAS,EAAE,CAAC,CAAC;IACbnB,MAAM,EAAE;EACV,CAAC;EACDoB,KAAK,EAAE;IACLC,KAAK,EAAE,OAAO;IACdC,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAiCF;AACA;AACA;AACO,MAAMC,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,YAAA,CAAAgD,QAAQ,CAACC,IAAI;MAACC,MAAM,EAAC,WAAW;MAAA,GAAKf,KAAK;MAAEC,KAAK,EAAEA,KAAM;MAAAK,QAAA,EACvDA;IAAQ,CACI,CAAC;EAEpB,CAAC;EAED,MAAMa,cAAc,GAAGX,YAAY,GAC/BU,oBAAoB,CAAC,CAAC,GACtBP,qBAAqB,CAAC,CAAC;EAE3B,oBACE,IAAA7C,WAAA,CAAAkD,GAAA,EAACI,WAAW;IAACL,MAAM,EAAC,SAAS;IAACd,KAAK,EAAEM,eAAgB;IAAAD,QAAA,EAClDa;EAAc,CACJ,CAAC;AAElB,CAAC;AAACnD,OAAA,CAAA+B,OAAA,GAAAA,OAAA;AAEF,MAAMqB,WAAW,GAAG,IAAAC,mCAAsB,EAActD,kBAAkB,CAAC","ignoreList":[]}
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NATIVE_MODULE_NAME = exports.MarkerView = void 0;
7
- var _helpers = require("@turf/helpers");
8
- var _react = require("react");
9
- var _reactNative = require("react-native");
10
- var _PointAnnotation = require("./PointAnnotation.js");
11
- var _index = require("../../utils/index.js");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- const NATIVE_MODULE_NAME = exports.NATIVE_MODULE_NAME = "MLRNMarkerView";
14
- /**
15
- * MarkerView allows you to place a interactive react native marker to the map.
16
- *
17
- * If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance
18
- * .
19
- * This is based on [MakerView plugin](https://github.com/maplibre/maplibre-plugins-android/tree/main/plugin-markerview) on Android
20
- * and PointAnnotation on iOS.
21
- */
22
- const MarkerView = ({
23
- anchor = {
24
- x: 0.5,
25
- y: 0.5
26
- },
27
- allowOverlap = false,
28
- isSelected = false,
29
- ...rest
30
- }) => {
31
- const props = {
32
- anchor,
33
- allowOverlap,
34
- isSelected,
35
- ...rest
36
- };
37
- const coordinate = props.coordinate ? (0, _index.toJSONString)((0, _helpers.point)(props.coordinate)) : undefined;
38
- const idForPointAnnotation = (0, _react.useMemo)(() => {
39
- lastId = lastId + 1;
40
- return `MV-${lastId}`;
41
- }, []);
42
- if (_reactNative.Platform.OS === "ios") {
43
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PointAnnotation.PointAnnotation, {
44
- id: idForPointAnnotation,
45
- ...props
46
- });
47
- }
48
- const propsToSend = {
49
- ...props,
50
- coordinate
51
- };
52
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(MLRNMarkerView, {
53
- ...propsToSend,
54
- children: props.children
55
- });
56
- };
57
- exports.MarkerView = MarkerView;
58
- let lastId = 0;
59
- const MLRNMarkerView = (0, _reactNative.requireNativeComponent)(NATIVE_MODULE_NAME);
60
- //# sourceMappingURL=MarkerView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_helpers","require","_react","_reactNative","_PointAnnotation","_index","_jsxRuntime","NATIVE_MODULE_NAME","exports","MarkerView","anchor","x","y","allowOverlap","isSelected","rest","props","coordinate","toJSONString","point","undefined","idForPointAnnotation","useMemo","lastId","Platform","OS","jsx","PointAnnotation","id","propsToSend","MLRNMarkerView","children","requireNativeComponent"],"sourceRoot":"../../../../src","sources":["components/annotations/MarkerView.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA2C,IAAAK,WAAA,GAAAL,OAAA;AAEpC,MAAMM,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,gBAAgB;AAwClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,UAAU,GAAGA,CAAC;EACzBC,MAAM,GAAG;IAAEC,CAAC,EAAE,GAAG;IAAEC,CAAC,EAAE;EAAI,CAAC;EAC3BC,YAAY,GAAG,KAAK;EACpBC,UAAU,GAAG,KAAK;EAClB,GAAGC;AACY,CAAC,KAAK;EACrB,MAAMC,KAAK,GAAG;IAAEN,MAAM;IAAEG,YAAY;IAAEC,UAAU;IAAE,GAAGC;EAAK,CAAC;EAC3D,MAAME,UAAU,GAAGD,KAAK,CAACC,UAAU,GAC/B,IAAAC,mBAAY,EAAC,IAAAC,cAAK,EAACH,KAAK,CAACC,UAAU,CAAC,CAAC,GACrCG,SAAS;EAEb,MAAMC,oBAAoB,GAAG,IAAAC,cAAO,EAAC,MAAM;IACzCC,MAAM,GAAGA,MAAM,GAAG,CAAC;IACnB,OAAO,MAAMA,MAAM,EAAE;EACvB,CAAC,EAAE,EAAE,CAAC;EAEN,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzB,oBAAO,IAAAnB,WAAA,CAAAoB,GAAA,EAACtB,gBAAA,CAAAuB,eAAe;MAACC,EAAE,EAAEP,oBAAqB;MAAA,GAAKL;IAAK,CAAG,CAAC;EACjE;EAEA,MAAMa,WAAW,GAAG;IAClB,GAAGb,KAAK;IACRC;EACF,CAAC;EAED,oBAAO,IAAAX,WAAA,CAAAoB,GAAA,EAACI,cAAc;IAAA,GAAKD,WAAW;IAAAE,QAAA,EAAGf,KAAK,CAACe;EAAQ,CAAiB,CAAC;AAC3E,CAAC;AAACvB,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAEF,IAAIc,MAAM,GAAG,CAAC;AAEd,MAAMO,cAAc,GAAG,IAAAE,mCAAsB,EAAczB,kBAAkB,CAAC","ignoreList":[]}
@@ -1,114 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PointAnnotation = exports.NATIVE_MODULE_NAME = void 0;
7
- var _helpers = require("@turf/helpers");
8
- var _react = require("react");
9
- var _reactNative = require("react-native");
10
- var _useNativeBridge = require("../../hooks/useNativeBridge.js");
11
- var _index = require("../../utils/index.js");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- const NATIVE_MODULE_NAME = exports.NATIVE_MODULE_NAME = "MLRNPointAnnotation";
14
- const styles = _reactNative.StyleSheet.create({
15
- container: {
16
- alignItems: "center",
17
- justifyContent: "center",
18
- position: "absolute"
19
- }
20
- });
21
- /**
22
- * PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.
23
- *
24
- * Consider using GeoJSONSource and SymbolLayer instead, if you have many points, and you have static images,
25
- * they'll offer much better performance.
26
- *
27
- * If you need interactive views please use MarkerView,
28
- * as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.
29
- */
30
- const PointAnnotation = exports.PointAnnotation = /*#__PURE__*/(0, _react.forwardRef)(({
31
- anchor = {
32
- x: 0.5,
33
- y: 0.5
34
- },
35
- draggable = false,
36
- ...props
37
- }, ref) => {
38
- (0, _react.useImperativeHandle)(ref, () => ({
39
- /**
40
- * On android point annotation is rendered offscreen with a canvas into an image.
41
- * To rerender the image from the current state of the view call refresh.
42
- * Call this for example from Image#onLoad.
43
- */
44
- refresh
45
- }));
46
- const {
47
- _runNativeCommand,
48
- _runPendingNativeCommands
49
- } = (0, _useNativeBridge.useNativeBridge)(NATIVE_MODULE_NAME);
50
- const _nativeRef = (0, _react.useRef)(null);
51
- function refresh() {
52
- if (_reactNative.Platform.OS === "android") {
53
- _runNativeCommand("refresh", _nativeRef.current, []);
54
- }
55
- }
56
- function _onSelected(e) {
57
- if ((0, _index.isFunction)(props.onSelected)) {
58
- props.onSelected(e.nativeEvent.payload);
59
- }
60
- }
61
- function _onDeselected(e) {
62
- if ((0, _index.isFunction)(props.onDeselected)) {
63
- props.onDeselected(e.nativeEvent.payload);
64
- }
65
- }
66
- function _onDragStart(e) {
67
- if ((0, _index.isFunction)(props.onDragStart)) {
68
- props.onDragStart(e.nativeEvent.payload);
69
- }
70
- }
71
- function _onDrag(e) {
72
- if ((0, _index.isFunction)(props.onDrag)) {
73
- props.onDrag(e.nativeEvent.payload);
74
- }
75
- }
76
- function _onDragEnd(e) {
77
- if ((0, _index.isFunction)(props.onDragEnd)) {
78
- props.onDragEnd(e.nativeEvent.payload);
79
- }
80
- }
81
- function _getCoordinate() {
82
- if (!props.coordinate) {
83
- return undefined;
84
- }
85
- return (0, _index.toJSONString)((0, _helpers.point)(props.coordinate));
86
- }
87
- const _setNativeRef = nativeRef => {
88
- _nativeRef.current = nativeRef;
89
- _runPendingNativeCommands(nativeRef);
90
- };
91
- const nativeProps = {
92
- ...props,
93
- anchor,
94
- draggable,
95
- ref: nativeRef => _setNativeRef(nativeRef),
96
- id: props.id,
97
- title: props.title,
98
- snippet: props.snippet,
99
- selected: props.selected,
100
- style: [props.style, styles.container],
101
- onMapboxPointAnnotationSelected: _onSelected,
102
- onMapboxPointAnnotationDeselected: _onDeselected,
103
- onMapboxPointAnnotationDragStart: _onDragStart,
104
- onMapboxPointAnnotationDrag: _onDrag,
105
- onMapboxPointAnnotationDragEnd: _onDragEnd,
106
- coordinate: _getCoordinate()
107
- };
108
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(MLRNPointAnnotation, {
109
- ...nativeProps,
110
- children: props.children
111
- });
112
- });
113
- const MLRNPointAnnotation = (0, _reactNative.requireNativeComponent)(NATIVE_MODULE_NAME);
114
- //# sourceMappingURL=PointAnnotation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_helpers","require","_react","_reactNative","_useNativeBridge","_index","_jsxRuntime","NATIVE_MODULE_NAME","exports","styles","StyleSheet","create","container","alignItems","justifyContent","position","PointAnnotation","forwardRef","anchor","x","y","draggable","props","ref","useImperativeHandle","refresh","_runNativeCommand","_runPendingNativeCommands","useNativeBridge","_nativeRef","useRef","Platform","OS","current","_onSelected","e","isFunction","onSelected","nativeEvent","payload","_onDeselected","onDeselected","_onDragStart","onDragStart","_onDrag","onDrag","_onDragEnd","onDragEnd","_getCoordinate","coordinate","undefined","toJSONString","point","_setNativeRef","nativeRef","nativeProps","id","title","snippet","selected","style","onMapboxPointAnnotationSelected","onMapboxPointAnnotationDeselected","onMapboxPointAnnotationDragStart","onMapboxPointAnnotationDrag","onMapboxPointAnnotationDragEnd","jsx","MLRNPointAnnotation","children","requireNativeComponent"],"sourceRoot":"../../../../src","sources":["components/annotations/PointAnnotation.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAQA,IAAAE,YAAA,GAAAF,OAAA;AAOA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAuD,IAAAK,WAAA,GAAAL,OAAA;AAEhD,MAAMM,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,qBAAqB;AAEvD,MAAME,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAyFF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,GAAAR,OAAA,CAAAQ,eAAA,gBAAG,IAAAC,iBAAU,EAIvC,CACE;EACEC,MAAM,GAAG;IAAEC,CAAC,EAAE,GAAG;IAAEC,CAAC,EAAE;EAAI,CAAC;EAC3BC,SAAS,GAAG,KAAK;EACjB,GAAGC;AACiB,CAAC,EACvBC,GAAG,KACA;EACH,IAAAC,0BAAmB,EACjBD,GAAG,EACH,OAA2B;IACzB;AACR;AACA;AACA;AACA;IACQE;EACF,CAAC,CACH,CAAC;EAED,MAAM;IAAEC,iBAAiB;IAAEC;EAA0B,CAAC,GACpD,IAAAC,gCAAe,EAACrB,kBAAkB,CAAC;EACrC,MAAMsB,UAAU,GAAG,IAAAC,aAAM,EAAyB,IAAI,CAAC;EAEvD,SAASL,OAAOA,CAAA,EAAS;IACvB,IAAIM,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;MAC7BN,iBAAiB,CAAC,SAAS,EAAEG,UAAU,CAACI,OAAO,EAAE,EAA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AAyB,CAAC2B,SAAS,CAAC;EACtC,CAAC;EAED,MAAMC,WAAW,GAAG;IAClB,GAAGjC,KAAK;IACRJ,MAAM;IACNG,SAAS;IACTE,GAAG,EAAG+B,SAAwC,IAC5CD,aAAa,CAACC,SAAS,CAAC;IAC1BE,EAAE,EAAElC,KAAK,CAACkC,EAAE;IACZC,KAAK,EAAEnC,KAAK,CAACmC,KAAK;IAClBC,OAAO,EAAEpC,KAAK,CAACoC,OAAO;IACtBC,QAAQ,EAAErC,KAAK,CAACqC,QAAQ;IACxBC,KAAK,EAAE,CAACtC,KAAK,CAACsC,KAAK,EAAEnD,MAAM,CAACG,SAAS,CAAC;IACtCiD,+BAA+B,EAAE3B,WAAW;IAC5C4B,iCAAiC,EAAEtB,aAAa;IAChDuB,gCAAgC,EAAErB,YAAY;IAC9CsB,2BAA2B,EAAEpB,OAAO;IACpCqB,8BAA8B,EAAEnB,UAAU;IAC1CG,UAAU,EAAED,cAAc,CAAC;EAC7B,CAAC;EAED,oBACE,IAAA1C,WAAA,CAAA4D,GAAA,EAACC,mBAAmB;IAAA,GAAKZ,WAAW;IAAAa,QAAA,EACjC9C,KAAK,CAAC8C;EAAQ,CACI,CAAC;AAE1B,CACF,CAAC;AAED,MAAMD,mBAAmB,GACvB,IAAAE,mCAAsB,EAAc9D,kBAAkB,CAAC","ignoreList":[]}
@@ -1,96 +0,0 @@
1
- "use strict";
2
-
3
- import { Children } from "react";
4
- import { Animated, requireNativeComponent, StyleSheet, Text, View } from "react-native";
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- export const NATIVE_MODULE_NAME = "MLRNCallout";
7
- const styles = StyleSheet.create({
8
- container: {
9
- alignItems: "center",
10
- justifyContent: "center",
11
- width: 180,
12
- zIndex: 9999999
13
- },
14
- content: {
15
- backgroundColor: "white",
16
- borderColor: "rgba(0, 0, 0, 0.2)",
17
- borderRadius: 3,
18
- borderWidth: 1,
19
- flex: 1,
20
- padding: 8,
21
- position: "relative"
22
- },
23
- tip: {
24
- backgroundColor: "transparent",
25
- borderBottomColor: "transparent",
26
- borderBottomWidth: 0,
27
- borderLeftColor: "transparent",
28
- borderLeftWidth: 8,
29
- borderRightColor: "transparent",
30
- borderRightWidth: 8,
31
- borderTopColor: "white",
32
- borderTopWidth: 16,
33
- elevation: 0,
34
- marginTop: -2,
35
- zIndex: 1000
36
- },
37
- title: {
38
- color: "black",
39
- textAlign: "center"
40
- }
41
- });
42
- /**
43
- * Callout that displays information about a selected annotation near the annotation.
44
- */
45
- export const Callout = props => {
46
- const {
47
- title,
48
- style,
49
- containerStyle,
50
- contentStyle,
51
- tipStyle,
52
- textStyle,
53
- children
54
- } = props;
55
- const _containerStyle = [{
56
- position: "absolute",
57
- zIndex: 999,
58
- backgroundColor: "transparent",
59
- ...containerStyle
60
- }];
61
- const _hasChildren = Children.count(children) > 0;
62
- const _renderDefaultCallout = () => {
63
- return /*#__PURE__*/_jsxs(Animated.View, {
64
- testID: "container",
65
- style: [styles.container, style],
66
- children: [/*#__PURE__*/_jsx(View, {
67
- testID: "wrapper",
68
- style: [styles.content, contentStyle],
69
- children: /*#__PURE__*/_jsx(Text, {
70
- testID: "title",
71
- style: [styles.title, textStyle],
72
- children: title
73
- })
74
- }), /*#__PURE__*/_jsx(View, {
75
- testID: "tip",
76
- style: [styles.tip, tipStyle]
77
- })]
78
- });
79
- };
80
- const _renderCustomCallout = () => {
81
- return /*#__PURE__*/_jsx(Animated.View, {
82
- testID: "container",
83
- ...props,
84
- style: style,
85
- children: children
86
- });
87
- };
88
- const calloutContent = _hasChildren ? _renderCustomCallout() : _renderDefaultCallout();
89
- return /*#__PURE__*/_jsx(MLRNCallout, {
90
- testID: "callout",
91
- style: _containerStyle,
92
- children: calloutContent
93
- });
94
- };
95
- const MLRNCallout = requireNativeComponent(NATIVE_MODULE_NAME);
96
- //# sourceMappingURL=Callout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Children","Animated","requireNativeComponent","StyleSheet","Text","View","jsx","_jsx","jsxs","_jsxs","NATIVE_MODULE_NAME","styles","create","container","alignItems","justifyContent","width","zIndex","content","backgroundColor","borderColor","borderRadius","borderWidth","flex","padding","position","tip","borderBottomColor","borderBottomWidth","borderLeftColor","borderLeftWidth","borderRightColor","borderRightWidth","borderTopColor","borderTopWidth","elevation","marginTop","title","color","textAlign","Callout","props","style","containerStyle","contentStyle","tipStyle","textStyle","children","_containerStyle","_hasChildren","count","_renderDefaultCallout","testID","_renderCustomCallout","calloutContent","MLRNCallout"],"sourceRoot":"../../../../src","sources":["components/annotations/Callout.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SACEC,QAAQ,EACRC,sBAAsB,EAEtBC,UAAU,EACVC,IAAI,EACJC,IAAI,QAGC,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtB,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAE/C,MAAMC,MAAM,GAAGR,UAAU,CAACS,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE;EACV,CAAC;EACDC,OAAO,EAAE;IACPC,eAAe,EAAE,OAAO;IACxBC,WAAW,EAAE,oBAAoB;IACjCC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,IAAI,EAAE,CAAC;IACPC,OAAO,EAAE,CAAC;IACVC,QAAQ,EAAE;EACZ,CAAC;EACDC,GAAG,EAAE;IACHP,eAAe,EAAE,aAAa;IAC9BQ,iBAAiB,EAAE,aAAa;IAChCC,iBAAiB,EAAE,CAAC;IACpBC,eAAe,EAAE,aAAa;IAC9BC,eAAe,EAAE,CAAC;IAClBC,gBAAgB,EAAE,aAAa;IAC/BC,gBAAgB,EAAE,CAAC;IACnBC,cAAc,EAAE,OAAO;IACvBC,cAAc,EAAE,EAAE;IAClBC,SAA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,CAAA,KAAM;IACjC,oBACE9C,IAAA,CAACN,QAAQ,CAACI,IAAI;MAAC+C,MAAM,EAAC,WAAW;MAAA,GAAKX,KAAK;MAAEC,KAAK,EAAEA,KAAM;MAAAK,QAAA,EACvDA;IAAQ,CACI,CAAC;EAEpB,CAAC;EAED,MAAMO,cAAc,GAAGL,YAAY,GAC/BI,oBAAoB,CAAC,CAAC,GACtBF,qBAAqB,CAAC,CAAC;EAE3B,oBACE5C,IAAA,CAACgD,WAAW;IAACH,MAAM,EAAC,SAAS;IAACV,KAAK,EAAEM,eAAgB;IAAAD,QAAA,EAClDO;EAAc,CACJ,CAAC;AAElB,CAAC;AAED,MAAMC,WAAW,GAAGrD,sBAAsB,CAAcQ,kBAAkB,CAAC","ignoreList":[]}
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- import { point } from "@turf/helpers";
4
- import { useMemo } from "react";
5
- import { Platform, requireNativeComponent } from "react-native";
6
- import { PointAnnotation } from "./PointAnnotation.js";
7
- import { toJSONString } from "../../utils/index.js";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- export const NATIVE_MODULE_NAME = "MLRNMarkerView";
10
- /**
11
- * MarkerView allows you to place a interactive react native marker to the map.
12
- *
13
- * If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance
14
- * .
15
- * This is based on [MakerView plugin](https://github.com/maplibre/maplibre-plugins-android/tree/main/plugin-markerview) on Android
16
- * and PointAnnotation on iOS.
17
- */
18
- export const MarkerView = ({
19
- anchor = {
20
- x: 0.5,
21
- y: 0.5
22
- },
23
- allowOverlap = false,
24
- isSelected = false,
25
- ...rest
26
- }) => {
27
- const props = {
28
- anchor,
29
- allowOverlap,
30
- isSelected,
31
- ...rest
32
- };
33
- const coordinate = props.coordinate ? toJSONString(point(props.coordinate)) : undefined;
34
- const idForPointAnnotation = useMemo(() => {
35
- lastId = lastId + 1;
36
- return `MV-${lastId}`;
37
- }, []);
38
- if (Platform.OS === "ios") {
39
- return /*#__PURE__*/_jsx(PointAnnotation, {
40
- id: idForPointAnnotation,
41
- ...props
42
- });
43
- }
44
- const propsToSend = {
45
- ...props,
46
- coordinate
47
- };
48
- return /*#__PURE__*/_jsx(MLRNMarkerView, {
49
- ...propsToSend,
50
- children: props.children
51
- });
52
- };
53
- let lastId = 0;
54
- const MLRNMarkerView = requireNativeComponent(NATIVE_MODULE_NAME);
55
- //# sourceMappingURL=MarkerView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["point","useMemo","Platform","requireNativeComponent","PointAnnotation","toJSONString","jsx","_jsx","NATIVE_MODULE_NAME","MarkerView","anchor","x","y","allowOverlap","isSelected","rest","props","coordinate","undefined","idForPointAnnotation","lastId","OS","id","propsToSend","MLRNMarkerView","children"],"sourceRoot":"../../../../src","sources":["components/annotations/MarkerView.tsx"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,eAAe;AACrC,SAA4BC,OAAO,QAAQ,OAAO;AAClD,SAASC,QAAQ,EAAEC,sBAAsB,QAAwB,cAAc;AAE/E,SAASC,eAAe,QAAQ,sBAAmB;AACnD,SAASC,YAAY,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,OAAO,MAAMC,kBAAkB,GAAG,gBAAgB;AAwClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAGA,CAAC;EACzBC,MAAM,GAAG;IAAEC,CAAC,EAAE,GAAG;IAAEC,CAAC,EAAE;EAAI,CAAC;EAC3BC,YAAY,GAAG,KAAK;EACpBC,UAAU,GAAG,KAAK;EAClB,GAAGC;AACY,CAAC,KAAK;EACrB,MAAMC,KAAK,GAAG;IAAEN,MAAM;IAAEG,YAAY;IAAEC,UAAU;IAAE,GAAGC;EAAK,CAAC;EAC3D,MAAME,UAAU,GAAGD,KAAK,CAACC,UAAU,GAC/BZ,YAAY,CAACL,KAAK,CAACgB,KAAK,CAACC,UAAU,CAAC,CAAC,GACrCC,SAAS;EAEb,MAAMC,oBAAoB,GAAGlB,OAAO,CAAC,MAAM;IACzCmB,MAAM,GAAGA,MAAM,GAAG,CAAC;IACnB,OAAO,MAAMA,MAAM,EAAE;EACvB,CAAC,EAAE,EAAE,CAAC;EAEN,IAAIlB,QAAQ,CAACmB,EAAE,KAAK,KAAK,EAAE;IACzB,oBAAOd,IAAA,CAACH,eAAe;MAACkB,EAAE,EAAEH,oBAAqB;MAAA,GAAKH;IAAK,CAAG,CAAC;EACjE;EAEA,MAAMO,WAAW,GAAG;IAClB,GAAGP,KAAK;IACRC;EACF,CAAC;EAED,oBAAOV,IAAA,CAACiB,cAAc;IAAA,GAAKD,WAAW;IAAAE,QAAA,EAAGT,KAAK,CAACS;EAAQ,CAAiB,CAAC;AAC3E,CAAC;AAED,IAAIL,MAAM,GAAG,CAAC;AAEd,MAAMI,cAAc,GAAGrB,sBAAsB,CAAcK,kBAAkB,CAAC","ignoreList":[]}
@@ -1,110 +0,0 @@
1
- "use strict";
2
-
3
- import { point } from "@turf/helpers";
4
- import { forwardRef, useImperativeHandle, useRef } from "react";
5
- import { Platform, StyleSheet, requireNativeComponent } from "react-native";
6
- import { useNativeBridge } from "../../hooks/useNativeBridge.js";
7
- import { isFunction, toJSONString } from "../../utils/index.js";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- export const NATIVE_MODULE_NAME = "MLRNPointAnnotation";
10
- const styles = StyleSheet.create({
11
- container: {
12
- alignItems: "center",
13
- justifyContent: "center",
14
- position: "absolute"
15
- }
16
- });
17
- /**
18
- * PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.
19
- *
20
- * Consider using GeoJSONSource and SymbolLayer instead, if you have many points, and you have static images,
21
- * they'll offer much better performance.
22
- *
23
- * If you need interactive views please use MarkerView,
24
- * as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.
25
- */
26
- export const PointAnnotation = /*#__PURE__*/forwardRef(({
27
- anchor = {
28
- x: 0.5,
29
- y: 0.5
30
- },
31
- draggable = false,
32
- ...props
33
- }, ref) => {
34
- useImperativeHandle(ref, () => ({
35
- /**
36
- * On android point annotation is rendered offscreen with a canvas into an image.
37
- * To rerender the image from the current state of the view call refresh.
38
- * Call this for example from Image#onLoad.
39
- */
40
- refresh
41
- }));
42
- const {
43
- _runNativeCommand,
44
- _runPendingNativeCommands
45
- } = useNativeBridge(NATIVE_MODULE_NAME);
46
- const _nativeRef = useRef(null);
47
- function refresh() {
48
- if (Platform.OS === "android") {
49
- _runNativeCommand("refresh", _nativeRef.current, []);
50
- }
51
- }
52
- function _onSelected(e) {
53
- if (isFunction(props.onSelected)) {
54
- props.onSelected(e.nativeEvent.payload);
55
- }
56
- }
57
- function _onDeselected(e) {
58
- if (isFunction(props.onDeselected)) {
59
- props.onDeselected(e.nativeEvent.payload);
60
- }
61
- }
62
- function _onDragStart(e) {
63
- if (isFunction(props.onDragStart)) {
64
- props.onDragStart(e.nativeEvent.payload);
65
- }
66
- }
67
- function _onDrag(e) {
68
- if (isFunction(props.onDrag)) {
69
- props.onDrag(e.nativeEvent.payload);
70
- }
71
- }
72
- function _onDragEnd(e) {
73
- if (isFunction(props.onDragEnd)) {
74
- props.onDragEnd(e.nativeEvent.payload);
75
- }
76
- }
77
- function _getCoordinate() {
78
- if (!props.coordinate) {
79
- return undefined;
80
- }
81
- return toJSONString(point(props.coordinate));
82
- }
83
- const _setNativeRef = nativeRef => {
84
- _nativeRef.current = nativeRef;
85
- _runPendingNativeCommands(nativeRef);
86
- };
87
- const nativeProps = {
88
- ...props,
89
- anchor,
90
- draggable,
91
- ref: nativeRef => _setNativeRef(nativeRef),
92
- id: props.id,
93
- title: props.title,
94
- snippet: props.snippet,
95
- selected: props.selected,
96
- style: [props.style, styles.container],
97
- onMapboxPointAnnotationSelected: _onSelected,
98
- onMapboxPointAnnotationDeselected: _onDeselected,
99
- onMapboxPointAnnotationDragStart: _onDragStart,
100
- onMapboxPointAnnotationDrag: _onDrag,
101
- onMapboxPointAnnotationDragEnd: _onDragEnd,
102
- coordinate: _getCoordinate()
103
- };
104
- return /*#__PURE__*/_jsx(MLRNPointAnnotation, {
105
- ...nativeProps,
106
- children: props.children
107
- });
108
- });
109
- const MLRNPointAnnotation = requireNativeComponent(NATIVE_MODULE_NAME);
110
- //# sourceMappingURL=PointAnnotation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["point","forwardRef","useImperativeHandle","useRef","Platform","StyleSheet","requireNativeComponent","useNativeBridge","isFunction","toJSONString","jsx","_jsx","NATIVE_MODULE_NAME","styles","create","container","alignItems","justifyContent","position","PointAnnotation","anchor","x","y","draggable","props","ref","refresh","_runNativeCommand","_runPendingNativeCommands","_nativeRef","OS","current","_onSelected","e","onSelected","nativeEvent","payload","_onDeselected","onDeselected","_onDragStart","onDragStart","_onDrag","onDrag","_onDragEnd","onDragEnd","_getCoordinate","coordinate","undefined","_setNativeRef","nativeRef","nativeProps","id","title","snippet","selected","style","onMapboxPointAnnotationSelected","onMapboxPointAnnotationDeselected","onMapboxPointAnnotationDragStart","onMapboxPointAnnotationDrag","onMapboxPointAnnotationDragEnd","MLRNPointAnnotation","children"],"sourceRoot":"../../../../src","sources":["components/annotations/PointAnnotation.tsx"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,eAAe;AACrC,SAGEC,UAAU,EACVC,mBAAmB,EACnBC,MAAM,QAED,OAAO;AACd,SACEC,QAAQ,EACRC,UAAU,EAEVC,sBAAsB,QACjB,cAAc;AAErB,SAASC,eAAe,QAAwB,gCAA6B;AAC7E,SAASC,UAAU,EAAEC,YAAY,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEvD,OAAO,MAAMC,kBAAkB,GAAG,qBAAqB;AAEvD,MAAMC,MAAM,GAAGR,UAAU,CAACS,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAyFF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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K,CAACsC;EAAQ,CACI,CAAC;AAE1B,CACF,CAAC;AAED,MAAMD,mBAAmB,GACvBvD,sBAAsB,CAAcM,kBAAkB,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../../../../../src/components/annotations/Callout.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAsChD,UAAU,YAAa,SAAQ,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC;IACrD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAMD;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,4CAoD1C,CAAC"}
@@ -1,44 +0,0 @@
1
- import { type ReactElement } from "react";
2
- import { type ViewProps } from "react-native";
3
- export declare const NATIVE_MODULE_NAME = "MLRNMarkerView";
4
- interface MarkerViewProps extends ViewProps {
5
- /**
6
- * The center point (specified as a map coordinate) of the marker.
7
- * See also #anchor.
8
- */
9
- coordinate: number[];
10
- /**
11
- * Specifies the anchor being set on a particular point of the annotation.
12
- * The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
13
- * where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
14
- * Note this is only for custom annotations not the default pin view.
15
- * Defaults to the center of the view.
16
- */
17
- anchor?: {
18
- /**
19
- * `x` of anchor
20
- */
21
- x: number;
22
- /**
23
- * `y` of anchor
24
- */
25
- y: number;
26
- };
27
- allowOverlap?: boolean;
28
- isSelected?: boolean;
29
- /**
30
- * Expects one child - can be container with multiple elements
31
- */
32
- children: ReactElement;
33
- }
34
- /**
35
- * MarkerView allows you to place a interactive react native marker to the map.
36
- *
37
- * If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance
38
- * .
39
- * This is based on [MakerView plugin](https://github.com/maplibre/maplibre-plugins-android/tree/main/plugin-markerview) on Android
40
- * and PointAnnotation on iOS.
41
- */
42
- export declare const MarkerView: ({ anchor, allowOverlap, isSelected, ...rest }: MarkerViewProps) => import("react/jsx-runtime").JSX.Element;
43
- export {};
44
- //# sourceMappingURL=MarkerView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkerView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/annotations/MarkerView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,OAAO,CAAC;AACnD,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKhF,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAEnD,UAAU,eAAgB,SAAQ,SAAS;IACzC;;;OAGG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,CAAC,EAAE,MAAM,CAAC;QACV;;WAEG;QACH,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;CACxB;AASD;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,+CAKxB,eAAe,4CAqBjB,CAAC"}