@lugg/maps 0.2.0-alpha.13 → 0.2.0-alpha.14
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.
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { forwardRef, useEffect, useId, useImperativeHandle, useRef, useState } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import { Map, useMap } from '@vis.gl/react-google-maps';
|
|
6
6
|
import { Marker } from "./components/Marker.web.js";
|
|
7
|
-
import { Polyline } from "./components/Polyline.web.js";
|
|
8
7
|
import { MapIdContext } from "./MapProvider.web.js";
|
|
9
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
const MAP_COMPONENT_TYPES = new Set([Marker, Polyline]);
|
|
11
|
-
const isMapComponent = child => MAP_COMPONENT_TYPES.has(child.type);
|
|
12
9
|
const createSyntheticEvent = nativeEvent => ({
|
|
13
10
|
nativeEvent,
|
|
14
11
|
currentTarget: null,
|
|
@@ -192,58 +189,31 @@ export const MapView = /*#__PURE__*/forwardRef(function MapView(props, ref) {
|
|
|
192
189
|
lat: initialCoordinate.latitude,
|
|
193
190
|
lng: initialCoordinate.longitude
|
|
194
191
|
} : undefined;
|
|
195
|
-
const {
|
|
196
|
-
mapChildren,
|
|
197
|
-
overlayChildren
|
|
198
|
-
} = useMemo(() => {
|
|
199
|
-
const mapNodes = [];
|
|
200
|
-
const overlayNodes = [];
|
|
201
|
-
Children.forEach(children, child => {
|
|
202
|
-
if (! /*#__PURE__*/isValidElement(child)) return;
|
|
203
|
-
if (isMapComponent(child)) {
|
|
204
|
-
mapNodes.push(child);
|
|
205
|
-
} else {
|
|
206
|
-
overlayNodes.push(child);
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
return {
|
|
210
|
-
mapChildren: mapNodes,
|
|
211
|
-
overlayChildren: overlayNodes
|
|
212
|
-
};
|
|
213
|
-
}, [children]);
|
|
214
|
-
const mapContainerStyle = {
|
|
215
|
-
position: 'absolute',
|
|
216
|
-
top: padding?.top ?? 0,
|
|
217
|
-
left: padding?.left ?? 0,
|
|
218
|
-
right: padding?.right ?? 0,
|
|
219
|
-
bottom: padding?.bottom ?? 0
|
|
220
|
-
};
|
|
221
192
|
const mapStyle = {
|
|
222
|
-
|
|
223
|
-
|
|
193
|
+
paddingTop: padding?.top ?? 0,
|
|
194
|
+
paddingLeft: padding?.left ?? 0,
|
|
195
|
+
paddingRight: padding?.right ?? 0,
|
|
196
|
+
paddingBottom: padding?.bottom ?? 0
|
|
224
197
|
};
|
|
225
198
|
return /*#__PURE__*/_jsx(MapIdContext.Provider, {
|
|
226
199
|
value: id,
|
|
227
|
-
children: /*#__PURE__*/
|
|
200
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
228
201
|
style: style,
|
|
229
|
-
children:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}), mapChildren]
|
|
245
|
-
})
|
|
246
|
-
}), overlayChildren]
|
|
202
|
+
children: /*#__PURE__*/_jsxs(Map, {
|
|
203
|
+
id: id,
|
|
204
|
+
mapId: mapId,
|
|
205
|
+
defaultCenter: defaultCenter,
|
|
206
|
+
defaultZoom: initialZoom,
|
|
207
|
+
minZoom: minZoom,
|
|
208
|
+
maxZoom: maxZoom,
|
|
209
|
+
gestureHandling: gestureHandling,
|
|
210
|
+
disableDefaultUI: true,
|
|
211
|
+
tilt: pitchEnabled === false ? 0 : undefined,
|
|
212
|
+
style: mapStyle,
|
|
213
|
+
children: [/*#__PURE__*/_jsx(UserLocationMarker, {
|
|
214
|
+
enabled: userLocationEnabled
|
|
215
|
+
}), children]
|
|
216
|
+
})
|
|
247
217
|
})
|
|
248
218
|
});
|
|
249
219
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["forwardRef","useEffect","useId","useImperativeHandle","useRef","useState","View","Map","useMap","Marker","MapIdContext","jsx","_jsx","jsxs","_jsxs","createSyntheticEvent","nativeEvent","currentTarget","target","bubbles","cancelable","defaultPrevented","eventPhase","isTrusted","preventDefault","stopPropagation","isDefaultPrevented","isPropagationStopped","persist","timeStamp","Date","now","type","userLocationDotStyle","width","height","backgroundColor","border","borderRadius","boxShadow","UserLocationMarker","enabled","coordinate","setCoordinate","watchId","updateLocation","position","latitude","coords","longitude","navigator","geolocation","getCurrentPosition","watchPosition","clearWatch","anchor","x","y","children","style","MapView","props","ref","mapId","google","maps","DEMO_MAP_ID","initialCoordinate","initialZoom","minZoom","maxZoom","zoomEnabled","scrollEnabled","pitchEnabled","padding","userLocationEnabled","onCameraMove","onCameraIdle","onReady","id","map","readyFired","moveCamera","options","zoom","duration","center","lat","lng","currentZoom","getZoom","zoomChanged","undefined","setZoom","panTo","fitCoordinates","coordinates","first","fitPadding","length","bounds","LatLngBounds","forEach","coord","extend","fitBounds","top","left","bottom","right","current","createPayload","gesture","getCenter","isDragging","wasGesture","dragStartListener","addListener","dragEndListener","centerListener","idleListener","event","removeListener","gestureHandling","defaultCenter","mapStyle","paddingTop","paddingLeft","paddingRight","paddingBottom","Provider","value","defaultZoom","disableDefaultUI","tilt"],"sourceRoot":"../../src","sources":["MapView.web.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,SAAS,EACTC,KAAK,EACLC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QAEH,OAAO;AAEd,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,GAAG,EAAEC,MAAM,QAAQ,2BAA2B;AACvD,SAASC,MAAM,QAAQ,4BAAyB;AAChD,SAASC,YAAY,QAAQ,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IA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I,CAAC;IAC7BqB,WAAW,EAAErD,OAAO,EAAEiC,IAAI,IAAI,CAAC;IAC/BqB,YAAY,EAAEtD,OAAO,EAAEmC,KAAK,IAAI,CAAC;IACjCoB,aAAa,EAAEvD,OAAO,EAAEkC,MAAM,IAAI;EACpC,CAAC;EAED,oBACEhG,IAAA,CAACF,YAAY,CAACwH,QAAQ;IAACC,KAAK,EAAEpD,EAAG;IAAArB,QAAA,eAC/B9C,IAAA,CAACN,IAAI;MAACqD,KAAK,EAAEA,KAAM;MAAAD,QAAA,eACjB5C,KAAA,CAACP,GAAG;QACFwE,EAAE,EAAEA,EAAG;QACPhB,KAAK,EAAEA,KAAM;QACb6D,aAAa,EAAEA,aAAc;QAC7BQ,WAAW,EAAEhE,WAAY;QACzBC,OAAO,EAAEA,OAAQ;QACjBC,OAAO,EAAEA,OAAQ;QACjBqD,eAAe,EAAEA,eAAgB;QACjCU,gBAAgB;QAChBC,IAAI,EAAE7D,YAAY,KAAK,KAAK,GAAG,CAAC,GAAGmB,SAAU;QAC7CjC,KAAK,EAAEkE,QAAS;QAAAnE,QAAA,gBAEhB9C,IAAA,CAAC4B,kBAAkB;UAACC,OAAO,EAAEkC;QAAoB,CAAE,CAAC,EACnDjB,QAAQ;MAAA,CACN;IAAC,CACF;EAAC,CACc,CAAC;AAE5B,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.web.d.ts","sourceRoot":"","sources":["../../../src/MapView.web.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapView.web.d.ts","sourceRoot":"","sources":["../../../src/MapView.web.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAIX,MAAM,iBAAiB,CAAC;AAoEzB,eAAO,MAAM,OAAO,qGAwKlB,CAAC"}
|
package/package.json
CHANGED
package/src/MapView.web.tsx
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Children,
|
|
3
2
|
forwardRef,
|
|
4
|
-
isValidElement,
|
|
5
3
|
useEffect,
|
|
6
4
|
useId,
|
|
7
5
|
useImperativeHandle,
|
|
8
|
-
useMemo,
|
|
9
6
|
useRef,
|
|
10
7
|
useState,
|
|
11
8
|
type CSSProperties,
|
|
12
|
-
type ReactElement,
|
|
13
|
-
type ReactNode,
|
|
14
9
|
} from 'react';
|
|
15
|
-
import type { NativeSyntheticEvent
|
|
10
|
+
import type { NativeSyntheticEvent } from 'react-native';
|
|
16
11
|
import { View } from 'react-native';
|
|
17
12
|
import { Map, useMap } from '@vis.gl/react-google-maps';
|
|
18
13
|
import { Marker } from './components/Marker.web';
|
|
19
|
-
import { Polyline } from './components/Polyline.web';
|
|
20
14
|
import { MapIdContext } from './MapProvider.web';
|
|
21
15
|
|
|
22
16
|
import type {
|
|
@@ -28,11 +22,6 @@ import type {
|
|
|
28
22
|
} from './MapView.types';
|
|
29
23
|
import type { Coordinate } from './types';
|
|
30
24
|
|
|
31
|
-
const MAP_COMPONENT_TYPES = new Set([Marker, Polyline]);
|
|
32
|
-
|
|
33
|
-
const isMapComponent = (child: ReactElement): boolean =>
|
|
34
|
-
MAP_COMPONENT_TYPES.has(child.type as typeof Marker | typeof Polyline);
|
|
35
|
-
|
|
36
25
|
const createSyntheticEvent = <T,>(nativeEvent: T): NativeSyntheticEvent<T> =>
|
|
37
26
|
({
|
|
38
27
|
nativeEvent,
|
|
@@ -238,56 +227,31 @@ export const MapView = forwardRef<MapViewRef, MapViewProps>(function MapView(
|
|
|
238
227
|
? { lat: initialCoordinate.latitude, lng: initialCoordinate.longitude }
|
|
239
228
|
: undefined;
|
|
240
229
|
|
|
241
|
-
const { mapChildren, overlayChildren } = useMemo(() => {
|
|
242
|
-
const mapNodes: ReactNode[] = [];
|
|
243
|
-
const overlayNodes: ReactNode[] = [];
|
|
244
|
-
|
|
245
|
-
Children.forEach(children, (child) => {
|
|
246
|
-
if (!isValidElement(child)) return;
|
|
247
|
-
if (isMapComponent(child)) {
|
|
248
|
-
mapNodes.push(child);
|
|
249
|
-
} else {
|
|
250
|
-
overlayNodes.push(child);
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
return { mapChildren: mapNodes, overlayChildren: overlayNodes };
|
|
255
|
-
}, [children]);
|
|
256
|
-
|
|
257
|
-
const mapContainerStyle: ViewStyle = {
|
|
258
|
-
position: 'absolute',
|
|
259
|
-
top: padding?.top ?? 0,
|
|
260
|
-
left: padding?.left ?? 0,
|
|
261
|
-
right: padding?.right ?? 0,
|
|
262
|
-
bottom: padding?.bottom ?? 0,
|
|
263
|
-
};
|
|
264
|
-
|
|
265
230
|
const mapStyle: CSSProperties = {
|
|
266
|
-
|
|
267
|
-
|
|
231
|
+
paddingTop: padding?.top ?? 0,
|
|
232
|
+
paddingLeft: padding?.left ?? 0,
|
|
233
|
+
paddingRight: padding?.right ?? 0,
|
|
234
|
+
paddingBottom: padding?.bottom ?? 0,
|
|
268
235
|
};
|
|
269
236
|
|
|
270
237
|
return (
|
|
271
238
|
<MapIdContext.Provider value={id}>
|
|
272
239
|
<View style={style}>
|
|
273
|
-
<
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
</Map>
|
|
289
|
-
</View>
|
|
290
|
-
{overlayChildren}
|
|
240
|
+
<Map
|
|
241
|
+
id={id}
|
|
242
|
+
mapId={mapId}
|
|
243
|
+
defaultCenter={defaultCenter}
|
|
244
|
+
defaultZoom={initialZoom}
|
|
245
|
+
minZoom={minZoom}
|
|
246
|
+
maxZoom={maxZoom}
|
|
247
|
+
gestureHandling={gestureHandling}
|
|
248
|
+
disableDefaultUI
|
|
249
|
+
tilt={pitchEnabled === false ? 0 : undefined}
|
|
250
|
+
style={mapStyle}
|
|
251
|
+
>
|
|
252
|
+
<UserLocationMarker enabled={userLocationEnabled} />
|
|
253
|
+
{children}
|
|
254
|
+
</Map>
|
|
291
255
|
</View>
|
|
292
256
|
</MapIdContext.Provider>
|
|
293
257
|
);
|