From 4407d05fdb7ff02982101c28c5af73d5578a0ce2 Mon Sep 17 00:00:00 2001 From: mudabbir-ahmad Date: Thu, 9 Apr 2026 09:46:51 +0100 Subject: [PATCH] minor map change + creating new game handler fix update --- src/components/gameplay/PlayerMapView.js | 8 +++++--- src/components/screens/ExpandedMapScreen.js | 14 +++++++++----- src/components/screens/MapScreen.js | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/gameplay/PlayerMapView.js b/src/components/gameplay/PlayerMapView.js index 70eacf2..7718dfd 100644 --- a/src/components/gameplay/PlayerMapView.js +++ b/src/components/gameplay/PlayerMapView.js @@ -1,5 +1,5 @@ import React from 'react'; -import {Platform, StyleSheet, View} from 'react-native'; +import {StyleSheet, View} from 'react-native'; import MapView, {Marker, Polygon} from 'react-native-maps'; import {getFovCone} from '../../utils/geoMath'; @@ -28,14 +28,16 @@ const PlayerMapView = ({userLocation, visibleCaches, heading}) => { > {/* Cache pin markers — appear temporarily when the cache is in the FOV cone AND within claim distance. Uses a custom View so the pin - renders identically on iOS (Google Maps) and Android */} + renders identically on iOS (Google Maps) and Android. + tracksViewChanges must be true so Android captures the custom + View as a bitmap on the first render cycle. */} {(visibleCaches || []).map((cache) => ( diff --git a/src/components/screens/ExpandedMapScreen.js b/src/components/screens/ExpandedMapScreen.js index 6783678..ffeccf9 100644 --- a/src/components/screens/ExpandedMapScreen.js +++ b/src/components/screens/ExpandedMapScreen.js @@ -1,5 +1,5 @@ import React, {useEffect, useState} from 'react'; -import {Platform, StyleSheet, View} from 'react-native'; +import {StyleSheet, View} from 'react-native'; import MapView, {Circle, Marker, Polygon} from 'react-native-maps'; import * as Location from 'expo-location'; import Screen from '../layout/Screen'; @@ -86,14 +86,16 @@ const ExpandedMapScreen = ({route}) => { initialRegion={region} showsUserLocation > - {/* Admins see all cache pin locations */} + {/* Admins see all cache pin locations. + tracksViewChanges must be true so Android captures the + custom View as a bitmap on the first render cycle. */} {isAdmin && caches.map((cache) => ( @@ -107,14 +109,16 @@ const ExpandedMapScreen = ({route}) => { /> ))} - {/* Players — pin markers appear when cache is in FOV cone + within range */} + {/* Players — pin markers appear when cache is in FOV cone + within range. + tracksViewChanges must be true so Android captures the + custom View as a bitmap on the first render cycle. */} {!isAdmin && visiblePlayerCaches.map((cache) => ( diff --git a/src/components/screens/MapScreen.js b/src/components/screens/MapScreen.js index fb4dd55..c2f851b 100644 --- a/src/components/screens/MapScreen.js +++ b/src/components/screens/MapScreen.js @@ -207,7 +207,7 @@ const MapScreen = ({navigation}) => { setSessionUser(freshUser); setInGame(true); setIsAdmin(true); - navigation.navigate('GameSettingsScreen'); + navigation.reset({index: 0, routes: [{name: 'Admin'}]}); } };