Przeglądaj źródła

android disabled map animation + cache fix

Viktoriia 1 dzień temu
rodzic
commit
cd697f9f53

+ 7 - 5
src/screens/InAppScreens/MessagesScreen/Components/MessageLocation.tsx

@@ -1,5 +1,5 @@
 import React, { useRef } from 'react';
-import { View, TouchableOpacity, StyleSheet } from 'react-native';
+import { View, TouchableOpacity, StyleSheet, Platform } from 'react-native';
 import * as MapLibreRN from '@maplibre/maplibre-react-native';
 import { useNavigation } from '@react-navigation/native';
 import { Colors } from 'src/theme';
@@ -39,10 +39,12 @@ const MessageLocation = ({
         zoomEnabled={false}
         pitchEnabled={false}
       >
-        <MapLibreRN.Camera
-          ref={cameraRef}
-          defaultSettings={{ centerCoordinate: [lng, lat], zoomLevel: 10 }}
-        />
+        {Platform.OS === 'ios' && (
+          <MapLibreRN.Camera
+            ref={cameraRef}
+            defaultSettings={{ centerCoordinate: [lng, lat], zoomLevel: 10 }}
+          />
+        )}
         <MapLibreRN.MarkerView coordinate={[lng, lat]}>
           <View
             style={{

+ 2 - 2
src/screens/InAppScreens/MessagesScreen/Components/RouteB.tsx

@@ -1,5 +1,5 @@
 import React, { useEffect, useRef, useState } from 'react';
-import { StyleSheet, View } from 'react-native';
+import { StyleSheet, View, Platform } from 'react-native';
 import * as Location from 'expo-location';
 import * as MapLibreRN from '@maplibre/maplibre-react-native';
 import { SheetManager, useSheetRouteParams, useSheetRouter } from 'react-native-actions-sheet';
@@ -114,7 +114,7 @@ const RouteB = () => {
           attributionEnabled={false}
           onRegionDidChange={handleRegionChange}
         >
-          <MapLibreRN.Camera ref={cameraRef} />
+          {Platform.OS === 'ios' && <MapLibreRN.Camera ref={cameraRef} />}
           {currentLocation && (
             <MapLibreRN.PointAnnotation
               id="currentLocation"

+ 8 - 5
src/screens/InAppScreens/MessagesScreen/FullMapScreen/index.tsx

@@ -6,7 +6,8 @@ import {
   TouchableOpacity,
   ActivityIndicator,
   Platform,
-  Linking
+  Linking,
+  Platform
 } from 'react-native';
 import * as MapLibreRN from '@maplibre/maplibre-react-native';
 import * as Location from 'expo-location';
@@ -157,10 +158,12 @@ const FullMapScreen = ({ route }: { route: any }) => {
         onRegionIsChanging={handleMapChange}
         onRegionWillChange={_.debounce(handleMapChange, 200)}
       >
-        <MapLibreRN.Camera
-          ref={cameraRef}
-          defaultSettings={{ centerCoordinate: [lng, lat], zoomLevel: 12 }}
-        />
+        {Platform.OS === 'ios' && (
+          <MapLibreRN.Camera
+            ref={cameraRef}
+            defaultSettings={{ centerCoordinate: [lng, lat], zoomLevel: 12 }}
+          />
+        )}
         <MapLibreRN.MarkerView coordinate={[lng, lat]}>
           <View style={styles.marker} />
         </MapLibreRN.MarkerView>

+ 2 - 1
src/screens/InAppScreens/ProfileScreen/ShareScreen/index.tsx

@@ -47,7 +47,8 @@ const PreviewScreen = ({ route }: { route: any }) => {
               <Image
                 style={styles.usersMap}
                 source={{
-                  uri: `${API_HOST}/img/single_maps/${data.id}.png?random=${Date.now()}`
+                  uri: `${API_HOST}/img/single_maps/${data.id}.png?random=${Date.now()}`,
+                  cache: 'reload'
                 }}
                 resizeMode="cover"
               />

+ 1 - 1
src/screens/InAppScreens/ProfileScreen/UsersMap/index.tsx

@@ -501,7 +501,7 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
           </MapLibreRN.ShapeSource>
         )}
 
-        <MapLibreRN.Camera ref={cameraRef} />
+        {Platform.OS === 'ios' && <MapLibreRN.Camera ref={cameraRef} />}
         {location && (
           <MapLibreRN.UserLocation
             animated={true}

+ 1 - 1
src/screens/InAppScreens/TravelsScreen/AddRegionsScreen/index.tsx

@@ -294,7 +294,7 @@ const AddRegionsScreen = ({ route }: { route: any }) => {
           attributionEnabled={false}
           onPress={handleMapPress}
         >
-          <MapLibreRN.Camera ref={cameraRef} />
+          {Platform.OS === 'ios' && <MapLibreRN.Camera ref={cameraRef} />}
 
           <MapLibreRN.LineLayer
             id="nm-regions-line-layer"

+ 1 - 1
src/screens/OfflineMapsScreen/SelectRegionsScreen/index.tsx

@@ -475,7 +475,7 @@ export const SelectRegionScreen = ({ navigation }: { navigation: any }) => {
           attributionEnabled={false}
           onPress={handleMapPress}
         >
-          <MapLibreRN.Camera ref={cameraRef} />
+          {Platform.OS === 'ios' && <MapLibreRN.Camera ref={cameraRef} />}
 
           <MapLibreRN.LineLayer
             id="nm-regions-line-layer"