react-native-maplibre-gl-js 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -23
- package/lib/module/index.js +9 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/react-native/components/Map/Map.js +31 -2
- package/lib/module/react-native/components/Map/Map.js.map +1 -1
- package/lib/module/react-native/components/MapProvider/MapProvider.hooks.js +1 -1
- package/lib/module/react-native/components/MapProvider/MapProvider.hooks.js.map +1 -1
- package/lib/module/react-native/components/MapProvider/MapProvider.js +20 -8
- package/lib/module/react-native/components/MapProvider/MapProvider.js.map +1 -1
- package/lib/module/react-native/components/Marker/Marker.js +52 -2
- package/lib/module/react-native/components/Marker/Marker.js.map +1 -1
- package/lib/module/react-native/components/Popup/Popup.js +28 -3
- package/lib/module/react-native/components/Popup/Popup.js.map +1 -1
- package/lib/module/react-native/components-factory/createWebObjectAsComponent.js +2 -2
- package/lib/module/react-native/components-factory/createWebObjectAsComponent.js.map +1 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMethodsProxy.js +2 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMethodsProxy.js.map +1 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMountOnLaunch.js +2 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMountOnLaunch.js.map +1 -1
- package/lib/module/react-native/hooks/atoms/useMapAtoms.js +3 -2
- package/lib/module/react-native/hooks/atoms/useMapAtoms.js.map +1 -1
- package/lib/module/typedoc.js +0 -2
- package/lib/module/web/bridge/ReactNativeBridge.js +1 -2
- package/lib/module/web/bridge/ReactNativeBridge.js.map +1 -1
- package/lib/module/web/generated/index.js +2 -2
- package/lib/module/web/generated/index.js.map +1 -1
- package/lib/module/web/generated/webview_static_html.js +32 -32
- package/lib/module/web/logger/web-logger.js +1 -0
- package/lib/module/web/logger/web-logger.js.map +1 -1
- package/lib/module/web/maplibre-gl-js/MapController.js +3 -3
- package/lib/module/web/maplibre-gl-js/MapController.js.map +1 -1
- package/lib/typescript/src/communication/messages.types.d.ts +1 -1
- package/lib/typescript/src/communication/messages.types.d.ts.map +1 -1
- package/lib/typescript/src/communication/messages.utils.d.ts +1 -1
- package/lib/typescript/src/communication/messages.utils.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +10 -14
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Map/Map.d.ts +31 -2
- package/lib/typescript/src/react-native/components/Map/Map.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Map/Map.types.d.ts +71 -59
- package/lib/typescript/src/react-native/components/Map/Map.types.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.d.ts +13 -3
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.hooks.d.ts +1 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.types.d.ts +11 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.types.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Marker/Marker.d.ts +52 -2
- package/lib/typescript/src/react-native/components/Marker/Marker.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Marker/Marker.types.d.ts +27 -14
- package/lib/typescript/src/react-native/components/Marker/Marker.types.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Popup/Popup.d.ts +28 -2
- package/lib/typescript/src/react-native/components/Popup/Popup.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Popup/Popup.types.d.ts +25 -12
- package/lib/typescript/src/react-native/components/Popup/Popup.types.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.d.ts +2 -2
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.types.d.ts +18 -16
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.types.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMethodsProxy.d.ts +1 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMethodsProxy.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountOnLaunch.d.ts +2 -2
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountOnLaunch.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectOptionsUpdater.d.ts +2 -2
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectOptionsUpdater.d.ts.map +1 -1
- package/lib/typescript/src/react-native/hooks/atoms/useMapAtoms.d.ts +2 -2
- package/lib/typescript/src/react-native/hooks/atoms/useMapAtoms.d.ts.map +1 -1
- package/lib/typescript/src/typedoc.d.ts +5 -2
- package/lib/typescript/src/typedoc.d.ts.map +1 -1
- package/lib/typescript/src/web/bridge/ReactNativeBridge.d.ts +2 -2
- package/lib/typescript/src/web/bridge/ReactNativeBridge.d.ts.map +1 -1
- package/lib/typescript/src/web/generated/webview_static_html.d.ts +1 -1
- package/lib/typescript/src/web/maplibre-gl-js/MapController.d.ts +3 -3
- package/lib/typescript/src/web/maplibre-gl-js/MapController.d.ts.map +1 -1
- package/package.json +47 -89
package/README.md
CHANGED
|
@@ -39,32 +39,83 @@
|
|
|
39
39
|
> This project **is not** affiliated with, endorsed by, or sponsored by MapLibre.
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Table of contents
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
45
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
46
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
47
|
+
|
|
48
|
+
- [Supported platforms](#supported-platforms)
|
|
49
|
+
- [Installation](#installation)
|
|
50
|
+
- [📚 Documentation](#-documentation)
|
|
51
|
+
- [🧪 Examples](#-examples)
|
|
52
|
+
- [🏁 Getting started](#-getting-started)
|
|
53
|
+
- [📝 Design rationale](#-design-rationale)
|
|
54
|
+
- [Existing React Native map solutions](#existing-react-native-map-solutions)
|
|
55
|
+
- [Architectural approach](#architectural-approach)
|
|
56
|
+
- [Contributing](#contributing)
|
|
57
|
+
- [Credits](#credits)
|
|
58
|
+
- [License](#license)
|
|
49
59
|
|
|
50
|
-
|
|
60
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
51
61
|
|
|
52
|
-
📘 [**API Reference** – Complete TypeScript API documentation.](./docs/api/index.md)
|
|
53
62
|
|
|
54
|
-
|
|
63
|
+
## Supported platforms
|
|
55
64
|
|
|
56
|
-
|
|
65
|
+
| Platform | Status |
|
|
66
|
+
|----------|--------|
|
|
67
|
+
| iOS | ✅ |
|
|
68
|
+
| Android | ✅ |
|
|
69
|
+
| Web | ❌ |
|
|
57
70
|
|
|
58
71
|
|
|
59
72
|
## Installation
|
|
60
73
|
|
|
61
|
-
** TODO not available on npm yet **
|
|
62
|
-
|
|
63
74
|
```sh
|
|
64
75
|
npm install react-native-maplibre-gl-js
|
|
65
76
|
```
|
|
66
77
|
|
|
67
|
-
##
|
|
78
|
+
## 📚 Documentation
|
|
79
|
+
|
|
80
|
+
[**API Reference** – Complete TypeScript API documentation.](./docs/api/index.md)
|
|
81
|
+
|
|
82
|
+
[**For library developers** – Internal architecture, glossary and design decisions.](./docs/developer/index.md)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
## 🧪 Examples
|
|
86
|
+
|
|
87
|
+
Several real-world usage scenarios are available, you can explore them in two ways:
|
|
88
|
+
|
|
89
|
+
- [**Run the examples as an Expo app**](./CONTRIBUTING.md#scripts) to interact
|
|
90
|
+
with them directly.
|
|
91
|
+
- [**Browse the source code**](./example/src/app) to understand how each feature
|
|
92
|
+
is implemented (see below the example list).
|
|
93
|
+
|
|
94
|
+
<!-- EXAMPLES-LIST:START -->
|
|
95
|
+
|
|
96
|
+
### 1. Map
|
|
97
|
+
|
|
98
|
+
- [`1.1. Component basis`](./example/src/app/1.-Map/1.1.-Component-basis.tsx)
|
|
99
|
+
- [`1.2. Create a camera animation`](./example/src/app/1.-Map/1.2.-Create-a-camera-animation.tsx)
|
|
100
|
+
- [`1.3. Use the globe projection`](./example/src/app/1.-Map/1.3.-Use-the-globe-projection.tsx)
|
|
101
|
+
- [`1.4. Add a raster tile source directly on map`](./example/src/app/1.-Map/1.4.-Add-a-raster-tile-source-directly-on-map.tsx)
|
|
102
|
+
|
|
103
|
+
### 2. Marker
|
|
104
|
+
|
|
105
|
+
- [`2.1. Component basis`](./example/src/app/2.-Marker/2.1.-Component-basis.tsx)
|
|
106
|
+
- [`2.2. Animate the coordinate`](./example/src/app/2.-Marker/2.2.-Animate-the-coordinate.tsx)
|
|
107
|
+
- [`2.3. Use an detached popup`](./example/src/app/2.-Marker/2.3.-Use-an-detached-popup.tsx)
|
|
108
|
+
- [`2.4. Use an attached popup`](./example/src/app/2.-Marker/2.4.-Use-an-attached-popup.tsx)
|
|
109
|
+
- [`2.5. Propagates the events to a parent component`](./example/src/app/2.-Marker/2.5.-Propagates-the-events-to-a-parent-component.tsx)
|
|
110
|
+
|
|
111
|
+
### 3. Popup
|
|
112
|
+
|
|
113
|
+
- [`3.1. Component basis`](./example/src/app/3.-Popup/3.1.-Component-basis.tsx)
|
|
114
|
+
|
|
115
|
+
<!-- EXAMPLES-LIST:END -->
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 🏁 Getting started
|
|
68
119
|
|
|
69
120
|
The minimal setup to render a MapLibre map in React Native.
|
|
70
121
|
|
|
@@ -89,7 +140,7 @@ export default App
|
|
|
89
140
|
```
|
|
90
141
|
|
|
91
142
|
|
|
92
|
-
## Design rationale
|
|
143
|
+
## 📝 Design rationale
|
|
93
144
|
|
|
94
145
|
Explain why I decided to build a new React Native map library instead of using
|
|
95
146
|
an existing one.
|
|
@@ -101,11 +152,11 @@ that can be used in React Native. Each has its strengths, and credit goes to
|
|
|
101
152
|
their contributors. Still, I have highlighted what I consider to be their main
|
|
102
153
|
drawbacks.
|
|
103
154
|
|
|
104
|
-
| Library
|
|
105
|
-
|
|
106
|
-
| `react-native-maps` / `expo-maps` | Overlay custom tiles on Apple Maps (iOS) or Google Maps (iOS/Android). | - On tile loading, the map below (Google Maps or Apple Maps) is visible.<br/>- If the map provider is Google Maps (mandatory on the Android platform), an API key is needed to use Google Maps SDK, and therefore its use is billed.
|
|
107
|
-
| `@rnmapbox/maps`
|
|
108
|
-
| `maplibre-react-native`
|
|
155
|
+
| Library | Notes | Main Drawbacks |
|
|
156
|
+
|-----------------------------------|------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
157
|
+
| `react-native-maps` / `expo-maps` | Overlay custom tiles on Apple Maps (iOS) or Google Maps (iOS/Android). | - On tile loading, the map below (Google Maps or Apple Maps) is visible.<br/>- If the map provider is Google Maps (mandatory on the Android platform), an API key is needed to use Google Maps SDK, and therefore its use is billed. |
|
|
158
|
+
| `@rnmapbox/maps` | - | - Dependence on Mapbox choices.<br>- On the latest versions, an API key is required (at least on the Android side that drops the MapLibre SDK support), and therefore its use is billed.<br>- To render animated markers or markers with dynamic content and developed visual styles, the use of native views is necessary, and this greatly slows down the application. |
|
|
159
|
+
| `maplibre-react-native` | Open source fork of MapBox. | - Being an open source fork of MapBox, the library is years behind (1000+ commits to date) and lacks many features and bug fixes.<br>- The same performance issue with native views as `@rnmapbox` is also present. |
|
|
109
160
|
|
|
110
161
|
### Architectural approach
|
|
111
162
|
|
|
@@ -122,10 +173,10 @@ libraries, while enabling more features.
|
|
|
122
173
|
I outline two solutions in this category below, along with the issues they still
|
|
123
174
|
carry. This library implements the second approach.
|
|
124
175
|
|
|
125
|
-
| Approach
|
|
126
|
-
|
|
127
|
-
| Remote WebView-based map
|
|
128
|
-
| Embedded WebView with bundled MapLibre GL JS | Bundle JS code that runs MapLibre GL JS
|
|
176
|
+
| Approach | Description | Main Drawbacks <br/> |
|
|
177
|
+
|----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
178
|
+
| Remote WebView-based map | Host a map on a web page and access it through a WebView. | - Requires additional infrastructure.<br>- Very sensitive to network latency, and in general, a degraded user experience.<br>- Offline usage is not possible. |
|
|
179
|
+
| Embedded WebView with bundled `MapLibre GL JS` | Bundle JS code that runs `MapLibre GL JS`, enabling two-way communication with React Native, and inject it into a WebView for execution. | - Any interaction between the WebView content and the React Native world is made through message-passing, which can make certain interactions more indirect.<br>- Some objects cannot be serialized and sent between the WebView code and React Native (e.g., HTMLElement).<br>- Some GitHub repositories are implementing this solution, however, no one is actively maintained, and the underlying web libraries are missing key features — good examples being `react-native-leaflet-view` and `@neukolabs/react-native-maplibre-js`. |
|
|
129
180
|
|
|
130
181
|
|
|
131
182
|
## Contributing
|
package/lib/module/index.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Public API of react-native-maplibre-gl-js
|
|
4
|
+
* Public API of `react-native-maplibre-gl-js`.
|
|
5
5
|
* @module Public API
|
|
6
6
|
* @packageDocumentation
|
|
7
|
+
* @sortStrategy sort-order
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
10
|
+
// @group Types
|
|
11
|
+
|
|
12
|
+
// @group Components
|
|
13
|
+
export { default as MapProvider } from "./react-native/components/MapProvider/MapProvider.js";
|
|
14
|
+
export { default as Map } from "./react-native/components/Map/Map.js";
|
|
15
|
+
export { default as Marker } from "./react-native/components/Marker/Marker.js";
|
|
16
|
+
export { default as Popup } from "./react-native/components/Popup/Popup.js";
|
|
14
17
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MapProvider","Map","Marker","Popup"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["default","MapProvider","Map","Marker","Popup"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAYA;AACA,SAASA,OAAO,IAAIC,WAAW,QAAQ,sDAAmD;AAC1F,SAASD,OAAO,IAAIE,GAAG,QAAQ,sCAAmC;AAClE,SAASF,OAAO,IAAIG,MAAM,QAAQ,4CAAyC;AAC3E,SAASH,OAAO,IAAII,KAAK,QAAQ,0CAAuC","ignoreList":[]}
|
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import createWebObjectAsComponent from
|
|
3
|
+
import createWebObjectAsComponent from "../../components-factory/createWebObjectAsComponent.js";
|
|
4
4
|
/**
|
|
5
5
|
* MapLibre Map view.
|
|
6
|
-
* @
|
|
6
|
+
* @props {@link MapProps}
|
|
7
|
+
* @ref {@link MapRef}
|
|
8
|
+
* @see {@link https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/ `MapLibre GL JS` docs}
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Map
|
|
12
|
+
* options={{
|
|
13
|
+
* style: 'https://tiles.openfreemap.org/styles/liberty',
|
|
14
|
+
* center: [2.32, 48.86],
|
|
15
|
+
* zoom: 12,
|
|
16
|
+
* }}
|
|
17
|
+
* listeners={{
|
|
18
|
+
* mount: {
|
|
19
|
+
* rnListener: () => console.log('Map mounted'),
|
|
20
|
+
* },
|
|
21
|
+
* unmount: {
|
|
22
|
+
* rnListener: () => console.log('Map unmounted'),
|
|
23
|
+
* },
|
|
24
|
+
* click: {
|
|
25
|
+
* objectListener: (event: MapMouseEvent) =>
|
|
26
|
+
* console.log('Map clicked', event),
|
|
27
|
+
* },
|
|
28
|
+
* rotatestart: {
|
|
29
|
+
* objectListener: (
|
|
30
|
+
* event: MapLibreEvent<MouseEvent | TouchEvent | undefined>,
|
|
31
|
+
* ) => console.log('Map rotation started', event),
|
|
32
|
+
* },
|
|
33
|
+
* }}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
7
36
|
* @group Components
|
|
8
37
|
*/
|
|
9
38
|
const Map = createWebObjectAsComponent('map');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createWebObjectAsComponent","Map"],"sourceRoot":"../../../../../src","sources":["react-native/components/Map/Map.tsx"],"mappings":";;AAAA,OAAOA,0BAA0B,MAAM,
|
|
1
|
+
{"version":3,"names":["createWebObjectAsComponent","Map"],"sourceRoot":"../../../../../src","sources":["react-native/components/Map/Map.tsx"],"mappings":";;AAAA,OAAOA,0BAA0B,MAAM,wDAAqD;AAG5F;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,MAAMC,GAAG,GAAGD,0BAA0B,CAAmB,KAAK,CAAC;AAE/D,eAAeC,GAAG","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","useMemo","useStyles","create","container","width","height","overflow","
|
|
1
|
+
{"version":3,"names":["StyleSheet","useMemo","useStyles","create","container","width","height","overflow","webView","flex","backgroundColor"],"sourceRoot":"../../../../../src","sources":["react-native/components/MapProvider/MapProvider.hooks.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,OAAO,QAAQ,OAAO;AAE/B,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAAM;EAC7B,OAAOD,OAAO,CACZ,MACED,UAAU,CAACG,MAAM,CAAC;IAChBC,SAAS,EAAE;MAAEC,KAAK,EAAE,MAAM;MAAEC,MAAM,EAAE,MAAM;MAAEC,QAAQ,EAAE;IAAS,CAAC;IAChEC,OAAO,EAAE;MAAEC,IAAI,EAAE,CAAC;MAAEC,eAAe,EAAE;IAAc;EACrD,CAAC,CAAC,EACJ,EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -2,19 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import { WebView } from 'react-native-webview';
|
|
5
|
-
import { WEBVIEW_STATIC_HTML } from
|
|
6
|
-
import RNLogger from
|
|
7
|
-
import useMapAtoms from
|
|
8
|
-
import { isWebObjectListenerOnHTMLElement, isWebObjectListenerOnMapLayer, isWebObjectListenerOnObject, isWebObjectListenerOnRN } from
|
|
9
|
-
import { useStyles } from
|
|
5
|
+
import { WEBVIEW_STATIC_HTML } from "../../../web/generated/webview_static_html.js";
|
|
6
|
+
import RNLogger from "../../logger/rn-logger.js";
|
|
7
|
+
import useMapAtoms from "../../hooks/atoms/useMapAtoms.js";
|
|
8
|
+
import { isWebObjectListenerOnHTMLElement, isWebObjectListenerOnMapLayer, isWebObjectListenerOnObject, isWebObjectListenerOnRN } from "../../../communication/messages.utils.js";
|
|
9
|
+
import { useStyles } from "./MapProvider.hooks.js";
|
|
10
10
|
import { useCallback, useEffect } from 'react';
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Must be used as a parent component to allow instantiation of map elements.
|
|
14
|
+
* Every child must be a direct component.
|
|
15
|
+
* This is the bridge to the web world / the `MapLibre GL JS` library.
|
|
14
16
|
* @param props -
|
|
15
17
|
* @group Components
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <MapProvider>
|
|
21
|
+
* <Map/>
|
|
22
|
+
* <Marker/>
|
|
23
|
+
* ...
|
|
24
|
+
* </MapProvider>
|
|
25
|
+
* ```
|
|
16
26
|
*/
|
|
17
27
|
const MapProvider = ({
|
|
28
|
+
style,
|
|
29
|
+
webViewStyle,
|
|
18
30
|
children
|
|
19
31
|
}) => {
|
|
20
32
|
// States.
|
|
@@ -96,10 +108,10 @@ const MapProvider = ({
|
|
|
96
108
|
}
|
|
97
109
|
}, [setIsWebWorldReady, getWebObjectListeners, resolveWebObjectPendingMethodResponse]);
|
|
98
110
|
return /*#__PURE__*/_jsxs(View, {
|
|
99
|
-
style: styles.container,
|
|
111
|
+
style: [styles.container, style],
|
|
100
112
|
children: [/*#__PURE__*/_jsx(WebView, {
|
|
101
113
|
ref: setWebView,
|
|
102
|
-
style: styles.
|
|
114
|
+
style: [styles.webView, webViewStyle],
|
|
103
115
|
originWhitelist: ['*'],
|
|
104
116
|
javaScriptEnabled: true,
|
|
105
117
|
allowFileAccess: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","WebView","WEBVIEW_STATIC_HTML","RNLogger","useMapAtoms","isWebObjectListenerOnHTMLElement","isWebObjectListenerOnMapLayer","isWebObjectListenerOnObject","isWebObjectListenerOnRN","useStyles","useCallback","useEffect","jsx","_jsx","jsxs","_jsxs","MapProvider","children","setWebView","setIsWebWorldReady","isMapMountMessageReady","flushMessages","getWebObjectListeners","resolveWebObjectPendingMethodResponse","styles","onMessage","handleMessage","event","debug","name","nativeEvent","data","message","JSON","parse","type","payload","level","args","slice","listener","objectId","eventName","rnListener","objectListener","layerListener","elementListener","requestId","result","error","
|
|
1
|
+
{"version":3,"names":["View","WebView","WEBVIEW_STATIC_HTML","RNLogger","useMapAtoms","isWebObjectListenerOnHTMLElement","isWebObjectListenerOnMapLayer","isWebObjectListenerOnObject","isWebObjectListenerOnRN","useStyles","useCallback","useEffect","jsx","_jsx","jsxs","_jsxs","MapProvider","style","webViewStyle","children","setWebView","setIsWebWorldReady","isMapMountMessageReady","flushMessages","getWebObjectListeners","resolveWebObjectPendingMethodResponse","styles","onMessage","handleMessage","event","debug","name","nativeEvent","data","message","JSON","parse","type","payload","level","args","slice","listener","objectId","eventName","rnListener","objectListener","layerListener","elementListener","requestId","result","error","container","ref","webView","originWhitelist","javaScriptEnabled","allowFileAccess","domStorageEnabled","scrollEnabled","allowUniversalAccessFromFileURLs","mixedContentMode","source","html"],"sourceRoot":"../../../../../src","sources":["react-native/components/MapProvider/MapProvider.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,OAAO,QAAkC,sBAAsB;AACxE,SAASC,mBAAmB,QAAQ,+CAA4C;AAEhF,OAAOC,QAAQ,MAAM,2BAAwB;AAC7C,OAAOC,WAAW,MAAM,kCAA+B;AACvD,SACEC,gCAAgC,EAChCC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,uBAAuB,QAClB,0CAAuC;AAC9C,SAASC,SAAS,QAAQ,wBAAqB;AAC/C,SAASC,WAAW,EAAEC,SAAS,QAAQ,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAGA,CAAC;EAAEC,KAAK;EAAEC,YAAY;EAAEC;AAA2B,CAAC,KAAK;EAC3E;EACA;EACA,MAAM;IACJC,UAAU;IACVC,kBAAkB;IAClBC,sBAAsB;IACtBC,aAAa;IACbC,qBAAqB;IACrBC;EACF,CAAC,GAAGrB,WAAW,CAAC,CAAC;EACjB;EACA,MAAMsB,MAAM,GAAGjB,SAAS,CAAC,CAAC;;EAE1B;EACA;EACA;EACAE,SAAS,CAAC,MAAM;IACd,IAAIW,sBAAsB,EAAE;MAC1BC,aAAa,CAAC,CAAC;IACjB;EACF,CAAC,EAAE,CAACA,aAAa,EAAED,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Component from
|
|
3
|
+
import createWebObjectAsComponent from "../../components-factory/createWebObjectAsComponent.js";
|
|
4
4
|
/**
|
|
5
5
|
* MapLibre Marker view.
|
|
6
|
-
* @
|
|
6
|
+
* @props {@link MarkerProps}
|
|
7
|
+
* @ref {@link MarkerRef}
|
|
8
|
+
* @see {@link https://maplibre.org/maplibre-gl-js/docs/API/classes/Marker/ `MapLibre GL JS` docs}
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Marker
|
|
12
|
+
* ref={markerRef}
|
|
13
|
+
* options={{
|
|
14
|
+
* draggable: true,
|
|
15
|
+
* // The element to be used as the marker (a descriptor of an HTMLElement).
|
|
16
|
+
* element: {
|
|
17
|
+
* tagName: 'div',
|
|
18
|
+
* innerHTML: `
|
|
19
|
+
* <style>
|
|
20
|
+
* .no-margin * {
|
|
21
|
+
* margin: 0;
|
|
22
|
+
* }
|
|
23
|
+
* </style>
|
|
24
|
+
* <div
|
|
25
|
+
* class="no-margin"
|
|
26
|
+
* style="
|
|
27
|
+
* display: flex;
|
|
28
|
+
* align-items: center;
|
|
29
|
+
* justify-content: center;
|
|
30
|
+
* aspect-ratio: 1;
|
|
31
|
+
* padding: 4px;
|
|
32
|
+
* border-radius: 50%;
|
|
33
|
+
* background-color: #FFF;
|
|
34
|
+
* box-shadow: 0 0 10px #000A;
|
|
35
|
+
* "
|
|
36
|
+
* >
|
|
37
|
+
* <h1>📍</h1>
|
|
38
|
+
* </div>`,
|
|
39
|
+
* },
|
|
40
|
+
* }}
|
|
41
|
+
* listeners={{
|
|
42
|
+
* mount: {
|
|
43
|
+
* rnListener: () => {
|
|
44
|
+
* // The marker coordinate must be set on mount.
|
|
45
|
+
* markerRef.current?.setLngLat([2.32, 48.86])
|
|
46
|
+
* },
|
|
47
|
+
* },
|
|
48
|
+
* click: {
|
|
49
|
+
* elementListener: async (_: MouseEvent) => {
|
|
50
|
+
* const lngLat = await markerRef.current?.getLngLat()
|
|
51
|
+
* console.log('Marker clicked at', lngLat)
|
|
52
|
+
* },
|
|
53
|
+
* },
|
|
54
|
+
* }}
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
7
57
|
* @group Components
|
|
8
58
|
*/
|
|
9
59
|
const Marker = createWebObjectAsComponent('marker');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createWebObjectAsComponent","Marker"],"sourceRoot":"../../../../../src","sources":["react-native/components/Marker/Marker.tsx"],"mappings":";;AAAA,OAAOA,0BAA0B,MAAM,
|
|
1
|
+
{"version":3,"names":["createWebObjectAsComponent","Marker"],"sourceRoot":"../../../../../src","sources":["react-native/components/Marker/Marker.tsx"],"mappings":";;AAAA,OAAOA,0BAA0B,MAAM,wDAAqD;AAG5F;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,MAAMC,MAAM,GAAGD,0BAA0B,CAAyB,QAAQ,CAAC;AAE3E,eAAeC,MAAM","ignoreList":[]}
|
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import createWebObjectAsComponent from
|
|
4
|
-
|
|
3
|
+
import createWebObjectAsComponent from "../../components-factory/createWebObjectAsComponent.js";
|
|
5
4
|
/**
|
|
6
5
|
* MapLibre Popup view.
|
|
7
|
-
* @
|
|
6
|
+
* @props {@link PopupProps}
|
|
7
|
+
* @ref {@link PopupRef}
|
|
8
|
+
* @see {@link https://maplibre.org/maplibre-gl-js/docs/API/classes/Popup/ `MapLibre GL JS` docs}
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Popup
|
|
12
|
+
* ref={popupRef}
|
|
13
|
+
* options={{
|
|
14
|
+
* closeButton: true,
|
|
15
|
+
* }}
|
|
16
|
+
* listeners={{
|
|
17
|
+
* mount: {
|
|
18
|
+
* rnListener: () => {
|
|
19
|
+
* // The popup is opened once the coordinates are set.
|
|
20
|
+
* popupRef.current?.setLngLat([2.32, 48.86])
|
|
21
|
+
* popupRef.current?.setText('This is a popup')
|
|
22
|
+
* },
|
|
23
|
+
* },
|
|
24
|
+
* open: {
|
|
25
|
+
* objectListener: () => console.log('Popup opened'),
|
|
26
|
+
* },
|
|
27
|
+
* close: {
|
|
28
|
+
* objectListener: () => console.log('Popup closed'),
|
|
29
|
+
* },
|
|
30
|
+
* }}
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
8
33
|
* @group Components
|
|
9
34
|
*/
|
|
10
35
|
const Popup = createWebObjectAsComponent('popup');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createWebObjectAsComponent","Popup"],"sourceRoot":"../../../../../src","sources":["react-native/components/Popup/Popup.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["createWebObjectAsComponent","Popup"],"sourceRoot":"../../../../../src","sources":["react-native/components/Popup/Popup.tsx"],"mappings":";;AAAA,OAAOA,0BAA0B,MAAM,wDAAqD;AAG5F;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,MAAMC,KAAK,GAAGD,0BAA0B,CAAuB,OAAO,CAAC;AAEvE,eAAeC,KAAK","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { forwardRef, useId } from 'react';
|
|
4
|
-
import useWebObjectMountOnLaunch from
|
|
5
|
-
import useWebObjectMethodsProxy from
|
|
4
|
+
import useWebObjectMountOnLaunch from "./hooks/useWebObjectMountOnLaunch.js";
|
|
5
|
+
import useWebObjectMethodsProxy from "./hooks/useWebObjectMethodsProxy.js";
|
|
6
6
|
const createWebObjectAsComponent = objectType => {
|
|
7
7
|
return /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
// UID of the web object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","useId","useWebObjectMountOnLaunch","useWebObjectMethodsProxy","createWebObjectAsComponent","objectType","props","ref","id"],"sourceRoot":"../../../../src","sources":["react-native/components-factory/createWebObjectAsComponent.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,KAAK,QAAQ,OAAO;AAOzC,OAAOC,yBAAyB,MAAM,
|
|
1
|
+
{"version":3,"names":["forwardRef","useId","useWebObjectMountOnLaunch","useWebObjectMethodsProxy","createWebObjectAsComponent","objectType","props","ref","id"],"sourceRoot":"../../../../src","sources":["react-native/components-factory/createWebObjectAsComponent.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,KAAK,QAAQ,OAAO;AAOzC,OAAOC,yBAAyB,MAAM,sCAAmC;AACzE,OAAOC,wBAAwB,MAAM,qCAAkC;AAEvE,MAAMC,0BAA0B,GAI9BC,UAAyB,IACU;EACnC,oBAAOL,UAAU,CAAa,CAACM,KAAK,EAAEC,GAAG,KAAK;IAC5C;IACA,MAAMC,EAAE,GAAGP,KAAK,CAAC,CAAC;IAClB;IACAC,yBAAyB,CAAQI,KAAK,EAAEE,EAAE,EAAEH,UAAU,CAAC;IACvD;IACAF,wBAAwB,CAAMI,GAAG,EAAEC,EAAE,CAAC;IACtC;IACA;IACA;IACA;;IAEA,OAAO,IAAI;EACb,CAAC,CAAC;AACJ,CAAC;AAED,eAAeJ,0BAA0B","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useCallback, useImperativeHandle, useMemo } from 'react';
|
|
4
|
-
import useMapAtoms from
|
|
4
|
+
import useMapAtoms from "../../hooks/atoms/useMapAtoms.js";
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Create a proxy to call the methods of the corresponding web world object,
|
|
7
8
|
* then expose it as the given `ref`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useImperativeHandle","useMemo","useMapAtoms","useWebObjectMethodsProxy","ref","objectId","dispatchMessage","setWebObjectPendingMethodResponse","createProxy","Proxy","get","_","propKey","args","Promise","resolve","requestId","Math","random","toString","slice","type","payload","method","methodsProxy"],"sourceRoot":"../../../../../src","sources":["react-native/components-factory/hooks/useWebObjectMethodsProxy.ts"],"mappings":";;AAAA,SAEEA,WAAW,EACXC,mBAAmB,EACnBC,OAAO,QACF,OAAO;
|
|
1
|
+
{"version":3,"names":["useCallback","useImperativeHandle","useMemo","useMapAtoms","useWebObjectMethodsProxy","ref","objectId","dispatchMessage","setWebObjectPendingMethodResponse","createProxy","Proxy","get","_","propKey","args","Promise","resolve","requestId","Math","random","toString","slice","type","payload","method","methodsProxy"],"sourceRoot":"../../../../../src","sources":["react-native/components-factory/hooks/useWebObjectMethodsProxy.ts"],"mappings":";;AAAA,SAEEA,WAAW,EACXC,mBAAmB,EACnBC,OAAO,QACF,OAAO;AAEd,OAAOC,WAAW,MAAM,kCAA+B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAGA,CACtCC,GAAsB,EACtBC,QAAgB,KACb;EACH;EACA;EACA,MAAM;IAAEC,eAAe;IAAEC;EAAkC,CAAC,GAAGL,WAAW,CAAC,CAAC;EAE5E,MAAMM,WAAW,GAAGT,WAAW,CAAC,MAAW;IACzC,OAAO,IAAIU,KAAK,CACd,CAAC,CAAC,EACF;MACEC,GAAGA,CAACC,CAAC,EAAEC,OAAO,EAAE;QACd,IAAIA,OAAO,KAAK,OAAO,EAAE;UACvB,OAAO,MAAMP,QAAQ;QACvB;QACA,OAAO,CAAC,GAAGQ,IAAW,KAAK;UACzB,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;YAC9B;YACA,MAAMC,SAAS,GAAGC,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;YACzD;YACAb,iCAAiC,CAAC;cAAES,SAAS;cAAED;YAAQ,CAAC,CAAC;YACzD;YACAT,eAAe,CAAC;cACde,IAAI,EAAE,qBAAqB;cAC3BC,OAAO,EAAE;gBACPN,SAAS;gBACTX,QAAQ;gBACRkB,MAAM,EAAEX,OAAiB;gBACzBC;cACF;YACF,CAAC,CAAC;UACJ,CAAC,CAAC;QACJ,CAAC;MACH;IACF,CACF,CAAC;EACH,CAAC,EAAE,CAACR,QAAQ,EAAEC,eAAe,EAAEC,iCAAiC,CAAC,CAAC;EAElE,MAAMiB,YAAY,GAAGvB,OAAO,CAAC,MAAMO,WAAW,CAAC,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAChE;EACAR,mBAAmB,CAACI,GAAG,EAAE,MAAMoB,YAAY,CAAC;AAC9C,CAAC;AAED,eAAerB,wBAAwB","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useCallback, useEffect, useRef } from 'react';
|
|
4
|
-
import useMapAtoms from
|
|
4
|
+
import useMapAtoms from "../../hooks/atoms/useMapAtoms.js";
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Mount the web object once the React Native one is mounted.
|
|
7
8
|
* @param props - The RN object props.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useEffect","useRef","useMapAtoms","useWebObjectMountOnLaunch","props","objectId","objectType","isMounted","isWebWorldReady","dispatchMessage","setWebObjectListeners","deleteWebObjectListeners","mount","type","payload","options","listeners","current","unmount"],"sourceRoot":"../../../../../src","sources":["react-native/components-factory/hooks/useWebObjectMountOnLaunch.ts"],"mappings":";;AAAA,SAA+BA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useRef","useMapAtoms","useWebObjectMountOnLaunch","props","objectId","objectType","isMounted","isWebWorldReady","dispatchMessage","setWebObjectListeners","deleteWebObjectListeners","mount","type","payload","options","listeners","current","unmount"],"sourceRoot":"../../../../../src","sources":["react-native/components-factory/hooks/useWebObjectMountOnLaunch.ts"],"mappings":";;AAAA,SAA+BA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAG5E,OAAOC,WAAW,MAAM,kCAA+B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,yBAAyB,GAAGA,CAChCC,KAA6B,EAC7BC,QAAgB,EAChBC,UAAyB,KACtB;EACH;EACA,MAAMC,SAAS,GAAGN,MAAM,CAAU,KAAK,CAAC;EACxC;EACA;EACA,MAAM;IACJO,eAAe;IACfC,eAAe;IACfC,qBAAqB;IACrBC;EACF,CAAC,GAAGT,WAAW,CAAC,CAAC;EAEjB,MAAMU,KAAK,GAAGb,WAAW,CAAC,MAAM;IAC9B;IACAU,eAAe,CAAC;MACdI,IAAI,EAAE,gBAAgB;MACtBC,OAAO,EAAE;QACPT,QAAQ,EAAEA,QAAQ;QAClBC,UAAU;QACVS,OAAO,EAAEX,KAAK,CAACW,OAAO,IAAI,CAAC,CAAC;QAC5BC,SAAS,EAAEZ,KAAK,CAACY,SAAS,IAAI,CAAC;MACjC;IACF,CAAC,CAAC;IACF;IACAN,qBAAqB,CAAC;MACpBL,QAAQ,EAAEA,QAAQ;MAClBW,SAAS,EAAEZ,KAAK,CAACY,SAAS,IAAI,CAAC;IACjC,CAAC,CAAC;IACFT,SAAS,CAACU,OAAO,GAAG,IAAI;EAC1B,CAAC,EAAE,CACDZ,QAAQ,EACRC,UAAU,EACVF,KAAK,CAACW,OAAO,EACbX,KAAK,CAACY,SAAS,EACfP,eAAe,EACfC,qBAAqB,CACtB,CAAC;EAEF,MAAMQ,OAAO,GAAGnB,WAAW,CAAC,MAAM;IAChCU,eAAe,CAAC;MACdI,IAAI,EAAE,kBAAkB;MACxBC,OAAO,EAAE;QAAET;MAAS;IACtB,CAAC,CAAC;IACFM,wBAAwB,CAAC;MAAEN;IAAS,CAAC,CAAC;IACtCE,SAAS,CAACU,OAAO,GAAG,KAAK;EAC3B,CAAC,EAAE,CAACZ,QAAQ,EAAEI,eAAe,EAAEE,wBAAwB,CAAC,CAAC;;EAEzD;EACAX,SAAS,CAAC,MAAM;IACd,IAAI,CAACQ,eAAe,EAAE;MACpB;IACF;IAEA,IAAI,CAACD,SAAS,CAACU,OAAO,EAAE;MACtBL,KAAK,CAAC,CAAC;IACT;IACA;IACA;IACA;IACA;EACF,CAAC,EAAE,CAACP,QAAQ,EAAEG,eAAe,EAAEC,eAAe,EAAEL,KAAK,EAAEc,OAAO,EAAEN,KAAK,CAAC,CAAC;AACzE,CAAC;AAED,eAAeT,yBAAyB","ignoreList":[]}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { atom, useSetAtom } from 'jotai';
|
|
4
4
|
import { useAtom } from 'jotai';
|
|
5
|
-
import { stableStringify } from
|
|
5
|
+
import { stableStringify } from "./useMapAtoms.utils.js";
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
|
-
* The WebView used to render MapLibre GL JS views (the web world).
|
|
8
|
+
* The WebView used to render `MapLibre GL JS` views (the web world).
|
|
8
9
|
*/
|
|
9
10
|
const webViewAtom = atom(null);
|
|
10
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["atom","useSetAtom","useAtom","stableStringify","webViewAtom","isWebWorldReadyAtom","isMapMountMessageReadyAtom","isMapMountMessageDispatchedAtom","messageQueueAtom","webObjectPendingMethodResponses","Map","webObjectsListenersAtom","enqueueMessageAtom","get","set","message","q","dispatchMessageAtom","isWebWorldReady","isMapMountMessageReady","isMapMountMessageDispatched","webView","isMapMountMessage","type","payload","objectType","postMessage","flushMessagesAtom","messageQueue","length","forEach","setWebObjectPendingMethodResponseAtom","requestId","resolve","map","resolveWebObjectPendingMethodResponseAtom","result","resolver","delete","deleteWebObjectPendingMethodResponseAtom","setWebObjectListenersAtom","objectId","listeners","getWebObjectListenersAtom","_set","deleteWebObjectListenersAtom","useMapAtoms","setWebView","setIsWebWorldReady","enqueueMessage","dispatchMessage","flushMessages","setWebObjectPendingMethodResponse","resolveWebObjectPendingMethodResponse","deleteWebObjectPendingMethodResponse","setWebObjectListeners","getWebObjectListeners","deleteWebObjectListeners"],"sourceRoot":"../../../../../src","sources":["react-native/hooks/atoms/useMapAtoms.ts"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,UAAU,QAAQ,OAAO;AAExC,SAASC,OAAO,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"names":["atom","useSetAtom","useAtom","stableStringify","webViewAtom","isWebWorldReadyAtom","isMapMountMessageReadyAtom","isMapMountMessageDispatchedAtom","messageQueueAtom","webObjectPendingMethodResponses","Map","webObjectsListenersAtom","enqueueMessageAtom","get","set","message","q","dispatchMessageAtom","isWebWorldReady","isMapMountMessageReady","isMapMountMessageDispatched","webView","isMapMountMessage","type","payload","objectType","postMessage","flushMessagesAtom","messageQueue","length","forEach","setWebObjectPendingMethodResponseAtom","requestId","resolve","map","resolveWebObjectPendingMethodResponseAtom","result","resolver","delete","deleteWebObjectPendingMethodResponseAtom","setWebObjectListenersAtom","objectId","listeners","getWebObjectListenersAtom","_set","deleteWebObjectListenersAtom","useMapAtoms","setWebView","setIsWebWorldReady","enqueueMessage","dispatchMessage","flushMessages","setWebObjectPendingMethodResponse","resolveWebObjectPendingMethodResponse","deleteWebObjectPendingMethodResponse","setWebObjectListeners","getWebObjectListeners","deleteWebObjectListeners"],"sourceRoot":"../../../../../src","sources":["react-native/hooks/atoms/useMapAtoms.ts"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,UAAU,QAAQ,OAAO;AAExC,SAASC,OAAO,QAAQ,OAAO;AAM/B,SAASC,eA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AAsB;IACtB;IACA8B,cAAc,EAAEhD,UAAU,CAACW,kBAAkB,CAAC;IAC9CsC,eAAe,EAAEjD,UAAU,CAACgB,mBAAmB,CAAC;IAChDkC,aAAa,EAAElD,UAAU,CAAC0B,iBAAiB,CAAC;IAC5C;IACAyB,iCAAiC,EAAEnD,UAAU,CAC3C8B,qCACF,CAAC;IACDsB,qCAAqC,EAAEpD,UAAU,CAC/CkC,yCACF,CAAC;IACDmB,oCAAoC,EAAErD,UAAU,CAC9CsC,wCACF,CAAC;IACD;IACAgB,qBAAqB,EAAEtD,UAAU,CAACuC,yBAAyB,CAAC;IAC5DgB,qBAAqB,EAAEvD,UAAU,CAAC0C,yBAAyB,CAAC;IAC5Dc,wBAAwB,EAAExD,UAAU,CAAC4C,4BAA4B;EACnE,CAAC;AACH,CAAC;AAED,eAAeC,WAAW","ignoreList":[]}
|
package/lib/module/typedoc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebLogger","ReactNativeBridge","mapController","constructor","messageHandler","raw","debug","name","data","message","JSON","parse","handleMessage","error","document","addEventListener","window","controller","postMessage","ReactNativeWebView","stringify"],"sourceRoot":"../../../../src","sources":["web/bridge/ReactNativeBridge.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["WebLogger","ReactNativeBridge","mapController","constructor","messageHandler","raw","debug","name","data","message","JSON","parse","handleMessage","error","document","addEventListener","window","controller","postMessage","ReactNativeWebView","stringify"],"sourceRoot":"../../../../src","sources":["web/bridge/ReactNativeBridge.ts"],"mappings":";;AACA,OAAOA,SAAS,MAAM,yBAAsB;AAM5C;AACA;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,CAAC;EACrC,CAACC,aAAa;EAEdC,WAAWA,CAAA,EAAG;IACZ,MAAMC,cAAc,GAAIC,GAAQ,IAAK;MACnC,IAAI;QACFL,SAAS,CAACM,KAAK,CAAC,IAAI,CAACH,WAAW,CAACI,IAAI,EAAEF,GAAG,EAAEG,IAAI,CAAC;QACjD,MAAMA,IAAI,GAAG,OAAOH,GAAG,EAAEG,IAAI,KAAK,QAAQ,GAAGH,GAAG,CAACG,IAAI,GAAGH,GAAG;QAC3D,MAAMI,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACH,IAAI,CAAuB;QACtD,IAAI,CAACN,aAAa,EAAEU,aAAa,CAACH,OAAO,CAAC;MAC5C,CAAC,CAAC,OAAOI,KAAU,EAAE;QACnBb,SAAS,CAACa,KAAK,CAAC,IAAI,CAACV,WAAW,CAACI,IAAI,EAAEM,KAAK,CAACJ,OAAO,CAAC;MACvD;IACF,CAAC;IACD;IACAK,QAAQ,CAACC,gBAAgB,GAAG,SAAS,EAAEX,cAAc,CAAC;IACtDY,MAAM,CAACD,gBAAgB,GAAG,SAAS,EAAEX,cAAc,CAAC;EACtD;EAEA,IAAIF,aAAaA,CAACe,UAAyB,EAAE;IAC3C,IAAI,CAAC,CAACf,aAAa,GAAGe,UAAU;EAClC;EAEA,IAAIf,aAAaA,CAAA,EAA8B;IAC7C,OAAO,IAAI,CAAC,CAACA,aAAa;EAC5B;EAEAgB,WAAWA,CAACT,OAA2B,EAAE;IACvCT,SAAS,CAACM,KAAK,CAAC,IAAI,CAACY,WAAW,CAACX,IAAI,EAAEE,OAAO,CAAC;IAC/C;IACAO,MAAM,CAACG,kBAAkB,EAAED,WAAW,CAACR,IAAI,CAACU,SAAS,CAACX,OAAO,CAAC,CAAC;EACjE;AACF","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import MapController from "../maplibre-gl-js/MapController.js";
|
|
5
|
+
import ReactNativeBridge from "../bridge/ReactNativeBridge.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Main entry point for the web app to be bundled. Initialize the map controller
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["MapController","ReactNativeBridge","main","controller","bridge","reactNativeBridge","mapController","postMessage","type"],"sourceRoot":"../../../../src","sources":["web/generated/index.ts"],"mappings":";;AAAA,OAAO,kCAAkC;AACzC,OAAOA,aAAa,MAAM,oCAAiC;AAC3D,OAAOC,iBAAiB,MAAM,gCAA6B;;AAE3D;AACA;AACA;AACA;AACA,MAAMC,IAAI,GAAGA,CAAA,KAAM;EACjB,MAAMC,UAAU,GAAG,IAAIH,aAAa,CAAC,CAAC;EACtC,MAAMI,MAAM,GAAG,IAAIH,iBAAiB,CAAC,CAAC;EACtCE,UAAU,CAACE,iBAAiB,GAAGD,MAAM;EACrCA,MAAM,CAACE,aAAa,GAAGH,UAAU;EACjCC,MAAM,CAACG,WAAW,CAAC;IAAEC,IAAI,EAAE;EAAQ,CAAC,CAAC;AACvC,CAAC;AAEDN,IAAI,CAAC,CAAC","ignoreList":[]}
|