From 436438220a3d3badfb8283ac90791a23aad751e9 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 4 Dec 2024 09:48:27 +0200 Subject: [PATCH] chore: small logic improvements to example app --- example/src/controls/navigationControls.tsx | 26 +++++++++++---------- example/src/styles.ts | 3 +++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/example/src/controls/navigationControls.tsx b/example/src/controls/navigationControls.tsx index aaf8060..59fb466 100644 --- a/example/src/controls/navigationControls.tsx +++ b/example/src/controls/navigationControls.tsx @@ -87,7 +87,7 @@ const NavigationControls: React.FC = ({ // single destination: const initWaypoint = async () => { if (!latitude.trim() || !longitude.trim()) { - Alert.alert('Invalid destination'); + Alert.alert('Set lat lng values first'); return; } const waypoint: Waypoint = { @@ -117,19 +117,16 @@ const NavigationControls: React.FC = ({ ); }; - const initWaypointToCameraLocation = async () => { + const setLocationFromCameraLocation = async () => { if (getCameraPosition) { const cameraPosition = await getCameraPosition(); if (cameraPosition) { onLatChanged(cameraPosition.target.lat.toString()); onLngChanged(cameraPosition.target.lng.toString()); } - await initWaypoint(); } }; - // multi destination: - // set your device (emulator) location to new new york timesquare const initWaypoints = async () => { const wp1 = { placeId: 'ChIJw____96GhYARCVVwg5cT7c0', // Golden gate, SF @@ -199,7 +196,7 @@ const NavigationControls: React.FC = ({ const simulateLocation = () => { if (!latitude.trim() || !longitude.trim()) { - Alert.alert('Invalid destination'); + Alert.alert('Set lat lng values first'); return; } @@ -330,6 +327,7 @@ const NavigationControls: React.FC = ({ return ( + Target = ({ placeholderTextColor="#000" keyboardType="numeric" /> -