|
@@ -73,7 +73,7 @@ import { area } from '@turf/turf';
|
|
|
const defaultUserAvatar = require('assets/icon-user-share-location-solid.png');
|
|
const defaultUserAvatar = require('assets/icon-user-share-location-solid.png');
|
|
|
|
|
|
|
|
const generateFilter = (ids: number[]) => {
|
|
const generateFilter = (ids: number[]) => {
|
|
|
- return ids.length ? ['any', ...ids.map((id) => ['==', 'id', id])] : ['==', 'id', -1];
|
|
|
|
|
|
|
+ return ids.length ? ['any', ...ids.map((id) => ['==', ['get', 'id'], id])] : ['==', ['get', 'id'], -1];
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
let regions_visited = {
|
|
let regions_visited = {
|
|
@@ -81,10 +81,10 @@ let regions_visited = {
|
|
|
type: 'fill',
|
|
type: 'fill',
|
|
|
source: 'regions',
|
|
source: 'regions',
|
|
|
'source-layer': 'regions',
|
|
'source-layer': 'regions',
|
|
|
- style: {
|
|
|
|
|
- fillColor: 'rgba(255, 126, 0, 1)',
|
|
|
|
|
- fillOpacity: 0.5,
|
|
|
|
|
- fillOutlineColor: 'rgba(14, 80, 109, 0)'
|
|
|
|
|
|
|
+ paint: {
|
|
|
|
|
+ 'fill-color': 'rgba(255, 126, 0, 1)',
|
|
|
|
|
+ 'fill-opacity': 0.5,
|
|
|
|
|
+ 'fill-outline-color': 'rgba(14, 80, 109, 0)'
|
|
|
},
|
|
},
|
|
|
filter: generateFilter([]),
|
|
filter: generateFilter([]),
|
|
|
maxzoom: 12
|
|
maxzoom: 12
|
|
@@ -95,10 +95,10 @@ let countries_visited = {
|
|
|
type: 'fill',
|
|
type: 'fill',
|
|
|
source: 'countries',
|
|
source: 'countries',
|
|
|
'source-layer': 'countries',
|
|
'source-layer': 'countries',
|
|
|
- style: {
|
|
|
|
|
- fillColor: 'rgba(255, 126, 0, 1)',
|
|
|
|
|
- fillOpacity: 0.5,
|
|
|
|
|
- fillOutlineColor: 'rgba(14, 80, 109, 0)'
|
|
|
|
|
|
|
+ paint: {
|
|
|
|
|
+ 'fill-color': 'rgba(255, 126, 0, 1)',
|
|
|
|
|
+ 'fill-opacity': 0.5,
|
|
|
|
|
+ 'fill-outline-color': 'rgba(14, 80, 109, 0)'
|
|
|
},
|
|
},
|
|
|
filter: generateFilter([]),
|
|
filter: generateFilter([]),
|
|
|
maxzoom: 12
|
|
maxzoom: 12
|
|
@@ -109,10 +109,10 @@ let dare_visited = {
|
|
|
type: 'fill',
|
|
type: 'fill',
|
|
|
source: 'dare',
|
|
source: 'dare',
|
|
|
'source-layer': 'dare',
|
|
'source-layer': 'dare',
|
|
|
- style: {
|
|
|
|
|
- fillColor: 'rgba(255, 126, 0, 1)',
|
|
|
|
|
- fillOpacity: 0.5,
|
|
|
|
|
- fillOutlineColor: 'rgba(255, 126, 0, 1)'
|
|
|
|
|
|
|
+ paint: {
|
|
|
|
|
+ 'fill-color': 'rgba(255, 126, 0, 1)',
|
|
|
|
|
+ 'fill-opacity': 0.5,
|
|
|
|
|
+ 'fill-outline-color': 'rgba(255, 126, 0, 1)'
|
|
|
},
|
|
},
|
|
|
filter: generateFilter([]),
|
|
filter: generateFilter([]),
|
|
|
maxzoom: 12
|
|
maxzoom: 12
|
|
@@ -123,9 +123,9 @@ let regions = {
|
|
|
type: 'fill',
|
|
type: 'fill',
|
|
|
source: 'regions',
|
|
source: 'regions',
|
|
|
'source-layer': 'regions',
|
|
'source-layer': 'regions',
|
|
|
- style: {
|
|
|
|
|
- fillColor: 'rgba(15, 63, 79, 0)',
|
|
|
|
|
- fillOutlineColor: 'rgba(14, 80, 109, 0)'
|
|
|
|
|
|
|
+ paint: {
|
|
|
|
|
+ 'fill-color': 'rgba(15, 63, 79, 0)',
|
|
|
|
|
+ 'fill-outline-color': 'rgba(14, 80, 109, 0)'
|
|
|
},
|
|
},
|
|
|
filter: ['all'],
|
|
filter: ['all'],
|
|
|
maxzoom: 16
|
|
maxzoom: 16
|
|
@@ -136,9 +136,9 @@ let countries = {
|
|
|
type: 'fill',
|
|
type: 'fill',
|
|
|
source: 'countries',
|
|
source: 'countries',
|
|
|
'source-layer': 'countries',
|
|
'source-layer': 'countries',
|
|
|
- style: {
|
|
|
|
|
- fillColor: 'rgba(15, 63, 79, 0)',
|
|
|
|
|
- fillOutlineColor: 'rgba(14, 80, 109, 0)'
|
|
|
|
|
|
|
+ paint: {
|
|
|
|
|
+ 'fill-color': 'rgba(15, 63, 79, 0)',
|
|
|
|
|
+ 'fill-outline-color': 'rgba(14, 80, 109, 0)'
|
|
|
},
|
|
},
|
|
|
filter: ['all'],
|
|
filter: ['all'],
|
|
|
maxzoom: 16
|
|
maxzoom: 16
|
|
@@ -149,9 +149,9 @@ let dare = {
|
|
|
type: 'fill',
|
|
type: 'fill',
|
|
|
source: 'dare',
|
|
source: 'dare',
|
|
|
'source-layer': 'dare',
|
|
'source-layer': 'dare',
|
|
|
- style: {
|
|
|
|
|
- fillColor: 'rgba(14, 80, 109, 0.6)',
|
|
|
|
|
- fillOutlineColor: 'rgba(14, 80, 109, 1)'
|
|
|
|
|
|
|
+ paint: {
|
|
|
|
|
+ 'fill-color': 'rgba(14, 80, 109, 0.6)',
|
|
|
|
|
+ 'fill-outline-color': 'rgba(14, 80, 109, 1)'
|
|
|
},
|
|
},
|
|
|
filter: ['all'],
|
|
filter: ['all'],
|
|
|
maxzoom: 16
|
|
maxzoom: 16
|
|
@@ -162,8 +162,8 @@ let selected_region = {
|
|
|
type: 'fill',
|
|
type: 'fill',
|
|
|
source: 'regions',
|
|
source: 'regions',
|
|
|
'source-layer': 'regions',
|
|
'source-layer': 'regions',
|
|
|
- style: {
|
|
|
|
|
- fillColor: 'rgba(57, 115, 172, 0.3)'
|
|
|
|
|
|
|
+ paint: {
|
|
|
|
|
+ 'fill-color': 'rgba(57, 115, 172, 0.3)'
|
|
|
},
|
|
},
|
|
|
maxzoom: 12
|
|
maxzoom: 12
|
|
|
};
|
|
};
|
|
@@ -173,11 +173,11 @@ let selected_region_outline = {
|
|
|
type: 'line',
|
|
type: 'line',
|
|
|
source: 'regions',
|
|
source: 'regions',
|
|
|
'source-layer': 'regions',
|
|
'source-layer': 'regions',
|
|
|
- style: {
|
|
|
|
|
- lineColor: '#ED9334',
|
|
|
|
|
- lineTranslate: [0, 0],
|
|
|
|
|
- lineTranslateAnchor: 'map',
|
|
|
|
|
- lineWidth: ['interpolate', ['linear'], ['zoom'], 0, 2, 4, 3, 5, 4, 12, 5]
|
|
|
|
|
|
|
+ paint: {
|
|
|
|
|
+ 'line-color': '#ED9334',
|
|
|
|
|
+ 'line-translate': [0, 0],
|
|
|
|
|
+ 'line-translate-anchor': 'map',
|
|
|
|
|
+ 'line-width': ['interpolate', ['linear'], ['zoom'], 0, 2, 4, 3, 5, 4, 12, 5]
|
|
|
},
|
|
},
|
|
|
maxzoom: 12
|
|
maxzoom: 12
|
|
|
};
|
|
};
|
|
@@ -202,7 +202,7 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
year: moment().year()
|
|
year: moment().year()
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- const mapRef = useRef<MapLibreRN.MapViewRef>(null);
|
|
|
|
|
|
|
+ const mapRef = useRef<MapLibreRN.MapRef>(null);
|
|
|
const cameraRef = useRef<MapLibreRN.CameraRef>(null);
|
|
const cameraRef = useRef<MapLibreRN.CameraRef>(null);
|
|
|
const animationTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
|
const animationTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
|
|
const isAnimatingRef = useRef(false);
|
|
const isAnimatingRef = useRef(false);
|
|
@@ -295,11 +295,10 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (coordinates) {
|
|
if (coordinates) {
|
|
|
- cameraRef.current?.setCamera({
|
|
|
|
|
- centerCoordinate: coordinates,
|
|
|
|
|
- zoomLevel: 10,
|
|
|
|
|
- animationDuration: 1000,
|
|
|
|
|
- animationMode: 'flyTo'
|
|
|
|
|
|
|
+ cameraRef.current?.flyTo({
|
|
|
|
|
+ center: coordinates as [number, number],
|
|
|
|
|
+ zoom: 10,
|
|
|
|
|
+ duration: 1000
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
setSelectedMarker({
|
|
setSelectedMarker({
|
|
@@ -379,14 +378,14 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
if (Platform.OS === 'android') {
|
|
if (Platform.OS === 'android') {
|
|
|
setRenderCamera(true);
|
|
setRenderCamera(true);
|
|
|
requestAnimationFrame(() => {
|
|
requestAnimationFrame(() => {
|
|
|
- cameraRef.current?.flyTo(coordinates, duration);
|
|
|
|
|
|
|
+ cameraRef.current?.flyTo({ center: coordinates as [number, number], duration });
|
|
|
});
|
|
});
|
|
|
animationTimeoutRef.current = setTimeout(() => {
|
|
animationTimeoutRef.current = setTimeout(() => {
|
|
|
isAnimatingRef.current = false;
|
|
isAnimatingRef.current = false;
|
|
|
setRenderCamera(false);
|
|
setRenderCamera(false);
|
|
|
}, duration + 200);
|
|
}, duration + 200);
|
|
|
} else {
|
|
} else {
|
|
|
- cameraRef.current?.flyTo(coordinates, duration);
|
|
|
|
|
|
|
+ cameraRef.current?.flyTo({ center: coordinates as [number, number], duration });
|
|
|
animationTimeoutRef.current = setTimeout(() => {
|
|
animationTimeoutRef.current = setTimeout(() => {
|
|
|
isAnimatingRef.current = false;
|
|
isAnimatingRef.current = false;
|
|
|
}, duration + 100);
|
|
}, duration + 100);
|
|
@@ -397,10 +396,27 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
if (animationTimeoutRef.current) {
|
|
if (animationTimeoutRef.current) {
|
|
|
clearTimeout(animationTimeoutRef.current);
|
|
clearTimeout(animationTimeoutRef.current);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ const v11Config = {
|
|
|
|
|
+ center: config.centerCoordinate as [number, number],
|
|
|
|
|
+ zoom: config.zoomLevel,
|
|
|
|
|
+ duration: config.animationDuration
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const executeCamera = () => {
|
|
|
|
|
+ if (config.animationMode === 'flyTo') {
|
|
|
|
|
+ cameraRef.current?.flyTo(v11Config);
|
|
|
|
|
+ } else if (config.animationMode === 'easeTo') {
|
|
|
|
|
+ cameraRef.current?.easeTo(v11Config);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cameraRef.current?.jumpTo(v11Config);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
if (Platform.OS === 'android') {
|
|
if (Platform.OS === 'android') {
|
|
|
setRenderCamera(true);
|
|
setRenderCamera(true);
|
|
|
requestAnimationFrame(() => {
|
|
requestAnimationFrame(() => {
|
|
|
- cameraRef.current?.setCamera(config);
|
|
|
|
|
|
|
+ executeCamera();
|
|
|
});
|
|
});
|
|
|
animationTimeoutRef.current = setTimeout(
|
|
animationTimeoutRef.current = setTimeout(
|
|
|
() => {
|
|
() => {
|
|
@@ -410,7 +426,7 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
(config.animationDuration ?? 1000) + 200
|
|
(config.animationDuration ?? 1000) + 200
|
|
|
);
|
|
);
|
|
|
} else {
|
|
} else {
|
|
|
- cameraRef.current?.setCamera(config);
|
|
|
|
|
|
|
+ executeCamera();
|
|
|
animationTimeoutRef.current = setTimeout(
|
|
animationTimeoutRef.current = setTimeout(
|
|
|
() => {
|
|
() => {
|
|
|
isAnimatingRef.current = false;
|
|
isAnimatingRef.current = false;
|
|
@@ -431,7 +447,7 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
setRenderCamera(true);
|
|
setRenderCamera(true);
|
|
|
|
|
|
|
|
requestAnimationFrame(() => {
|
|
requestAnimationFrame(() => {
|
|
|
- cameraRef.current?.fitBounds(ne, sw, padding, duration);
|
|
|
|
|
|
|
+ cameraRef.current?.fitBounds([sw[0], sw[1], ne[0], ne[1]], { padding: { top: padding[0], right: padding[1], bottom: padding[2], left: padding[3] }, duration });
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
animationTimeoutRef.current = setTimeout(() => {
|
|
animationTimeoutRef.current = setTimeout(() => {
|
|
@@ -439,7 +455,7 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
setRenderCamera(false);
|
|
setRenderCamera(false);
|
|
|
}, duration + 200);
|
|
}, duration + 200);
|
|
|
} else {
|
|
} else {
|
|
|
- cameraRef.current?.fitBounds(ne, sw, padding, duration);
|
|
|
|
|
|
|
+ cameraRef.current?.fitBounds([sw[0], sw[1], ne[0], ne[1]], { padding: { top: padding[0], right: padding[1], bottom: padding[2], left: padding[3] }, duration });
|
|
|
|
|
|
|
|
animationTimeoutRef.current = setTimeout(() => {
|
|
animationTimeoutRef.current = setTimeout(() => {
|
|
|
isAnimatingRef.current = false;
|
|
isAnimatingRef.current = false;
|
|
@@ -485,7 +501,7 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
if (visitedRegionIds) {
|
|
if (visitedRegionIds) {
|
|
|
setRegionsVisitedFilter(generateFilter(visitedRegionIds.ids));
|
|
setRegionsVisitedFilter(generateFilter(visitedRegionIds.ids));
|
|
|
} else {
|
|
} else {
|
|
|
- setRegionsVisitedFilter(['==', 'id', -1]);
|
|
|
|
|
|
|
+ setRegionsVisitedFilter(['==', ['get', 'id'], -1]);
|
|
|
}
|
|
}
|
|
|
}, [visitedRegionIds]);
|
|
}, [visitedRegionIds]);
|
|
|
|
|
|
|
@@ -493,7 +509,7 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
if (visitedCountryIds) {
|
|
if (visitedCountryIds) {
|
|
|
setCountriesVisitedFilter(generateFilter(visitedCountryIds.ids));
|
|
setCountriesVisitedFilter(generateFilter(visitedCountryIds.ids));
|
|
|
} else {
|
|
} else {
|
|
|
- setCountriesVisitedFilter(['==', 'id', -1]);
|
|
|
|
|
|
|
+ setCountriesVisitedFilter(['==', ['get', 'id'], -1]);
|
|
|
}
|
|
}
|
|
|
}, [visitedCountryIds]);
|
|
}, [visitedCountryIds]);
|
|
|
|
|
|
|
@@ -501,7 +517,7 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
if (visitedDareIds) {
|
|
if (visitedDareIds) {
|
|
|
setDareVisitedFilter(generateFilter(visitedDareIds.ids));
|
|
setDareVisitedFilter(generateFilter(visitedDareIds.ids));
|
|
|
} else {
|
|
} else {
|
|
|
- setDareVisitedFilter(['==', 'id', -1]);
|
|
|
|
|
|
|
+ setDareVisitedFilter(['==', ['get', 'id'], -1]);
|
|
|
}
|
|
}
|
|
|
}, [visitedDareIds]);
|
|
}, [visitedDareIds]);
|
|
|
|
|
|
|
@@ -744,13 +760,12 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
if (selectedMarker) setSelectedMarker(null);
|
|
if (selectedMarker) setSelectedMarker(null);
|
|
|
if (type === 'blank') return;
|
|
if (type === 'blank') return;
|
|
|
try {
|
|
try {
|
|
|
- const { screenPointX, screenPointY } = event.properties;
|
|
|
|
|
- const [lng, lat] = event.geometry?.coordinates;
|
|
|
|
|
|
|
+ const { point: screenPoint } = event.nativeEvent;
|
|
|
|
|
+ const [lng, lat] = event.nativeEvent.lngLat;
|
|
|
|
|
|
|
|
- const { features } = await mapRef.current.queryRenderedFeaturesAtPoint(
|
|
|
|
|
- [screenPointX, screenPointY],
|
|
|
|
|
- undefined,
|
|
|
|
|
- ['regions', 'countries', 'dare']
|
|
|
|
|
|
|
+ const features = await mapRef.current.queryRenderedFeatures(
|
|
|
|
|
+ screenPoint,
|
|
|
|
|
+ { filter: undefined, layers: ['regions', 'countries', 'dare'] }
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
if (features?.length) {
|
|
if (features?.length) {
|
|
@@ -890,12 +905,12 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
<SafeAreaView style={{ height: '100%' }}>
|
|
<SafeAreaView style={{ height: '100%' }}>
|
|
|
<StatusBar translucent backgroundColor="transparent" />
|
|
<StatusBar translucent backgroundColor="transparent" />
|
|
|
|
|
|
|
|
- <MapLibreRN.MapView
|
|
|
|
|
|
|
+ <MapLibreRN.Map
|
|
|
ref={mapRef}
|
|
ref={mapRef}
|
|
|
style={styles.map}
|
|
style={styles.map}
|
|
|
mapStyle={VECTOR_MAP_HOST + '/nomadmania-maps2025.json'}
|
|
mapStyle={VECTOR_MAP_HOST + '/nomadmania-maps2025.json'}
|
|
|
- rotateEnabled={false}
|
|
|
|
|
- attributionEnabled={false}
|
|
|
|
|
|
|
+ touchRotate={false}
|
|
|
|
|
+ attribution={false}
|
|
|
onPress={onMapPress}
|
|
onPress={onMapPress}
|
|
|
onRegionDidChange={() => {
|
|
onRegionDidChange={() => {
|
|
|
hideTimer.current = setTimeout(() => {
|
|
hideTimer.current = setTimeout(() => {
|
|
@@ -905,146 +920,161 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
onRegionWillChange={_.debounce(handleMapChange, 200)}
|
|
onRegionWillChange={_.debounce(handleMapChange, 200)}
|
|
|
>
|
|
>
|
|
|
<>
|
|
<>
|
|
|
- <MapLibreRN.LineLayer
|
|
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="line"
|
|
|
id="nm-regions-line-layer"
|
|
id="nm-regions-line-layer"
|
|
|
- sourceID={regions.source}
|
|
|
|
|
- sourceLayerID={regions['source-layer']}
|
|
|
|
|
|
|
+ source={regions.source}
|
|
|
|
|
+ source-layer={regions['source-layer']}
|
|
|
filter={regions.filter as any}
|
|
filter={regions.filter as any}
|
|
|
- maxZoomLevel={regions.maxzoom}
|
|
|
|
|
- style={{
|
|
|
|
|
- lineColor: 'rgba(14, 80, 109, 1)',
|
|
|
|
|
- lineWidth: ['interpolate', ['linear'], ['zoom'], 0, 0.2, 4, 1, 5, 1.5, 12, 3],
|
|
|
|
|
- lineWidthTransition: { duration: 300, delay: 0 },
|
|
|
|
|
|
|
+ maxzoom={regions.maxzoom}
|
|
|
|
|
+ paint={{
|
|
|
|
|
+ 'line-color': 'rgba(14, 80, 109, 1)',
|
|
|
|
|
+ 'line-width': ['interpolate', ['linear'], ['zoom'], 0, 0.2, 4, 1, 5, 1.5, 12, 3],
|
|
|
|
|
+ 'line-width-transition': { duration: 300, delay: 0 }
|
|
|
|
|
+ }}
|
|
|
|
|
+ layout={{
|
|
|
visibility: type === 'regions' ? 'visible' : 'none'
|
|
visibility: type === 'regions' ? 'visible' : 'none'
|
|
|
}}
|
|
}}
|
|
|
- belowLayerID="waterway-name"
|
|
|
|
|
|
|
+ beforeId="waterway-name"
|
|
|
/>
|
|
/>
|
|
|
- <MapLibreRN.FillLayer
|
|
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="fill"
|
|
|
id={regions.id}
|
|
id={regions.id}
|
|
|
- sourceID={regions.source}
|
|
|
|
|
- sourceLayerID={regions['source-layer']}
|
|
|
|
|
|
|
+ source={regions.source}
|
|
|
|
|
+ source-layer={regions['source-layer']}
|
|
|
filter={regions.filter as any}
|
|
filter={regions.filter as any}
|
|
|
- style={{
|
|
|
|
|
- ...regions.style,
|
|
|
|
|
|
|
+ paint={regions.paint}
|
|
|
|
|
+ layout={{
|
|
|
visibility: type === 'regions' ? 'visible' : 'none'
|
|
visibility: type === 'regions' ? 'visible' : 'none'
|
|
|
}}
|
|
}}
|
|
|
- maxZoomLevel={regions.maxzoom}
|
|
|
|
|
- belowLayerID={regions_visited.id}
|
|
|
|
|
|
|
+ maxzoom={regions.maxzoom}
|
|
|
|
|
+ beforeId={regions_visited.id}
|
|
|
/>
|
|
/>
|
|
|
- <MapLibreRN.FillLayer
|
|
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="fill"
|
|
|
id={regions_visited.id}
|
|
id={regions_visited.id}
|
|
|
- sourceID={regions_visited.source}
|
|
|
|
|
- sourceLayerID={regions_visited['source-layer']}
|
|
|
|
|
|
|
+ source={regions_visited.source}
|
|
|
|
|
+ source-layer={regions_visited['source-layer']}
|
|
|
filter={regionsVisitedFilter as any}
|
|
filter={regionsVisitedFilter as any}
|
|
|
- style={{
|
|
|
|
|
- ...regions_visited.style,
|
|
|
|
|
|
|
+ paint={regions_visited.paint}
|
|
|
|
|
+ layout={{
|
|
|
visibility: type === 'regions' ? 'visible' : 'none'
|
|
visibility: type === 'regions' ? 'visible' : 'none'
|
|
|
}}
|
|
}}
|
|
|
- maxZoomLevel={regions_visited.maxzoom}
|
|
|
|
|
- belowLayerID="waterway-name"
|
|
|
|
|
|
|
+ maxzoom={regions_visited.maxzoom}
|
|
|
|
|
+ beforeId="waterway-name"
|
|
|
/>
|
|
/>
|
|
|
</>
|
|
</>
|
|
|
|
|
|
|
|
<>
|
|
<>
|
|
|
- <MapLibreRN.LineLayer
|
|
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="line"
|
|
|
id="countries-line-layer"
|
|
id="countries-line-layer"
|
|
|
- sourceID={countries.source}
|
|
|
|
|
- sourceLayerID={countries['source-layer']}
|
|
|
|
|
|
|
+ source={countries.source}
|
|
|
|
|
+ source-layer={countries['source-layer']}
|
|
|
filter={countries.filter as any}
|
|
filter={countries.filter as any}
|
|
|
- maxZoomLevel={countries.maxzoom}
|
|
|
|
|
- style={{
|
|
|
|
|
- lineColor: 'rgba(14, 80, 109, 1)',
|
|
|
|
|
- lineWidth: ['interpolate', ['linear'], ['zoom'], 0, 0.2, 4, 1, 5, 1.5, 12, 3],
|
|
|
|
|
- lineWidthTransition: { duration: 300, delay: 0 },
|
|
|
|
|
|
|
+ maxzoom={countries.maxzoom}
|
|
|
|
|
+ paint={{
|
|
|
|
|
+ 'line-color': 'rgba(14, 80, 109, 1)',
|
|
|
|
|
+ 'line-width': ['interpolate', ['linear'], ['zoom'], 0, 0.2, 4, 1, 5, 1.5, 12, 3],
|
|
|
|
|
+ 'line-width-transition': { duration: 300, delay: 0 }
|
|
|
|
|
+ }}
|
|
|
|
|
+ layout={{
|
|
|
visibility: type === 'countries' ? 'visible' : 'none'
|
|
visibility: type === 'countries' ? 'visible' : 'none'
|
|
|
}}
|
|
}}
|
|
|
- belowLayerID="waterway-name"
|
|
|
|
|
|
|
+ beforeId="waterway-name"
|
|
|
/>
|
|
/>
|
|
|
- <MapLibreRN.FillLayer
|
|
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="fill"
|
|
|
id={countries.id}
|
|
id={countries.id}
|
|
|
- sourceID={countries.source}
|
|
|
|
|
- sourceLayerID={countries['source-layer']}
|
|
|
|
|
|
|
+ source={countries.source}
|
|
|
|
|
+ source-layer={countries['source-layer']}
|
|
|
filter={countries.filter as any}
|
|
filter={countries.filter as any}
|
|
|
- style={{
|
|
|
|
|
- ...countries.style,
|
|
|
|
|
|
|
+ paint={countries.paint}
|
|
|
|
|
+ layout={{
|
|
|
visibility: type === 'countries' ? 'visible' : 'none'
|
|
visibility: type === 'countries' ? 'visible' : 'none'
|
|
|
}}
|
|
}}
|
|
|
- maxZoomLevel={countries.maxzoom}
|
|
|
|
|
- belowLayerID={countries_visited.id}
|
|
|
|
|
|
|
+ maxzoom={countries.maxzoom}
|
|
|
|
|
+ beforeId={countries_visited.id}
|
|
|
/>
|
|
/>
|
|
|
- <MapLibreRN.FillLayer
|
|
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="fill"
|
|
|
id={countries_visited.id}
|
|
id={countries_visited.id}
|
|
|
- sourceID={countries_visited.source}
|
|
|
|
|
- sourceLayerID={countries_visited['source-layer']}
|
|
|
|
|
|
|
+ source={countries_visited.source}
|
|
|
|
|
+ source-layer={countries_visited['source-layer']}
|
|
|
filter={countriesVisitedFilter as any}
|
|
filter={countriesVisitedFilter as any}
|
|
|
- style={{
|
|
|
|
|
- ...countries_visited.style,
|
|
|
|
|
|
|
+ paint={countries_visited.paint}
|
|
|
|
|
+ layout={{
|
|
|
visibility: type === 'countries' ? 'visible' : 'none'
|
|
visibility: type === 'countries' ? 'visible' : 'none'
|
|
|
}}
|
|
}}
|
|
|
- maxZoomLevel={countries_visited.maxzoom}
|
|
|
|
|
- belowLayerID="waterway-name"
|
|
|
|
|
|
|
+ maxzoom={countries_visited.maxzoom}
|
|
|
|
|
+ beforeId="waterway-name"
|
|
|
/>
|
|
/>
|
|
|
</>
|
|
</>
|
|
|
|
|
|
|
|
<>
|
|
<>
|
|
|
- <MapLibreRN.FillLayer
|
|
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="fill"
|
|
|
id={dare.id}
|
|
id={dare.id}
|
|
|
- sourceID={dare.source}
|
|
|
|
|
- sourceLayerID={dare['source-layer']}
|
|
|
|
|
|
|
+ source={dare.source}
|
|
|
|
|
+ source-layer={dare['source-layer']}
|
|
|
filter={dare.filter as any}
|
|
filter={dare.filter as any}
|
|
|
- style={{
|
|
|
|
|
- ...dare.style,
|
|
|
|
|
|
|
+ paint={dare.paint}
|
|
|
|
|
+ layout={{
|
|
|
visibility: type === 'dare' ? 'visible' : 'none'
|
|
visibility: type === 'dare' ? 'visible' : 'none'
|
|
|
}}
|
|
}}
|
|
|
- maxZoomLevel={dare.maxzoom}
|
|
|
|
|
- belowLayerID={dare_visited.id}
|
|
|
|
|
|
|
+ maxzoom={dare.maxzoom}
|
|
|
|
|
+ beforeId={dare_visited.id}
|
|
|
/>
|
|
/>
|
|
|
- <MapLibreRN.FillLayer
|
|
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="fill"
|
|
|
id={dare_visited.id}
|
|
id={dare_visited.id}
|
|
|
- sourceID={dare_visited.source}
|
|
|
|
|
- sourceLayerID={dare_visited['source-layer']}
|
|
|
|
|
|
|
+ source={dare_visited.source}
|
|
|
|
|
+ source-layer={dare_visited['source-layer']}
|
|
|
filter={dareVisitedFilter as any}
|
|
filter={dareVisitedFilter as any}
|
|
|
- style={{
|
|
|
|
|
- ...dare_visited.style,
|
|
|
|
|
|
|
+ paint={dare_visited.paint}
|
|
|
|
|
+ layout={{
|
|
|
visibility: type === 'dare' ? 'visible' : 'none'
|
|
visibility: type === 'dare' ? 'visible' : 'none'
|
|
|
}}
|
|
}}
|
|
|
- maxZoomLevel={dare_visited.maxzoom}
|
|
|
|
|
- belowLayerID="waterway-name"
|
|
|
|
|
|
|
+ maxzoom={dare_visited.maxzoom}
|
|
|
|
|
+ beforeId="waterway-name"
|
|
|
/>
|
|
/>
|
|
|
</>
|
|
</>
|
|
|
|
|
|
|
|
{selectedRegion && type && (
|
|
{selectedRegion && type && (
|
|
|
<>
|
|
<>
|
|
|
- <MapLibreRN.FillLayer
|
|
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="fill"
|
|
|
id={selected_region.id}
|
|
id={selected_region.id}
|
|
|
- sourceID={type}
|
|
|
|
|
- sourceLayerID={type}
|
|
|
|
|
- filter={['==', 'id', selectedRegion]}
|
|
|
|
|
- style={selected_region.style}
|
|
|
|
|
- maxZoomLevel={selected_region.maxzoom}
|
|
|
|
|
- belowLayerID="waterway-name"
|
|
|
|
|
|
|
+ source={type}
|
|
|
|
|
+ source-layer={type}
|
|
|
|
|
+ filter={['==', ['get', 'id'], selectedRegion]}
|
|
|
|
|
+ paint={selected_region.paint}
|
|
|
|
|
+ maxzoom={selected_region.maxzoom}
|
|
|
|
|
+ beforeId="waterway-name"
|
|
|
/>
|
|
/>
|
|
|
- <MapLibreRN.LineLayer
|
|
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="line"
|
|
|
id={selected_region_outline.id}
|
|
id={selected_region_outline.id}
|
|
|
- sourceID={type}
|
|
|
|
|
- sourceLayerID={type}
|
|
|
|
|
- filter={['==', 'id', selectedRegion]}
|
|
|
|
|
- style={selected_region_outline.style as any}
|
|
|
|
|
- maxZoomLevel={selected_region_outline.maxzoom}
|
|
|
|
|
- belowLayerID="waterway-name"
|
|
|
|
|
|
|
+ source={type}
|
|
|
|
|
+ source-layer={type}
|
|
|
|
|
+ filter={['==', ['get', 'id'], selectedRegion]}
|
|
|
|
|
+ paint={selected_region_outline.paint as any}
|
|
|
|
|
+ maxzoom={selected_region_outline.maxzoom}
|
|
|
|
|
+ beforeId="waterway-name"
|
|
|
/>
|
|
/>
|
|
|
</>
|
|
</>
|
|
|
)}
|
|
)}
|
|
|
|
|
|
|
|
{data.location_sharing && data.location_last_seen_location && data.own_profile !== 1 && (
|
|
{data.location_sharing && data.location_last_seen_location && data.own_profile !== 1 && (
|
|
|
- <MapLibreRN.ShapeSource id="user_location" shape={locationFeature}>
|
|
|
|
|
- <MapLibreRN.SymbolLayer
|
|
|
|
|
|
|
+ <MapLibreRN.GeoJSONSource id="user_location" data={locationFeature}>
|
|
|
|
|
+ <MapLibreRN.Layer
|
|
|
|
|
+ type="symbol"
|
|
|
id="user_symbol"
|
|
id="user_symbol"
|
|
|
filter={['!', ['has', 'point_count']]}
|
|
filter={['!', ['has', 'point_count']]}
|
|
|
- aboveLayerID={Platform.OS === 'android' ? 'place-continent' : undefined}
|
|
|
|
|
- style={{
|
|
|
|
|
- iconImage: defaultUserAvatar,
|
|
|
|
|
- iconSize: [
|
|
|
|
|
|
|
+ afterId={Platform.OS === 'android' ? 'place-continent' : undefined}
|
|
|
|
|
+ layout={{
|
|
|
|
|
+ 'icon-image': defaultUserAvatar,
|
|
|
|
|
+ 'icon-size': [
|
|
|
'interpolate',
|
|
'interpolate',
|
|
|
['linear'],
|
|
['linear'],
|
|
|
['zoom'],
|
|
['zoom'],
|
|
@@ -1059,17 +1089,16 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
20,
|
|
20,
|
|
|
0.42
|
|
0.42
|
|
|
],
|
|
],
|
|
|
- iconAllowOverlap: true
|
|
|
|
|
|
|
+ 'icon-allow-overlap': true
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
- </MapLibreRN.ShapeSource>
|
|
|
|
|
|
|
+ </MapLibreRN.GeoJSONSource>
|
|
|
)}
|
|
)}
|
|
|
|
|
|
|
|
{(Platform.OS === 'ios' || renderCamera) && <MapLibreRN.Camera ref={cameraRef} />}
|
|
{(Platform.OS === 'ios' || renderCamera) && <MapLibreRN.Camera ref={cameraRef} />}
|
|
|
{location && (
|
|
{location && (
|
|
|
<MapLibreRN.UserLocation
|
|
<MapLibreRN.UserLocation
|
|
|
- showsUserHeadingIndicator={true}
|
|
|
|
|
- visible={true}
|
|
|
|
|
|
|
+ heading={true}
|
|
|
></MapLibreRN.UserLocation>
|
|
></MapLibreRN.UserLocation>
|
|
|
)}
|
|
)}
|
|
|
{selectedMarker && (
|
|
{selectedMarker && (
|
|
@@ -1082,7 +1111,7 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
token={token}
|
|
token={token}
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
- </MapLibreRN.MapView>
|
|
|
|
|
|
|
+ </MapLibreRN.Map>
|
|
|
|
|
|
|
|
{center ? (
|
|
{center ? (
|
|
|
<ScaleBar zoom={zoom} latitude={center[1]} isVisible={isZooming} bottom={80} />
|
|
<ScaleBar zoom={zoom} latitude={center[1]} isVisible={isZooming} bottom={80} />
|
|
@@ -1299,3 +1328,4 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default UsersMapScreen;
|
|
export default UsersMapScreen;
|
|
|
|
|
+
|