minor map change + creating new game handler fix update

This commit is contained in:
bobbert committed 2026-04-09 09:46:51 +01:00
1 parent fc378ae016
commit 4407d05fdb
3 files changed
+15 -9

No files matched your search

+5 -3
View File
@@ -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) => (
<Marker
key={cache.id}
coordinate={cache.coordinates}
title={cache.clue}
anchor={{x: 0.5, y: 0.5}}
tracksViewChanges={Platform.OS === 'ios'}
tracksViewChanges={true}
>
<View style={styles.markerOuter}>
<View style={styles.markerInner} />
+9 -5
View File
@@ -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) => (
<React.Fragment key={cache.id}>
<Marker
coordinate={cache.coordinates}
title={cache.name || cache.clue}
anchor={{x: 0.5, y: 0.5}}
tracksViewChanges={Platform.OS === 'ios'}
tracksViewChanges={true}
>
<View style={styles.adminMarkerOuter}>
<View style={styles.adminMarkerInner} />
@@ -107,14 +109,16 @@ const ExpandedMapScreen = ({route}) => {
/>
</React.Fragment>
))}
{/* 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) => (
<Marker
key={cache.id}
coordinate={cache.coordinates}
title={cache.clue}
anchor={{x: 0.5, y: 0.5}}
tracksViewChanges={Platform.OS === 'ios'}
tracksViewChanges={true}
>
<View style={styles.cacheMarkerOuter}>
<View style={styles.cacheMarkerInner} />
+1 -1
View File
@@ -207,7 +207,7 @@ const MapScreen = ({navigation}) => {
setSessionUser(freshUser);
setInGame(true);
setIsAdmin(true);
navigation.navigate('GameSettingsScreen');
navigation.reset({index: 0, routes: [{name: 'Admin'}]});
}
};