|
@@ -83,10 +83,6 @@ import MapButton from 'src/components/MapButton';
|
|
import { useAvatarStore } from 'src/stores/avatarVersionStore';
|
|
import { useAvatarStore } from 'src/stores/avatarVersionStore';
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
import ScaleBar from 'src/components/ScaleBar';
|
|
import ScaleBar from 'src/components/ScaleBar';
|
|
-// import {
|
|
|
|
-// startBackgroundLocationUpdates,
|
|
|
|
-// stopBackgroundLocationUpdates
|
|
|
|
-// } from 'src/utils/backgroundLocation';
|
|
|
|
|
|
|
|
const defaultUserAvatar = require('assets/icon-user-share-location-solid.png');
|
|
const defaultUserAvatar = require('assets/icon-user-share-location-solid.png');
|
|
const logo = require('assets/logo-ua.png');
|
|
const logo = require('assets/logo-ua.png');
|
|
@@ -625,24 +621,9 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
) {
|
|
) {
|
|
setShowNomads(false);
|
|
setShowNomads(false);
|
|
storage.set('showNomads', false);
|
|
storage.set('showNomads', false);
|
|
- // await stopBackgroundLocationUpdates();
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- // const bgStatus = await Location.getBackgroundPermissionsAsync();
|
|
|
|
- // if (bgStatus.status !== 'granted') {
|
|
|
|
- // const { status } = await Location.requestBackgroundPermissionsAsync();
|
|
|
|
- // if (status === Location.PermissionStatus.GRANTED) {
|
|
|
|
- // await startBackgroundLocationUpdates();
|
|
|
|
- // console.log('[Permissions] Background granted');
|
|
|
|
- // } else {
|
|
|
|
- // console.log('[Permissions] Background denied');
|
|
|
|
- // }
|
|
|
|
- // } else {
|
|
|
|
- // await startBackgroundLocationUpdates();
|
|
|
|
- // console.log('[Permissions] Background already granted');
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
try {
|
|
try {
|
|
let currentLocation = await Location.getCurrentPositionAsync({
|
|
let currentLocation = await Location.getCurrentPositionAsync({
|
|
accuracy: Location.Accuracy.Balanced
|
|
accuracy: Location.Accuracy.Balanced
|
|
@@ -913,19 +894,6 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
|
|
|
if (status === 'granted' && isServicesEnabled) {
|
|
if (status === 'granted' && isServicesEnabled) {
|
|
await getLocation();
|
|
await getLocation();
|
|
- // const bgStatus = await Location.getBackgroundPermissionsAsync();
|
|
|
|
- // if (bgStatus.status !== 'granted') {
|
|
|
|
- // const { status } = await Location.requestBackgroundPermissionsAsync();
|
|
|
|
- // if (status === Location.PermissionStatus.GRANTED) {
|
|
|
|
- // await startBackgroundLocationUpdates();
|
|
|
|
- // console.log('[Permissions] Background granted');
|
|
|
|
- // } else {
|
|
|
|
- // console.log('[Permissions] Background denied');
|
|
|
|
- // }
|
|
|
|
- // } else {
|
|
|
|
- // await startBackgroundLocationUpdates();
|
|
|
|
- // console.log('[Permissions] Background already granted');
|
|
|
|
- // }
|
|
|
|
} else if (!canAskAgain || !isServicesEnabled) {
|
|
} else if (!canAskAgain || !isServicesEnabled) {
|
|
setOpenSettingsVisible(true);
|
|
setOpenSettingsVisible(true);
|
|
} else {
|
|
} else {
|
|
@@ -1199,7 +1167,7 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
<MapLibreGL.MapView
|
|
<MapLibreGL.MapView
|
|
ref={mapRef}
|
|
ref={mapRef}
|
|
style={styles.map}
|
|
style={styles.map}
|
|
- styleJSON={VECTOR_MAP_HOST + '/nomadmania-maps.json'}
|
|
|
|
|
|
+ mapStyle={VECTOR_MAP_HOST + '/nomadmania-maps.json'}
|
|
rotateEnabled={false}
|
|
rotateEnabled={false}
|
|
attributionEnabled={false}
|
|
attributionEnabled={false}
|
|
onPress={onMapPress}
|
|
onPress={onMapPress}
|