react-native-maplibre-lite 0.1.1

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 (99) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +203 -0
  3. package/lib/module/assets/MAP_ASSETS.js +7 -0
  4. package/lib/module/assets/MAP_ASSETS.js.map +1 -0
  5. package/lib/module/assets/dark_placeholder.jpg +0 -0
  6. package/lib/module/assets/light_placeholder.jpg +0 -0
  7. package/lib/module/components/MapPlaceholder.js +37 -0
  8. package/lib/module/components/MapPlaceholder.js.map +1 -0
  9. package/lib/module/components/MapSelectPoint.js +88 -0
  10. package/lib/module/components/MapSelectPoint.js.map +1 -0
  11. package/lib/module/components/MapView.js +244 -0
  12. package/lib/module/components/MapView.js.map +1 -0
  13. package/lib/module/components/Marker.js +27 -0
  14. package/lib/module/components/Marker.js.map +1 -0
  15. package/lib/module/components/Polygon.js +27 -0
  16. package/lib/module/components/Polygon.js.map +1 -0
  17. package/lib/module/components/Polyline.js +27 -0
  18. package/lib/module/components/Polyline.js.map +1 -0
  19. package/lib/module/components/types.js +2 -0
  20. package/lib/module/components/types.js.map +1 -0
  21. package/lib/module/components/webFunctions/addMarkerWeb.js +57 -0
  22. package/lib/module/components/webFunctions/addMarkerWeb.js.map +1 -0
  23. package/lib/module/components/webFunctions/addPolygonWeb.js +62 -0
  24. package/lib/module/components/webFunctions/addPolygonWeb.js.map +1 -0
  25. package/lib/module/components/webFunctions/addPolylineWeb.js +48 -0
  26. package/lib/module/components/webFunctions/addPolylineWeb.js.map +1 -0
  27. package/lib/module/components/webFunctions/fitBoundsWeb.js +11 -0
  28. package/lib/module/components/webFunctions/fitBoundsWeb.js.map +1 -0
  29. package/lib/module/components/webFunctions/initWeb.js +156 -0
  30. package/lib/module/components/webFunctions/initWeb.js.map +1 -0
  31. package/lib/module/components/webFunctions/removeMarkerWeb.js +12 -0
  32. package/lib/module/components/webFunctions/removeMarkerWeb.js.map +1 -0
  33. package/lib/module/components/webFunctions/removePolygonWeb.js +22 -0
  34. package/lib/module/components/webFunctions/removePolygonWeb.js.map +1 -0
  35. package/lib/module/components/webFunctions/removePolylineWeb.js +17 -0
  36. package/lib/module/components/webFunctions/removePolylineWeb.js.map +1 -0
  37. package/lib/module/index.js +9 -0
  38. package/lib/module/index.js.map +1 -0
  39. package/lib/module/package.json +1 -0
  40. package/lib/module/webContent.js +173 -0
  41. package/lib/module/webContent.js.map +1 -0
  42. package/lib/typescript/package.json +1 -0
  43. package/lib/typescript/src/assets/MAP_ASSETS.d.ts +5 -0
  44. package/lib/typescript/src/assets/MAP_ASSETS.d.ts.map +1 -0
  45. package/lib/typescript/src/components/MapPlaceholder.d.ts +5 -0
  46. package/lib/typescript/src/components/MapPlaceholder.d.ts.map +1 -0
  47. package/lib/typescript/src/components/MapSelectPoint.d.ts +12 -0
  48. package/lib/typescript/src/components/MapSelectPoint.d.ts.map +1 -0
  49. package/lib/typescript/src/components/MapView.d.ts +41 -0
  50. package/lib/typescript/src/components/MapView.d.ts.map +1 -0
  51. package/lib/typescript/src/components/Marker.d.ts +3 -0
  52. package/lib/typescript/src/components/Marker.d.ts.map +1 -0
  53. package/lib/typescript/src/components/Polygon.d.ts +3 -0
  54. package/lib/typescript/src/components/Polygon.d.ts.map +1 -0
  55. package/lib/typescript/src/components/Polyline.d.ts +3 -0
  56. package/lib/typescript/src/components/Polyline.d.ts.map +1 -0
  57. package/lib/typescript/src/components/types.d.ts +38 -0
  58. package/lib/typescript/src/components/types.d.ts.map +1 -0
  59. package/lib/typescript/src/components/webFunctions/addMarkerWeb.d.ts +3 -0
  60. package/lib/typescript/src/components/webFunctions/addMarkerWeb.d.ts.map +1 -0
  61. package/lib/typescript/src/components/webFunctions/addPolygonWeb.d.ts +3 -0
  62. package/lib/typescript/src/components/webFunctions/addPolygonWeb.d.ts.map +1 -0
  63. package/lib/typescript/src/components/webFunctions/addPolylineWeb.d.ts +3 -0
  64. package/lib/typescript/src/components/webFunctions/addPolylineWeb.d.ts.map +1 -0
  65. package/lib/typescript/src/components/webFunctions/fitBoundsWeb.d.ts +3 -0
  66. package/lib/typescript/src/components/webFunctions/fitBoundsWeb.d.ts.map +1 -0
  67. package/lib/typescript/src/components/webFunctions/initWeb.d.ts +3 -0
  68. package/lib/typescript/src/components/webFunctions/initWeb.d.ts.map +1 -0
  69. package/lib/typescript/src/components/webFunctions/removeMarkerWeb.d.ts +3 -0
  70. package/lib/typescript/src/components/webFunctions/removeMarkerWeb.d.ts.map +1 -0
  71. package/lib/typescript/src/components/webFunctions/removePolygonWeb.d.ts +3 -0
  72. package/lib/typescript/src/components/webFunctions/removePolygonWeb.d.ts.map +1 -0
  73. package/lib/typescript/src/components/webFunctions/removePolylineWeb.d.ts +3 -0
  74. package/lib/typescript/src/components/webFunctions/removePolylineWeb.d.ts.map +1 -0
  75. package/lib/typescript/src/index.d.ts +9 -0
  76. package/lib/typescript/src/index.d.ts.map +1 -0
  77. package/lib/typescript/src/webContent.d.ts +3 -0
  78. package/lib/typescript/src/webContent.d.ts.map +1 -0
  79. package/package.json +158 -0
  80. package/src/assets/MAP_ASSETS.ts +4 -0
  81. package/src/assets/dark_placeholder.jpg +0 -0
  82. package/src/assets/light_placeholder.jpg +0 -0
  83. package/src/components/MapPlaceholder.tsx +44 -0
  84. package/src/components/MapSelectPoint.tsx +131 -0
  85. package/src/components/MapView.tsx +333 -0
  86. package/src/components/Marker.tsx +31 -0
  87. package/src/components/Polygon.tsx +31 -0
  88. package/src/components/Polyline.tsx +31 -0
  89. package/src/components/types.ts +46 -0
  90. package/src/components/webFunctions/addMarkerWeb.ts +54 -0
  91. package/src/components/webFunctions/addPolygonWeb.ts +59 -0
  92. package/src/components/webFunctions/addPolylineWeb.ts +45 -0
  93. package/src/components/webFunctions/fitBoundsWeb.ts +8 -0
  94. package/src/components/webFunctions/initWeb.ts +153 -0
  95. package/src/components/webFunctions/removeMarkerWeb.ts +9 -0
  96. package/src/components/webFunctions/removePolygonWeb.ts +19 -0
  97. package/src/components/webFunctions/removePolylineWeb.ts +14 -0
  98. package/src/index.tsx +10 -0
  99. package/src/webContent.ts +182 -0
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+
3
+ import AsyncStorage from '@react-native-async-storage/async-storage';
4
+ const CACHE_VERSION = 'v1';
5
+ const loadResources = async url => {
6
+ const cacheKey = `${url}@${CACHE_VERSION}`;
7
+ try {
8
+ const stored = await AsyncStorage.getItem(cacheKey);
9
+ if (stored) {
10
+ return stored;
11
+ }
12
+ } catch (_) {
13
+ // cache miss — proceed to fetch
14
+ }
15
+ const response = await fetch(url);
16
+ if (!response.ok) {
17
+ throw new Error(`Failed to load resource: ${url} (${response.status})`);
18
+ }
19
+ const text = await response.text();
20
+ if (text) {
21
+ try {
22
+ await AsyncStorage.setItem(cacheKey, text);
23
+ } catch (_) {
24
+ // storage full or unavailable — non-fatal
25
+ }
26
+ }
27
+ return text;
28
+ };
29
+ export const maplibreHtmlMap = async (webFunctions, sources) => {
30
+ //Загружаем скрипты как текст
31
+
32
+ let maplibreJS = await loadResources(sources.maplibreJS);
33
+ let maplibreCSS = await loadResources(sources.maplibreCSS);
34
+ let pmtiles = await loadResources(sources.pmtilesJS);
35
+ return `<!DOCTYPE html>
36
+ <html lang="">
37
+
38
+ <head>
39
+ <meta charset="utf-8" />
40
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
41
+ <title></title>
42
+
43
+
44
+ <script>${maplibreJS}</script>
45
+
46
+ <style>${maplibreCSS}</style>
47
+
48
+
49
+ <script>${pmtiles}</script>
50
+
51
+ <style>
52
+
53
+
54
+ html,
55
+ body {
56
+
57
+ overflow: hidden;
58
+ height: 100vh;
59
+ width: 100vw;
60
+ margin: 0;
61
+ padding: 0;
62
+
63
+ }
64
+
65
+
66
+
67
+ * {
68
+ -webkit-user-select: none;
69
+ -khtml-user-select: none;
70
+ -moz-user-select: none;
71
+ -ms-user-select: none;
72
+ user-select: none;
73
+ }
74
+
75
+
76
+ * {
77
+ -webkit-touch-callout: none;
78
+ -moz-touch-callout: none;
79
+ -ms-touch-callout: none;
80
+ touch-callout: none;
81
+ }
82
+
83
+ * {
84
+ -webkit-user-drag: none;
85
+ -moz-user-drag: none;
86
+ -ms-user-drag: none;
87
+ user-drag: none;
88
+ }
89
+
90
+ .maplibregl-ctrl-bottom-right {
91
+ display: none;
92
+ }
93
+
94
+
95
+ #map {
96
+
97
+
98
+ height: 100vh;
99
+ width: 100vw;
100
+ }
101
+ </style>
102
+
103
+ </head>
104
+
105
+ <body>
106
+ <div id="map"></div>
107
+ </body>
108
+
109
+ <script>
110
+
111
+ var markers = {};
112
+ var polylines = {};
113
+ var polygons = {};
114
+ var rectangles = {};
115
+ var layouts = {};
116
+
117
+ var map = null;
118
+
119
+ try {
120
+ let protocol = new pmtiles.Protocol();
121
+ maplibregl.addProtocol("pmtiles", protocol.tile);
122
+ } catch (e) {
123
+ console.error('pmtiles init error:', e.message);
124
+ }
125
+ window.onload = function () {
126
+ document.addEventListener("message", function (event) {
127
+ receiveMessage(event.data);
128
+ });
129
+ window.addEventListener("message", function (event) {
130
+ receiveMessage(event.data);
131
+ });
132
+ if (window.ReactNativeWebView) {
133
+ window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'scriptReady' }));
134
+ }
135
+ }
136
+
137
+
138
+ const receiveMessage = (message) => {
139
+
140
+ var data = JSON.parse(message);
141
+
142
+ var functionName = data.function;
143
+ var params = data.params;
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+ try{
152
+
153
+ ${webFunctions}
154
+
155
+ } catch (e) {
156
+ console.error('WebView function error:', functionName, e.message);
157
+ window.ReactNativeWebView.postMessage(JSON.stringify({
158
+ type: 'error',
159
+ data: {
160
+ target: functionName,
161
+ message: String(e.message),
162
+ }
163
+ }));
164
+ }
165
+ };
166
+
167
+
168
+ </script>
169
+
170
+
171
+ </html>`;
172
+ };
173
+ //# sourceMappingURL=webContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AsyncStorage","CACHE_VERSION","loadResources","url","cacheKey","stored","getItem","_","response","fetch","ok","Error","status","text","setItem","maplibreHtmlMap","webFunctions","sources","maplibreJS","maplibreCSS","pmtiles","pmtilesJS"],"sourceRoot":"../../src","sources":["webContent.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,2CAA2C;AAIpE,MAAMC,aAAa,GAAG,IAAI;AAE1B,MAAMC,aAAa,GAAG,MAAOC,GAAW,IAAK;EACzC,MAAMC,QAAQ,GAAG,GAAGD,GAAG,IAAIF,aAAa,EAAE;EAE1C,IAAI;IACA,MAAMI,MAAM,GAAG,MAAML,YAAY,CAACM,OAAO,CAACF,QAAQ,CAAC;IACnD,IAAIC,MAAM,EAAE;MACR,OAAOA,MAAM;IACjB;EACJ,CAAC,CAAC,OAAOE,CAAC,EAAE;IACR;EAAA;EAGJ,MAAMC,QAAQ,GAAG,MAAMC,KAAK,CAACN,GAAG,CAAC;EACjC,IAAI,CAACK,QAAQ,CAACE,EAAE,EAAE;IACd,MAAM,IAAIC,KAAK,CAAC,4BAA4BR,GAAG,KAAKK,QAAQ,CAACI,MAAM,GAAG,CAAC;EAC3E;EACA,MAAMC,IAAI,GAAG,MAAML,QAAQ,CAACK,IAAI,CAAC,CAAC;EAElC,IAAIA,IAAI,EAAE;IACN,IAAI;MACA,MAAMb,YAAY,CAACc,OAAO,CAACV,QAAQ,EAAES,IAAI,CAAC;IAC9C,CAAC,CAAC,OAAON,CAAC,EAAE;MACR;IAAA;EAER;EACA,OAAOM,IAAI;AACf,CAAC;AAED,OAAO,MAAME,eAAe,GAAG,MAAAA,CAAOC,YAAoB,EAAEC,OAAqB,KAAK;EAClF;;EAGA,IAAIC,UAAU,GAAG,MAAMhB,aAAa,CAACe,OAAO,CAACC,UAAU,CAAC;EACxD,IAAIC,WAAW,GAAG,MAAMjB,aAAa,CAACe,OAAO,CAACE,WAAW,CAAC;EAC1D,IAAIC,OAAO,GAAG,MAAMlB,aAAa,CAACe,OAAO,CAACI,SAAS,CAAC;EAIpD,OAAO;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcH,UAAU;AACxB;AACA,aAAaC,WAAW;AACxB;AACA;AACA,cAAcC,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAEJ,YAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,5 @@
1
+ export declare const MAP_ASSETS: {
2
+ DARK_MAP_PLACEHOLDER: any;
3
+ LIGHT_MAP_PLACEHOLDER: any;
4
+ };
5
+ //# sourceMappingURL=MAP_ASSETS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MAP_ASSETS.d.ts","sourceRoot":"","sources":["../../../../src/assets/MAP_ASSETS.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;CAGtB,CAAA"}
@@ -0,0 +1,5 @@
1
+ declare const MapPlaceholder: (props: {
2
+ theme: "dark" | "light";
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default MapPlaceholder;
5
+ //# sourceMappingURL=MapPlaceholder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapPlaceholder.d.ts","sourceRoot":"","sources":["../../../../src/components/MapPlaceholder.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,cAAc,GAAI,OAAO;IAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,4CAoCzD,CAAA;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export type MapSelectPointType = {
3
+ up: () => void;
4
+ down: () => void;
5
+ };
6
+ type MapSelectPointProps = {
7
+ color?: string;
8
+ backgroundColor?: string;
9
+ };
10
+ export declare const MapSelectPoint: React.ForwardRefExoticComponent<MapSelectPointProps & React.RefAttributes<MapSelectPointType>>;
11
+ export default MapSelectPoint;
12
+ //# sourceMappingURL=MapSelectPoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapSelectPoint.d.ts","sourceRoot":"","sources":["../../../../src/components/MapSelectPoint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAIN,MAAM,OAAO,CAAC;AAQf,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,IAAI,CAAC;IACf,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAOF,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;CAE1B,CAAA;AAED,eAAO,MAAM,cAAc,gGA4E1B,CAAC;AA0BF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { type StyleProp, type ViewStyle } from 'react-native';
2
+ import { type EventParams, type MarkerProps, type PolygonProps, type PolylineProps, type SourcesProps } from './types';
3
+ interface MapViewProps {
4
+ children?: React.ReactNode;
5
+ theme: 'light' | 'dark';
6
+ center: [number, number];
7
+ zoom: number;
8
+ mapStyle: string;
9
+ style: StyleProp<ViewStyle>;
10
+ minZoom?: number;
11
+ maxZoom?: number;
12
+ zoomEnabled?: boolean;
13
+ scrollEnabled?: boolean;
14
+ onMoveStart?: (eventParams: EventParams) => void;
15
+ onMoveEnd?: (eventParams: EventParams) => void;
16
+ onZoomStart?: (eventParams: EventParams) => void;
17
+ onZoomEnd?: (eventParams: EventParams) => void;
18
+ onIdle?: (eventParams: EventParams) => void;
19
+ showSelectPoint?: boolean;
20
+ selectPointColor?: string;
21
+ selectPointBackgroundColor?: string;
22
+ performanceMode?: 'quality' | 'balanced' | 'performance';
23
+ pixelRatio?: number;
24
+ turboWhileMoving?: boolean;
25
+ sources: SourcesProps;
26
+ }
27
+ export type MapViewRef = {
28
+ fitBounds: () => void;
29
+ };
30
+ type MapViewRegistry = {
31
+ addMarker: (propsMarker: MarkerProps) => void;
32
+ removeMarker: (propsMarker: MarkerProps) => void;
33
+ addPolyline: (propsPolyline: PolylineProps) => void;
34
+ removePolyline: (propsPolyline: PolylineProps) => void;
35
+ addPolygon: (propsPolygon: PolygonProps) => void;
36
+ removePolygon: (propsPolygon: PolygonProps) => void;
37
+ };
38
+ export declare const useMapViewContext: () => MapViewRegistry;
39
+ export declare const MapView: import("react").ForwardRefExoticComponent<MapViewProps & import("react").RefAttributes<MapViewRef>>;
40
+ export {};
41
+ //# sourceMappingURL=MapView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/components/MapView.tsx"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAUjB,UAAU,YAAY;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,eAAe,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,OAAO,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,MAAM,UAAU,GAAG;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,KAAK,eAAe,GAAG;IACnB,SAAS,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,YAAY,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,WAAW,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,cAAc,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;IACvD,UAAU,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IACjD,aAAa,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;CACvD,CAAC;AAIF,eAAO,MAAM,iBAAiB,uBAI7B,CAAC;AAsCF,eAAO,MAAM,OAAO,qGAiNlB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type MarkerProps } from './types';
2
+ export declare const Marker: (props: MarkerProps) => null;
3
+ //# sourceMappingURL=Marker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,SAsBxC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type PolygonProps } from './types';
2
+ export declare const Polygon: (props: PolygonProps) => null;
3
+ //# sourceMappingURL=Polygon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Polygon.d.ts","sourceRoot":"","sources":["../../../../src/components/Polygon.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,SAsB1C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { PolylineProps } from './types';
2
+ export declare const Polyline: (props: PolylineProps) => null;
3
+ //# sourceMappingURL=Polyline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Polyline.d.ts","sourceRoot":"","sources":["../../../../src/components/Polyline.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,SAsB5C,CAAC"}
@@ -0,0 +1,38 @@
1
+ export type MarkerProps = {
2
+ uniqueId: string;
3
+ onPress?: () => void;
4
+ latitude: number;
5
+ longitude: number;
6
+ color?: string;
7
+ iconUrl?: string;
8
+ iconWidth?: number;
9
+ iconHeight?: number;
10
+ };
11
+ export type SourcesProps = {
12
+ maplibreJS: string;
13
+ maplibreCSS: string;
14
+ pmtilesJS: string;
15
+ };
16
+ export type PolygonProps = {
17
+ uniqueId: string;
18
+ coordinates: [number, number][];
19
+ fillColor?: string;
20
+ fillOpacity?: number;
21
+ strokeColor?: string;
22
+ strokeOpacity?: number;
23
+ strokeWidth?: number;
24
+ };
25
+ export type PolylineProps = {
26
+ uniqueId: string;
27
+ color?: string;
28
+ width?: number;
29
+ coordinates: [number, number][];
30
+ };
31
+ export type EventParams = {
32
+ center?: {
33
+ lng: number;
34
+ lat: number;
35
+ };
36
+ zoom?: number;
37
+ };
38
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,WAAW,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CAEvB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CAExB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAEnC,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACtB,MAAM,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAA;KACd,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const _default: "\n\n if(functionName === 'addMarker') {\n\n \n if(markers[params.uniqueId]){\n markers[params.uniqueId].remove();\n delete markers[params.uniqueId];\n }\n\n\n if(!params?.iconUrl){\n\n\n markers[params.uniqueId] = new maplibregl.Marker({\n color: params.color ?? undefined,\n }).setLngLat([params.longitude, params.latitude])\n .addTo(map);\n markers[params.uniqueId].getElement().addEventListener('click', function() {\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'markerClick',\n uniqueId: params.uniqueId\n }));\n });\n\n return;\n\n }else{\n\n\n const el = document.createElement('div');\n el.className = 'marker';\n el.style.backgroundImage = 'url(' + params.iconUrl + ')';\n el.style.width = params.iconWidth + 'px';\n el.style.height = params.iconHeight + 'px';\n\n el.addEventListener('click', () => {\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'markerClick',\n uniqueId: params.uniqueId\n }));\n });\n\n \n markers[params.uniqueId] = new maplibregl.Marker({element: el})\n .setLngLat([params.longitude, params.latitude])\n .addTo(map);\n\n return;\n\n }\n }\n\n ";
2
+ export default _default;
3
+ //# sourceMappingURL=addMarkerWeb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addMarkerWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/addMarkerWeb.ts"],"names":[],"mappings":";AAAA,wBAqDc"}
@@ -0,0 +1,3 @@
1
+ declare const _default: "\n\nif(functionName === 'addPolygon') {\n\n var sourceId = params.uniqueId + '-polygons-source';\n var fillLayerId = params.uniqueId + '-polygons-fill';\n var strokeLayerId = params.uniqueId + '-polygons-stroke';\n\n if(map.getLayer(strokeLayerId)) {\n map.removeLayer(strokeLayerId);\n }\n if(map.getLayer(fillLayerId)) {\n map.removeLayer(fillLayerId);\n }\n if(map.getSource(sourceId)) {\n map.removeSource(sourceId);\n }\n\n map.addSource(sourceId, {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Polygon',\n 'coordinates': [params.coordinates]\n }\n }\n });\n\n var fillPaint = {};\n fillPaint['fill-color'] = params.fillColor || 'rgba(0,0,0,0)';\n if(params.fillOpacity != null) fillPaint['fill-opacity'] = params.fillOpacity;\n if(params.strokeColor) fillPaint['fill-outline-color'] = params.strokeColor;\n\n map.addLayer({\n 'id': fillLayerId,\n 'type': 'fill',\n 'source': sourceId,\n 'layout': {},\n 'paint': fillPaint\n });\n\n if(params.strokeColor || params.strokeWidth) {\n var linePaint = {};\n if(params.strokeColor) linePaint['line-color'] = params.strokeColor;\n if(params.strokeOpacity != null) linePaint['line-opacity'] = params.strokeOpacity;\n if(params.strokeWidth != null) linePaint['line-width'] = params.strokeWidth;\n\n map.addLayer({\n 'id': strokeLayerId,\n 'type': 'line',\n 'source': sourceId,\n 'layout': {},\n 'paint': linePaint\n });\n }\n\n}\n";
2
+ export default _default;
3
+ //# sourceMappingURL=addPolygonWeb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addPolygonWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/addPolygonWeb.ts"],"names":[],"mappings":";AAAA,wBA0DC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: "\n\nif(functionName === 'addPolyline') {\n\n \n\n var sourceId = params.uniqueId + '-polylines-source';\n var layerId = params.uniqueId + '-polylines-layout';\n\n if(map.getLayer(layerId)) {\n map.removeLayer(layerId);\n }\n\n if(map.getSource(sourceId)) {\n map.removeSource(sourceId);\n }\n\n map.addSource(sourceId, {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': params.coordinates\n }\n }\n });\n\n map.addLayer({\n 'id': layerId,\n 'type': 'line',\n 'source': sourceId,\n 'layout': {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n 'paint': {\n 'line-color': params.color ?? '#000000',\n 'line-width': params.width ?? 4\n }\n });\n\n}\n";
2
+ export default _default;
3
+ //# sourceMappingURL=addPolylineWeb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addPolylineWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/addPolylineWeb.ts"],"names":[],"mappings":";AAAA,wBA4CC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: "\n if(functionName === 'fitBounds') {\n map.fitBounds(params.bounds, {\n padding: 40,\n duration: 1000\n });\n }\n";
2
+ export default _default;
3
+ //# sourceMappingURL=fitBoundsWeb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitBoundsWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/fitBoundsWeb.ts"],"names":[],"mappings":";AAAA,wBAOE"}
@@ -0,0 +1,3 @@
1
+ declare const _default: "\n\n if(functionName === 'init') {\n\n function simplifyStyle(mapInstance, aggressive){\n if(!mapInstance) return;\n var style = mapInstance.getStyle();\n var layers = style && style.layers ? style.layers : [];\n for(var i = 0; i < layers.length; i++){\n var layer = layers[i];\n var layerId = layer.id;\n var layerType = layer.type;\n var shouldHide = false;\n\n if(layerType === 'symbol' || layerType === 'fill-extrusion' || layerType === 'hillshade'){\n shouldHide = true;\n }\n\n if(aggressive && (layerType === 'line' || layerType === 'circle')){\n var layerIdLower = String(layerId || '').toLowerCase();\n if(\n layerIdLower.indexOf('road-label') !== -1 ||\n layerIdLower.indexOf('poi') !== -1 ||\n layerIdLower.indexOf('label') !== -1 ||\n layerIdLower.indexOf('boundary') !== -1 ||\n layerIdLower.indexOf('admin') !== -1\n ){\n shouldHide = true;\n }\n }\n\n if(shouldHide){\n try{\n mapInstance.setLayoutProperty(layerId, 'visibility', 'none');\n } catch (_) {}\n }\n }\n }\n\n function setOverlayLayersVisibility(mapInstance, visibility){\n if(!mapInstance) return;\n var style = mapInstance.getStyle();\n var layers = style && style.layers ? style.layers : [];\n for(var i = 0; i < layers.length; i++){\n var layer = layers[i];\n var layerId = String(layer.id || '');\n var isCustomOverlay =\n layerId.indexOf('-polylines-layout') !== -1 ||\n layerId.indexOf('-polygons-fill') !== -1 ||\n layerId.indexOf('-polygons-stroke') !== -1;\n\n if(isCustomOverlay){\n try{\n mapInstance.setLayoutProperty(layerId, 'visibility', visibility);\n } catch (_) {}\n }\n }\n }\n\n\n map = new maplibregl.Map({\n container: 'map',\n style: params.style,\n //Moscow coordinates\n center: params.center, // starting position [lng, lat]\n zoom: params.zoom, // starting zoom\n\n\n // \u043E\u0431\u0449\u0438\u0439 \u0432\u044B\u043A\u043B\u044E\u0447\u0430\u0442\u0435\u043B\u044C\n zoomControl: params.zoomEnabled,\n // \u0442\u043E\u0447\u043D\u0435\u0435\n scrollZoom: params.scrollEnabled, // \u043A\u043E\u043B\u0435\u0441\u043E \u043C\u044B\u0448\u0438 / \u0442\u0440\u0435\u043A\u043F\u0430\u0434\n doubleClickZoom: params.zoomEnabled,\n touchZoomRotate: params.zoomEnabled,\n minZoom: params.minZoom,\n maxZoom: params.maxZoom,\n dragPan: params.scrollEnabled, // \u0437\u0430\u043F\u0440\u0435\u0442 \u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u043D\u0438\u044F\n dragRotate: params.zoomEnabled,\n antialias: params.antialias ?? false,\n crossSourceCollisions: params.crossSourceCollisions ?? true,\n fadeDuration: params.fadeDuration ?? 120,\n pixelRatio: params.pixelRatio,\n renderWorldCopies: params.renderWorldCopies ?? true\n });\n\n if (typeof params.maxPitch === 'number') {\n map.setMaxPitch(params.maxPitch);\n }\n\n if (params.maxPitch === 0) {\n map.dragRotate.disable();\n map.touchZoomRotate.disableRotation();\n }\n\n\n\n function getEventParams(){\n if(!map) return {\n center: null,\n zoom: null\n }\n var center = map.getCenter(); \n var zoom = map.getZoom();\n\n\n return {\n center,\n zoom\n }\n }\n \n //movestart moveend\n map.on(\"movestart\",(event)=>{\n if(params.turboWhileMoving){\n setOverlayLayersVisibility(map, 'none');\n }\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'movestart', params: getEventParams() }));\n })\n map.on(\"moveend\",(event)=>{\n if(params.turboWhileMoving){\n setOverlayLayersVisibility(map, 'visible');\n }\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'moveend', params: getEventParams() }));\n })\n /*zoomstart zoomend*/\n map.on(\"zoomstart\",(event)=>{\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'zoomstart', params: getEventParams() }));\n })\n map.on(\"zoomend\",(event)=>{\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'zoomend', params: getEventParams() }));\n })\n \n\n map.on(\"idle\",(event)=>{\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'idle', params: getEventParams() }));\n })\n \n \n \n\n\n map.on('load', function () {\n if(params.simplifyStyle){\n simplifyStyle(map, Boolean(params.aggressiveSimplifyStyle));\n }\n \n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'inited' }));\n });\n\n\n \n}\n";
2
+ export default _default;
3
+ //# sourceMappingURL=initWeb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/initWeb.ts"],"names":[],"mappings":";AAAA,wBAwJC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: "\n\n if(functionName === 'removeMarker') {\n if(markers[params.uniqueId]){\n markers[params.uniqueId].remove();\n delete markers[params.uniqueId];\n }\n }\n ";
2
+ export default _default;
3
+ //# sourceMappingURL=removeMarkerWeb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeMarkerWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/removeMarkerWeb.ts"],"names":[],"mappings":";AAAA,wBAQa"}
@@ -0,0 +1,3 @@
1
+ declare const _default: "\n\nif(functionName === 'removePolygon') {\n var sourceId = params.uniqueId + '-polygons-source';\n var fillLayerId = params.uniqueId + '-polygons-fill';\n var strokeLayerId = params.uniqueId + '-polygons-stroke';\n\n if(map.getLayer(strokeLayerId)) {\n map.removeLayer(strokeLayerId);\n }\n if(map.getLayer(fillLayerId)) {\n map.removeLayer(fillLayerId);\n }\n if(map.getSource(sourceId)) {\n map.removeSource(sourceId);\n }\n\n}\n";
2
+ export default _default;
3
+ //# sourceMappingURL=removePolygonWeb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removePolygonWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/removePolygonWeb.ts"],"names":[],"mappings":";AAAA,wBAkBC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: "\n\n if(functionName === 'removePolyline') {\n var sourceId = params.uniqueId + '-polylines-source';\n var layerId = params.uniqueId + '-polylines-layout';\n\n if(map.getLayer(layerId)) {\n map.removeLayer(layerId);\n }\n if(map.getSource(sourceId)) {\n map.removeSource(sourceId);\n }\n }\n ";
2
+ export default _default;
3
+ //# sourceMappingURL=removePolylineWeb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removePolylineWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/removePolylineWeb.ts"],"names":[],"mappings":";AAAA,wBAac"}
@@ -0,0 +1,9 @@
1
+ import { MapView } from './components/MapView';
2
+ import { Marker } from './components/Marker';
3
+ import { Polygon } from './components/Polygon';
4
+ import { Polyline } from './components/Polyline';
5
+ export { MapView, Marker, Polygon, Polyline };
6
+ export default MapView;
7
+ export type { MapViewRef } from './components/MapView';
8
+ export type { MarkerProps, PolygonProps, PolylineProps, EventParams } from './components/types';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC9C,eAAe,OAAO,CAAC;AAEvB,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { SourcesProps } from './components/types';
2
+ export declare const maplibreHtmlMap: (webFunctions: string, sources: SourcesProps) => Promise<string>;
3
+ //# sourceMappingURL=webContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webContent.d.ts","sourceRoot":"","sources":["../../../src/webContent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAgCvD,eAAO,MAAM,eAAe,GAAU,cAAc,MAAM,EAAE,SAAS,YAAY,oBAmJhF,CAAC"}
package/package.json ADDED
@@ -0,0 +1,158 @@
1
+ {
2
+ "name": "react-native-maplibre-lite",
3
+ "version": "0.1.1",
4
+ "description": "Lightweight MapLibre GL JS wrapper using WebView",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "android",
19
+ "ios",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
23
+ "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
29
+ "!**/__tests__",
30
+ "!**/__fixtures__",
31
+ "!**/__mocks__",
32
+ "!**/.*"
33
+ ],
34
+ "scripts": {
35
+ "example": "yarn workspace react-native-maplibre-lite-example",
36
+ "test": "jest",
37
+ "typecheck": "tsc",
38
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
39
+ "clean": "del-cli lib",
40
+ "prepare": "bob build",
41
+ "release": "release-it --only-version"
42
+ },
43
+ "keywords": [
44
+ "react-native",
45
+ "ios",
46
+ "android"
47
+ ],
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/AntonSeagull/react-native-maplibre-lite.git"
51
+ },
52
+ "author": "Anton Seagull <mrseagull@ya.ru> (https://github.com/AntonSeagull)",
53
+ "license": "MIT",
54
+ "bugs": {
55
+ "url": "https://github.com/AntonSeagull/react-native-maplibre-lite/issues"
56
+ },
57
+ "homepage": "https://github.com/AntonSeagull/react-native-maplibre-lite#readme",
58
+ "publishConfig": {
59
+ "registry": "https://registry.npmjs.org/"
60
+ },
61
+ "devDependencies": {
62
+ "@commitlint/config-conventional": "^19.6.0",
63
+ "@eslint/compat": "^1.2.7",
64
+ "@eslint/eslintrc": "^3.3.0",
65
+ "@eslint/js": "^9.22.0",
66
+ "@evilmartians/lefthook": "^1.5.0",
67
+ "@react-native/babel-preset": "0.78.2",
68
+ "@react-native/eslint-config": "^0.78.0",
69
+ "@release-it/conventional-changelog": "^9.0.2",
70
+ "@types/jest": "^29.5.5",
71
+ "@types/react": "^19.0.12",
72
+ "commitlint": "^19.6.1",
73
+ "del-cli": "^5.1.0",
74
+ "eslint": "^9.22.0",
75
+ "eslint-config-prettier": "^10.1.1",
76
+ "eslint-plugin-prettier": "^5.2.3",
77
+ "jest": "^29.7.0",
78
+ "prettier": "^3.0.3",
79
+ "react": "19.0.0",
80
+ "react-native": "0.79.3",
81
+ "react-native-builder-bob": "^0.40.8",
82
+ "release-it": "^17.10.0",
83
+ "typescript": "^5.8.3",
84
+ "@types/geojson": "*"
85
+ },
86
+ "peerDependencies": {
87
+ "react": "*",
88
+ "react-native": "*",
89
+ "react-native-webview": "*",
90
+ "@react-native-async-storage/async-storage": "*",
91
+ "@types/geojson": "*"
92
+ },
93
+ "workspaces": [
94
+ "example"
95
+ ],
96
+ "packageManager": "yarn@3.6.1",
97
+ "jest": {
98
+ "preset": "react-native",
99
+ "modulePathIgnorePatterns": [
100
+ "<rootDir>/example/node_modules",
101
+ "<rootDir>/lib/"
102
+ ]
103
+ },
104
+ "commitlint": {
105
+ "extends": [
106
+ "@commitlint/config-conventional"
107
+ ]
108
+ },
109
+ "release-it": {
110
+ "git": {
111
+ "commitMessage": "chore: release ${version}",
112
+ "tagName": "v${version}"
113
+ },
114
+ "npm": {
115
+ "publish": true
116
+ },
117
+ "github": {
118
+ "release": true
119
+ },
120
+ "plugins": {
121
+ "@release-it/conventional-changelog": {
122
+ "preset": {
123
+ "name": "angular"
124
+ }
125
+ }
126
+ }
127
+ },
128
+ "prettier": {
129
+ "quoteProps": "consistent",
130
+ "singleQuote": true,
131
+ "tabWidth": 2,
132
+ "trailingComma": "es5",
133
+ "useTabs": false
134
+ },
135
+ "react-native-builder-bob": {
136
+ "source": "src",
137
+ "output": "lib",
138
+ "targets": [
139
+ [
140
+ "module",
141
+ {
142
+ "esm": true
143
+ }
144
+ ],
145
+ [
146
+ "typescript",
147
+ {
148
+ "project": "tsconfig.build.json"
149
+ }
150
+ ]
151
+ ]
152
+ },
153
+ "create-react-native-library": {
154
+ "languages": "js",
155
+ "type": "library",
156
+ "version": "0.50.3"
157
+ }
158
+ }
@@ -0,0 +1,4 @@
1
+ export const MAP_ASSETS = {
2
+ DARK_MAP_PLACEHOLDER: require('./dark_placeholder.jpg'),
3
+ LIGHT_MAP_PLACEHOLDER: require('./light_placeholder.jpg'),
4
+ }
Binary file
Binary file