|
@@ -416,6 +416,8 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
const [isZooming, setIsZooming] = useState(true);
|
|
|
const hideTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
|
|
|
|
+ const [markerCoords, setMarkerCoords] = useState<any>(null);
|
|
|
+
|
|
|
const isSmallScreen = Dimensions.get('window').width < 383;
|
|
|
const processedImages = useRef(new Set<string>());
|
|
|
|
|
@@ -614,6 +616,22 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
}, [seriesVisited, seriesFilter]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
+ if (route.params?.lon && route.params?.lat) {
|
|
|
+ setMarkerCoords([route.params.lon, route.params.lat]);
|
|
|
+ const timeoutId = setTimeout(() => {
|
|
|
+ if (cameraRef.current) {
|
|
|
+ cameraRef.current.setCamera({
|
|
|
+ centerCoordinate: [route.params?.lon, route.params?.lat],
|
|
|
+ zoomLevel: 15,
|
|
|
+ animationDuration: 800
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ console.warn('Camera ref is not available.');
|
|
|
+ }
|
|
|
+ }, 800);
|
|
|
+
|
|
|
+ return () => clearTimeout(timeoutId);
|
|
|
+ }
|
|
|
if (route.params?.id && route.params?.type && db1 && db2 && db3) {
|
|
|
handleFindRegion(route.params?.id, route.params?.type);
|
|
|
}
|
|
@@ -1239,6 +1257,21 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
<View />
|
|
|
</MapLibreRN.Images>
|
|
|
|
|
|
+ {markerCoords && (
|
|
|
+ <MapLibreRN.PointAnnotation id="marker" coordinate={markerCoords}>
|
|
|
+ <View
|
|
|
+ style={{
|
|
|
+ height: 24,
|
|
|
+ width: 24,
|
|
|
+ backgroundColor: Colors.ORANGE,
|
|
|
+ borderRadius: 12,
|
|
|
+ borderColor: Colors.WHITE,
|
|
|
+ borderWidth: 2
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </MapLibreRN.PointAnnotation>
|
|
|
+ )}
|
|
|
+
|
|
|
{type === 'regions' && (
|
|
|
<>
|
|
|
<MapLibreRN.LineLayer
|