remove extra logging

This commit is contained in:
Graham McIntire 2025-06-16 15:27:27 -05:00
parent 389f8aa5ed
commit 8afe282156
No known key found for this signature in database

View file

@ -3,10 +3,6 @@
let MinimalAPRSMap = { let MinimalAPRSMap = {
mounted() { mounted() {
console.log("MinimalAPRSMap hook mounted");
console.log("Element:", this.el);
console.log("Element dataset:", this.el.dataset);
// Initialize error tracking // Initialize error tracking
this.errors = []; this.errors = [];
this.initializationAttempts = 0; this.initializationAttempts = 0;
@ -17,9 +13,6 @@ let MinimalAPRSMap = {
attemptInitialization() { attemptInitialization() {
this.initializationAttempts++; this.initializationAttempts++;
console.log(
`Initialization attempt ${this.initializationAttempts}/${this.maxInitializationAttempts}`,
);
// Check if Leaflet is available // Check if Leaflet is available
if (typeof L === "undefined") { if (typeof L === "undefined") {
@ -27,7 +20,6 @@ let MinimalAPRSMap = {
this.errors.push("Leaflet library not available"); this.errors.push("Leaflet library not available");
if (this.initializationAttempts < this.maxInitializationAttempts) { if (this.initializationAttempts < this.maxInitializationAttempts) {
console.log("Retrying initialization in 1 second...");
setTimeout(() => this.attemptInitialization(), 1000); setTimeout(() => this.attemptInitialization(), 1000);
return; return;
} else { } else {
@ -61,28 +53,20 @@ let MinimalAPRSMap = {
if (isNaN(initialZoom) || initialZoom < 1 || initialZoom > 20) { if (isNaN(initialZoom) || initialZoom < 1 || initialZoom > 20) {
throw new Error("Invalid zoom data"); throw new Error("Invalid zoom data");
} }
console.log("Parsed data - center:", initialCenter, "zoom:", initialZoom);
} catch (error) { } catch (error) {
console.error("Error parsing map data attributes:", error); console.error("Error parsing map data attributes:", error);
console.log("Raw center data:", this.el.dataset.center);
console.log("Raw zoom data:", this.el.dataset.zoom);
// Fallback values // Fallback values
initialCenter = { lat: 39.8283, lng: -98.5795 }; initialCenter = { lat: 39.8283, lng: -98.5795 };
initialZoom = 5; initialZoom = 5;
console.log("Using fallback values:", initialCenter, initialZoom);
} }
this.initializeMap(initialCenter, initialZoom); this.initializeMap(initialCenter, initialZoom);
}, },
initializeMap(initialCenter, initialZoom) { initializeMap(initialCenter, initialZoom) {
console.log("Initializing minimal map with center:", initialCenter, "and zoom:", initialZoom);
// Check element dimensions // Check element dimensions
const rect = this.el.getBoundingClientRect(); const rect = this.el.getBoundingClientRect();
console.log("Map element dimensions:", rect);
// Validate element has dimensions // Validate element has dimensions
if (rect.width === 0 || rect.height === 0) { if (rect.width === 0 || rect.height === 0) {
@ -105,7 +89,6 @@ let MinimalAPRSMap = {
attributionControl: true, attributionControl: true,
closePopupOnClick: true, closePopupOnClick: true,
}).setView([initialCenter.lat, initialCenter.lng], initialZoom); }).setView([initialCenter.lat, initialCenter.lng], initialZoom);
console.log("Map initialized successfully");
} catch (error) { } catch (error) {
console.error("Error initializing map:", error); console.error("Error initializing map:", error);
this.errors.push("Map initialization failed: " + error.message); this.errors.push("Map initialization failed: " + error.message);
@ -173,9 +156,6 @@ let MinimalAPRSMap = {
// If zoom changed significantly (more than 2 levels), clear and reload // If zoom changed significantly (more than 2 levels), clear and reload
if (zoomDifference > 2) { if (zoomDifference > 2) {
console.log(
`Large zoom change detected (${zoomDifference} levels), clearing and reloading markers`,
);
this.pushEvent("clear_and_reload_markers", {}); this.pushEvent("clear_and_reload_markers", {});
} }
@ -293,8 +273,6 @@ let MinimalAPRSMap = {
return; return;
} }
console.log("Zooming map to:", lat, lng, "at zoom level:", zoom);
try { try {
// Check element dimensions before zoom // Check element dimensions before zoom
const beforeRect = this.el.getBoundingClientRect(); const beforeRect = this.el.getBoundingClientRect();
@ -313,7 +291,6 @@ let MinimalAPRSMap = {
// Check element dimensions after zoom // Check element dimensions after zoom
setTimeout(() => { setTimeout(() => {
const afterRect = this.el.getBoundingClientRect(); const afterRect = this.el.getBoundingClientRect();
console.log("Element dimensions after zoom:", afterRect);
if (afterRect.width === 0 || afterRect.height === 0) { if (afterRect.width === 0 || afterRect.height === 0) {
console.error("Map element lost dimensions after zoom!"); console.error("Map element lost dimensions after zoom!");
@ -377,7 +354,6 @@ let MinimalAPRSMap = {
const bounds = this.map.getBounds(); const bounds = this.map.getBounds();
this.removeMarkersOutsideBounds(bounds); this.removeMarkersOutsideBounds(bounds);
} }
console.log("Refresh markers event received - cleaned up out-of-bounds markers");
}); });
// Handle clearing historical packets // Handle clearing historical packets
@ -406,7 +382,6 @@ let MinimalAPRSMap = {
// Handle clearing all markers and reloading visible ones // Handle clearing all markers and reloading visible ones
this.handleEvent("clear_and_reload_markers", () => { this.handleEvent("clear_and_reload_markers", () => {
console.log("Clear and reload markers event received");
// This event is just a trigger - the server will handle clearing and adding markers // This event is just a trigger - the server will handle clearing and adding markers
}); });
}, },
@ -591,8 +566,6 @@ let MinimalAPRSMap = {
// Remove out-of-bounds markers // Remove out-of-bounds markers
markersToRemove.forEach((id) => this.removeMarker(id)); markersToRemove.forEach((id) => this.removeMarker(id));
console.log(`Removed ${markersToRemove.length} markers outside bounds`);
}, },
createMarkerIcon(data) { createMarkerIcon(data) {
@ -665,8 +638,6 @@ let MinimalAPRSMap = {
}, },
destroyed() { destroyed() {
console.log("MinimalAPRSMap hook destroyed");
// Clean up timers // Clean up timers
if (this.boundsTimer) { if (this.boundsTimer) {
clearTimeout(this.boundsTimer); clearTimeout(this.boundsTimer);