mirror of
https://github.com/mudabbir-ahmad/MAD-Treasure-Hunt.git
synced 2026-10-07 19:00:20 +00:00
minor map change + creating new game handler fix update
This commit is contained in:
1 parent
fc378ae016
commit
4407d05fdb
3 files changed
+15
-9
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
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 MapView, {Marker, Polygon} from 'react-native-maps';
|
||||||
import {getFovCone} from '../../utils/geoMath';
|
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
|
{/* Cache pin markers — appear temporarily when the cache is in the FOV
|
||||||
cone AND within claim distance. Uses a custom View so the pin
|
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) => (
|
{(visibleCaches || []).map((cache) => (
|
||||||
<Marker
|
<Marker
|
||||||
key={cache.id}
|
key={cache.id}
|
||||||
coordinate={cache.coordinates}
|
coordinate={cache.coordinates}
|
||||||
title={cache.clue}
|
title={cache.clue}
|
||||||
anchor={{x: 0.5, y: 0.5}}
|
anchor={{x: 0.5, y: 0.5}}
|
||||||
tracksViewChanges={Platform.OS === 'ios'}
|
tracksViewChanges={true}
|
||||||
>
|
>
|
||||||
<View style={styles.markerOuter}>
|
<View style={styles.markerOuter}>
|
||||||
<View style={styles.markerInner} />
|
<View style={styles.markerInner} />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, {useEffect, useState} from 'react';
|
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 MapView, {Circle, Marker, Polygon} from 'react-native-maps';
|
||||||
import * as Location from 'expo-location';
|
import * as Location from 'expo-location';
|
||||||
import Screen from '../layout/Screen';
|
import Screen from '../layout/Screen';
|
||||||
@@ -86,14 +86,16 @@ const ExpandedMapScreen = ({route}) => {
|
|||||||
initialRegion={region}
|
initialRegion={region}
|
||||||
showsUserLocation
|
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) => (
|
{isAdmin && caches.map((cache) => (
|
||||||
<React.Fragment key={cache.id}>
|
<React.Fragment key={cache.id}>
|
||||||
<Marker
|
<Marker
|
||||||
coordinate={cache.coordinates}
|
coordinate={cache.coordinates}
|
||||||
title={cache.name || cache.clue}
|
title={cache.name || cache.clue}
|
||||||
anchor={{x: 0.5, y: 0.5}}
|
anchor={{x: 0.5, y: 0.5}}
|
||||||
tracksViewChanges={Platform.OS === 'ios'}
|
tracksViewChanges={true}
|
||||||
>
|
>
|
||||||
<View style={styles.adminMarkerOuter}>
|
<View style={styles.adminMarkerOuter}>
|
||||||
<View style={styles.adminMarkerInner} />
|
<View style={styles.adminMarkerInner} />
|
||||||
@@ -107,14 +109,16 @@ const ExpandedMapScreen = ({route}) => {
|
|||||||
/>
|
/>
|
||||||
</React.Fragment>
|
</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) => (
|
{!isAdmin && visiblePlayerCaches.map((cache) => (
|
||||||
<Marker
|
<Marker
|
||||||
key={cache.id}
|
key={cache.id}
|
||||||
coordinate={cache.coordinates}
|
coordinate={cache.coordinates}
|
||||||
title={cache.clue}
|
title={cache.clue}
|
||||||
anchor={{x: 0.5, y: 0.5}}
|
anchor={{x: 0.5, y: 0.5}}
|
||||||
tracksViewChanges={Platform.OS === 'ios'}
|
tracksViewChanges={true}
|
||||||
>
|
>
|
||||||
<View style={styles.cacheMarkerOuter}>
|
<View style={styles.cacheMarkerOuter}>
|
||||||
<View style={styles.cacheMarkerInner} />
|
<View style={styles.cacheMarkerInner} />
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ const MapScreen = ({navigation}) => {
|
|||||||
setSessionUser(freshUser);
|
setSessionUser(freshUser);
|
||||||
setInGame(true);
|
setInGame(true);
|
||||||
setIsAdmin(true);
|
setIsAdmin(true);
|
||||||
navigation.navigate('GameSettingsScreen');
|
navigation.reset({index: 0, routes: [{name: 'Admin'}]});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user