ordering-ui-react-native 0.22.47 → 0.22.48
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/package.json
CHANGED
|
@@ -378,8 +378,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
378
378
|
<>
|
|
379
379
|
<Marker
|
|
380
380
|
coordinate={{
|
|
381
|
-
latitude: destination
|
|
382
|
-
longitude: destination
|
|
381
|
+
latitude: typeof destination?.latitude !== 'object' ? destination?.latitude : 0,
|
|
382
|
+
longitude: typeof destination?.longitude !== 'object' ? destination?.latitude : 0
|
|
383
383
|
}}
|
|
384
384
|
title={location.title}>
|
|
385
385
|
<Icon
|
|
@@ -397,8 +397,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
397
397
|
</View>
|
|
398
398
|
</Marker>
|
|
399
399
|
<Marker coordinate={{
|
|
400
|
-
latitude: parsedUserLocation
|
|
401
|
-
longitude: parsedUserLocation
|
|
400
|
+
latitude: typeof parsedUserLocation?.latitude !== 'object' ? parsedUserLocation?.latitude : 0,
|
|
401
|
+
longitude: typeof parsedUserLocation?.longitude !== 'object' ? parsedUserLocation?.latitude : 0
|
|
402
402
|
}}>
|
|
403
403
|
<View style={styles.driverIcon}>
|
|
404
404
|
<OIcon
|
|
@@ -413,8 +413,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
413
413
|
) : (
|
|
414
414
|
<Marker
|
|
415
415
|
coordinate={{
|
|
416
|
-
latitude: parsedUserLocation
|
|
417
|
-
longitude: parsedUserLocation
|
|
416
|
+
latitude: typeof parsedUserLocation?.latitude !== 'object' ? parsedUserLocation?.latitude : 0,
|
|
417
|
+
longitude: typeof parsedUserLocation?.longitude !== 'object' ? parsedUserLocation?.latitude : 0
|
|
418
418
|
}}
|
|
419
419
|
title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
|
|
420
420
|
/>
|
|
@@ -55,10 +55,13 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
55
55
|
if (mapRef.current) {
|
|
56
56
|
mapRef.current.fitToCoordinates(
|
|
57
57
|
[
|
|
58
|
-
{ latitude: location.latitude ?? 0, longitude: location.longitude ?? 0},
|
|
59
58
|
{
|
|
60
|
-
latitude:
|
|
61
|
-
longitude:
|
|
59
|
+
latitude: typeof location?.latitude !== 'object' ? location?.latitude : 0,
|
|
60
|
+
longitude: typeof location?.longitude !== 'object' ? location?.latitude : 0
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
latitude: typeof userLocation?.latitude !== 'object' ? userLocation?.latitude : 0,
|
|
64
|
+
longitude: typeof userLocation?.longitude !== 'object' ? userLocation?.latitude : 0
|
|
62
65
|
},
|
|
63
66
|
],
|
|
64
67
|
{
|
|
@@ -133,8 +136,8 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
133
136
|
const RenderMarker = ({ marker, customer, orderIds }: { marker: any, customer?: boolean, orderIds?: Array<number> }) => {
|
|
134
137
|
const markerRef = useRef<any>()
|
|
135
138
|
|
|
136
|
-
let coordinateLat = (customer ? marker?.customer?.location?.lat : marker?.business?.location?.lat) ?? initialPosition?.latitude
|
|
137
|
-
let coordinateLng = (customer ? marker?.customer?.location?.lng : marker?.business?.location?.lng) ?? initialPosition?.longitude
|
|
139
|
+
let coordinateLat = (customer ? marker?.customer?.location?.lat || 0 : marker?.business?.location?.lat || 0) ?? (initialPosition?.latitude || 0)
|
|
140
|
+
let coordinateLng = (customer ? marker?.customer?.location?.lng || 0 : marker?.business?.location?.lng || 0) ?? (initialPosition?.longitude || 0)
|
|
138
141
|
|
|
139
142
|
useEffect(() => {
|
|
140
143
|
if (
|