From 6c41bde5b16c3754d4577517b28d5765af3c064b Mon Sep 17 00:00:00 2001 From: artzha Date: Sun, 10 Nov 2024 18:53:38 -0600 Subject: [PATCH] Simplified gps initialization code --- webviz.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/webviz.html b/webviz.html index 2f3f6a8..ca09623 100644 --- a/webviz.html +++ b/webviz.html @@ -112,7 +112,7 @@

UT AUTOmata Web Interface

var coords = document.getElementById("coords"); var mapList = document.getElementById("map"); var robotPose = undefined; - var robotGPS = undefined; + var robotGPS = { lat: 30.285949, lng: -97.737157 }; // Example coordinates for initialization var gpsGoals = []; var tLastDraw = 0; var map = []; @@ -121,8 +121,7 @@

UT AUTOmata Web Interface

var currentMapName = ''; // Leaflet Map Initialization for OpenStreetMap - var robotGPSPose = { lat: 30.285949, lng: -97.737157 }; // Example coordinates for initialization - var osm_map = L.map('mapPanel').setView([robotGPSPose.lat, robotGPSPose.lng], 18); + var osm_map = L.map('mapPanel').setView([robotGPS.lat, robotGPS.lng], 18); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 20, attribution: '© OpenStreetMap contributors' @@ -988,7 +987,7 @@

UT AUTOmata Web Interface

html: `
`, iconSize: [10, 10], }); - console.log("goal:", goal); + // Create a marker and add it to the map const marker = L.marker([goal.lat, goal.lng], { icon }).addTo(osm_map); gpsGoalMarkers.push(marker); // Add marker to the global array