| <!DOCTYPE html> |
| <html lang="de"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>GeoTrack Pro Navigator - Karte</title> |
| <link rel="manifest" href="manifest.json"> |
| <meta name="theme-color" content="#4F46E5"> |
| <link rel="icon" type="image/x-icon" href="/static/favicon.ico"> |
| <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"> |
| <script src="https://cdn.tailwindcss.com"></script> |
| <script src="https://unpkg.com/feather-icons"></script> |
| <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script> |
| <script src="https://unpkg.com/leaflet-elevation@1.0.2/dist/leaflet-elevation.min.js"></script> |
| <link rel="stylesheet" href="https://unpkg.com/leaflet-elevation@1.0.2/dist/leaflet-elevation.min.css"> |
| <script> |
| tailwind.config = { |
| darkMode: 'class', |
| theme: { |
| extend: { |
| colors: { |
| primary: { |
| 500: '#4F46E5', |
| }, |
| secondary: { |
| 500: '#10B981', |
| } |
| } |
| } |
| } |
| } |
| </script> |
| <style> |
| @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); |
| body { |
| font-family: 'Inter', sans-serif; |
| background-color: #0F172A; |
| color: #F1F5F9; |
| } |
| .glass { |
| background: rgba(30, 41, 59, 0.7); |
| backdrop-filter: blur(10px); |
| -webkit-backdrop-filter: blur(10px); |
| } |
| #map { |
| height: 70vh; |
| z-index: 1; |
| } |
| .elevation-control { |
| background: rgba(30, 41, 59, 0.9); |
| color: #F1F5F9; |
| } |
| .language-selector.active { |
| background-color: #4F46E5; |
| } |
| </style> |
| </head> |
| <body class="min-h-screen bg-gradient-to-br from-gray-900 to-gray-800 text-gray-100"> |
| |
| <header class="glass p-4 shadow-lg"> |
| <div class="container mx-auto flex justify-between items-center"> |
| <div class="flex items-center space-x-2"> |
| <a href="index.html" class="p-2 rounded-full hover:bg-gray-700 transition"> |
| <i data-feather="arrow-left"></i> |
| </a> |
| <h1 class="text-2xl font-bold" id="page-title">GeoTrack Pro Navigator</h1> |
| </div> |
| <div class="flex items-center space-x-4"> |
| |
| <div class="flex space-x-1 glass rounded-lg p-1"> |
| <button class="language-selector active px-3 py-1 rounded text-sm" data-lang="de">DE</button> |
| <button class="language-selector px-3 py-1 rounded text-sm" data-lang="en">EN</button> |
| <button class="language-selector px-3 py-1 rounded text-sm" data-lang="ru">RU</button> |
| </div> |
| <button class="p-2 rounded-full hover:bg-gray-700 transition"> |
| <i data-feather="settings"></i> |
| </button> |
| </div> |
| </div> |
| </header> |
|
|
| |
| <main class="container mx-auto p-4 mt-6"> |
| |
| <div class="glass rounded-xl p-4 shadow-xl mb-4"> |
| <div class="flex flex-wrap gap-4 justify-between items-center"> |
| <div class="flex flex-wrap gap-2"> |
| <button id="satellite-btn" class="px-4 py-2 bg-primary-500 hover:bg-primary-600 rounded-lg transition"> |
| <i data-feather="eye" class="mr-2"></i> |
| <span id="map-type-text">Satellitenkarte</span> |
| </button> |
| <button id="tracking-btn" class="px-4 py-2 bg-secondary-500 hover:bg-secondary-600 rounded-lg transition"> |
| <i data-feather="play" class="mr-2"></i> |
| <span id="tracking-text">Tracking starten</span> |
| </button> |
| <button id="add-marker-btn" class="px-4 py-2 bg-green-500 hover:bg-green-600 rounded-lg transition"> |
| <i data-feather="map-pin" class="mr-2"></i> |
| <span id="add-marker-text">Marker hinzufügen</span> |
| </button> |
| <button id="clear-markers-btn" class="px-4 py-2 bg-red-500 hover:bg-red-600 rounded-lg transition"> |
| <i data-feather="trash-2" class="mr-2"></i> |
| <span id="clear-markers-text">Alle löschen</span> |
| </button> |
| </div> |
| |
| <div class="mt-4 grid grid-cols-1 md:grid-cols-3 gap-4"> |
| <div class="bg-gray-800 rounded-lg p-3"> |
| <h3 class="font-bold mb-2" id="speed-title">Geschwindigkeit</h3> |
| <p class="text-2xl" id="speed-display">0 km/h</p> |
| </div> |
| <div class="bg-gray-800 rounded-lg p-3"> |
| <h3 class="font-bold mb-2" id="distance-title">Distanz</h3> |
| <p class="text-2xl" id="distance-display">0 km</p> |
| </div> |
| <div class="bg-gray-800 rounded-lg p-3"> |
| <h3 class="font-bold mb-2" id="time-title">Zeit</h3> |
| <p class="text-2xl" id="time-display">00:00</p> |
| </div> |
| </div> |
| </div> |
|
|
| |
| <div class="glass rounded-xl shadow-xl overflow-hidden"> |
| <div id="map"></div> |
| </div> |
|
|
| |
| <div class="glass rounded-xl p-4 shadow-xl mt-4"> |
| <h2 class="text-xl font-bold mb-4" id="elevation-title">Höhenprofil</h2> |
| <div id="elevation-div"></div> |
| </div> |
|
|
| |
| <div class="glass rounded-xl p-4 shadow-xl mt-4"> |
| <div class="flex justify-between items-center mb-4"> |
| <h2 class="text-xl font-bold" id="inventory-title">Inventar</h2> |
| <button id="add-inventory-btn" class="px-4 py-2 bg-primary-500 hover:bg-primary-600 rounded-lg transition"> |
| <i data-feather="plus" class="mr-2"></i> |
| <span id="add-inventory-text">Neues Inventar</span> |
| </button> |
| </div> |
| <div id="inventory-list" class="space-y-3"> |
| |
| </div> |
| </div> |
| </main> |
|
|
| |
| <div id="marker-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> |
| <div class="glass rounded-xl p-6 shadow-xl max-w-md w-full mx-4"> |
| <h3 class="text-xl font-bold mb-4" id="marker-modal-title">Marker hinzufügen</h3> |
| <div class="space-y-4"> |
| <div> |
| <label class="block mb-1" id="marker-name-label">Name</label> |
| <input type="text" id="marker-name" class="w-full bg-gray-800 border border-gray-700 rounded-lg p-3"> |
| </div> |
| <div> |
| <label class="block mb-1" id="marker-description-label">Beschreibung</label> |
| <textarea id="marker-description" class="w-full bg-gray-800 border border-gray-700 rounded-lg p-3" rows="3"></textarea> |
| </div> |
| <div> |
| <label class="block mb-1" id="marker-category-label">Kategorie</label> |
| <select id="marker-category" class="w-full bg-gray-800 border border-gray-700 rounded-lg p-3"> |
| <option value="waypoint">Wegpunkt</option> |
| <option value="inventory">Inventar</option> |
| <option value="photo">Foto-Stelle</option> |
| <option value="note">Notiz</option> |
| </select> |
| </div> |
| <div> |
| <label class="block mb-1" id="marker-image-label">Bild (URL)</label> |
| <input type="url" id="marker-image" class="w-full bg-gray-800 border border-gray-700 rounded-lg p-3" placeholder="https://..."> |
| </div> |
| <div class="flex space-x-3"> |
| <button id="save-marker-btn" class="flex-1 bg-primary-500 hover:bg-primary-600 rounded-lg p-3 transition"> |
| <span id="save-marker-text">Speichern</span> |
| </button> |
| <button id="cancel-marker-btn" class="flex-1 bg-gray-700 hover:bg-gray-600 rounded-lg p-3 transition"> |
| <span id="cancel-marker-text">Abbrechen</span> |
| </button> |
| </div> |
| </div> |
| </div> |
| </div> |
|
|
| <script> |
| // Language texts |
| const translations = { |
| de: { |
| title: "GeoTrack Pro Navigator", |
| satellite: "Satellitenkarte", |
| normal: "Standardkarte", |
| topographic: "Höhenkarte", |
| startTracking: "Tracking starten", |
| stopTracking: "Tracking stoppen", |
| addMarker: "Marker hinzufügen", |
| clearMarkers: "Alle löschen", |
| speed: "Geschwindigkeit", |
| distance: "Distanz", |
| time: "Zeit", |
| elevation: "Höhenprofil", |
| inventory: "Inventar", |
| addInventory: "Neues Inventar", |
| markerName: "Name", |
| markerDescription: "Beschreibung", |
| markerCategory: "Kategorie", |
| markerImage: "Bild (URL)", |
| saveMarker: "Speichern", |
| cancelMarker: "Abbrechen", |
| waypoint: "Wegpunkt", |
| inventory: "Inventar", |
| photo: "Foto-Stelle", |
| note: "Notiz" |
| }, |
| en: { |
| title: "GeoTrack Pro Navigator", |
| satellite: "Satellite Map", |
| normal: "Standard Map", |
| topographic: "Topographic Map", |
| startTracking: "Start Tracking", |
| stopTracking: "Stop Tracking", |
| addMarker: "Add Marker", |
| clearMarkers: "Clear All", |
| speed: "Speed", |
| distance: "Distance", |
| time: "Time", |
| elevation: "Elevation Profile", |
| inventory: "Inventory", |
| addInventory: "New Inventory", |
| markerName: "Name", |
| markerDescription: "Description", |
| markerCategory: "Category", |
| markerImage: "Image (URL)", |
| saveMarker: "Save", |
| cancelMarker: "Cancel", |
| waypoint: "Waypoint", |
| inventory: "Inventory", |
| photo: "Photo Spot", |
| note: "Note" |
| }, |
| ru: { |
| title: "GeoTrack Pro Навигатор", |
| satellite: "Спутниковая карта", |
| normal: "Стандартная карта", |
| topographic: "Топографическая карта", |
| startTracking: "Начать отслеживание", |
| stopTracking: "Остановить отслеживание", |
| addMarker: "Добавить маркер", |
| clearMarkers: "Очистить все", |
| speed: "Скорость", |
| distance: "Расстояние", |
| time: "Время", |
| elevation: "Профиль высоты", |
| inventory: "Инвентарь", |
| addInventory: "Новый инвентарь", |
| markerName: "Название", |
| markerDescription: "Описание", |
| markerCategory: "Категория", |
| markerImage: "Изображение (URL)", |
| saveMarker: "Сохранить", |
| cancelMarker: "Отмена", |
| waypoint: "Точка пути", |
| inventory: "Инвентарь", |
| photo: "Фото место", |
| note: "Заметка" |
| } |
| }; |
| |
| let currentLanguage = 'de'; |
| let map; |
| let trackLayer; |
| let markersLayer; |
| let trackingInterval; |
| let trackingActive = false; |
| let totalDistance = 0; |
| let startTime; |
| let positions = []; |
| |
| // Initialize map |
| function initMap() { |
| map = L.map('map').setView([52.5200, 13.4050], 13); // Berlin coordinates |
| |
| // Base layers |
| const osmLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
| attribution: '© OpenStreetMap contributors' |
| }); |
| |
| const satelliteLayer = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { |
| attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP' |
| }); |
| |
| const topographicLayer = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', { |
| attribution: 'Map data: © OpenStreetMap contributors, SRTM | Map style: © OpenTopoMap (CC-BY-SA)', { |
| maxZoom: 17 |
| }); |
| |
| // Add default layer |
| satelliteLayer.addTo(map); |
| |
| // Layer groups |
| trackLayer = L.layerGroup().addTo(map); |
| markersLayer = L.layerGroup().addTo(map); |
| |
| // Elevation control |
| const elevationControl = L.control.elevation({ |
| position: "topright", |
| theme: "lightblue-theme", |
| width: 300, |
| height: 150, |
| margins: { |
| top: 10, |
| right: 20, |
| bottom: 30, |
| left: 50 |
| }); |
| elevationControl.addTo(map); |
| } |
| |
| // Language switching |
| function switchLanguage(lang) { |
| currentLanguage = lang; |
| const texts = translations[lang]; |
| |
| // Update all text elements |
| document.getElementById('page-title').textContent = texts.title; |
| document.getElementById('map-type-text').textContent = texts.satellite; |
| document.getElementById('tracking-text').textContent = texts.startTracking; |
| document.getElementById('add-marker-text').textContent = texts.addMarker; |
| document.getElementById('clear-markers-text').textContent = texts.clearMarkers; |
| document.getElementById('speed-title').textContent = texts.speed; |
| document.getElementById('distance-title').textContent = texts.distance; |
| document.getElementById('time-title').textContent = texts.time; |
| document.getElementById('elevation-title').textContent = texts.elevation; |
| document.getElementById('inventory-title').textContent = texts.inventory; |
| document.getElementById('add-inventory-text').textContent = texts.addInventory; |
| document.getElementById('marker-modal-title').textContent = texts.addMarker; |
| document.getElementById('marker-name-label').textContent = texts.markerName; |
| document.getElementById('marker-description-label').textContent = texts.markerDescription; |
| document.getElementById('marker-category-label').textContent = texts.markerCategory; |
| document.getElementById('marker-image-label').textContent = texts.markerImage; |
| document.getElementById('save-marker-text').textContent = texts.saveMarker; |
| document.getElementById('cancel-marker-text').textContent = texts.cancelMarker; |
| } |
| |
| // Tracking functionality |
| function startTracking() { |
| if (!trackingActive) { |
| trackingActive = true; |
| startTime = new Date(); |
| totalDistance = 0; |
| positions = []; |
| |
| trackingInterval = setInterval(() => { |
| if (navigator.geolocation) { |
| navigator.geolocation.getCurrentPosition((position) => { |
| const lat = position.coords.latitude; |
| const lng = position.coords.longitude; |
| const speed = position.coords.speed || 0; |
| |
| positions.push([lat, lng]); |
| |
| // Calculate distance |
| if (positions.length > 1) { |
| const lastPos = positions[positions.length - 2]; |
| const currentPos = positions[positions.length - 1]; |
| |
| const distance = map.distance(lastPos, currentPos); |
| totalDistance += distance; |
| |
| // Update displays |
| document.getElementById('speed-display').textContent = |
| (speed * 3.6).toFixed(1) + (currentLanguage === 'ru' ? ' км/ч' : ' km/h'); |
| document.getElementById('distance-display').textContent = |
| (totalDistance / 1000).toFixed(2) + (currentLanguage === 'ru' ? ' км' : ' km'); |
| |
| const elapsed = Math.floor((new Date() - startTime) / 1000); |
| const minutes = Math.floor(elapsed / 60); |
| const seconds = elapsed % 60; |
| document.getElementById('time-display').textContent = |
| `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')'; |
| } |
| |
| // Update track line |
| if (trackLayer) { |
| trackLayer.clearLayers(); |
| L.polyline(positions, {color: '#10B981'}).addTo(trackLayer); |
| |
| // Update elevation profile |
| if (elevationControl && positions.length > 1) { |
| elevationControl.clear(); |
| elevationControl.addData(positions.map(pos => ({ |
| lat: pos[0], |
| lng: pos[1] |
| }))); |
| } |
| }); |
| } |
| }, 1000); |
| |
| document.getElementById('tracking-text').textContent = |
| translations[currentLanguage].stopTracking; |
| } else { |
| stopTracking(); |
| } |
| } |
| |
| function stopTracking() { |
| trackingActive = false; |
| clearInterval(trackingInterval); |
| document.getElementById('tracking-text').textContent = |
| translations[currentLanguage].startTracking; |
| } |
| |
| // Add marker functionality |
| function addMarker(lat, lng) { |
| const marker = L.marker([lat, lng]).addTo(markersLayer); |
| |
| marker.bindPopup(` |
| <div class="text-gray-800"> |
| <h4 class="font-bold">Neuer Marker</h4> |
| <p>Position: ${lat.toFixed(4)}, ${lng.toFixed(4)}</p> |
| <button onclick="editMarker(${lat}, ${lng})" class="mt-2 px-3 py-1 bg-primary-500 text-white rounded"> |
| ${translations[currentLanguage].saveMarker} |
| </button> |
| `); |
| |
| // Center map on marker |
| map.setView([lat, lng], 15); |
| } |
| |
| // Event listeners |
| document.addEventListener('DOMContentLoaded', function() { |
| initMap(); |
| feather.replace(); |
| |
| // Language switching |
| document.querySelectorAll('.language-selector').forEach(btn => { |
| btn.addEventListener('click', function() { |
| const lang = this.getAttribute('data-lang'); |
| document.querySelectorAll('.language-selector').forEach(b => b.classList.remove('active')); |
| this.classList.add('active'); |
| switchLanguage(lang); |
| }); |
| }); |
| |
| // Map type switching |
| document.getElementById('satellite-btn').addEventListener('click', function() { |
| const currentText = document.getElementById('map-type-text').textContent; |
| if (currentText.includes('Satellit') || currentText.includes('Satellite') || currentText.includes('Спутник')) { |
| // Switch to normal map |
| map.eachLayer((layer) => { |
| if (layer instanceof L.TileLayer) { |
| map.removeLayer(layer); |
| } |
| }); |
| L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map); |
| document.getElementById('map-type-text').textContent = translations[currentLanguage].normal; |
| } else if (currentText.includes('Standard') || currentText.includes('Normal') || currentText.includes('Стандарт')) { |
| // Switch to topographic map |
| map.eachLayer((layer) => { |
| if (layer instanceof L.TileLayer) { |
| map.removeLayer(layer); |
| } |
| }); |
| L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png').addTo(map); |
| document.getElementById('map-type-text').textContent = translations[currentLanguage].topographic; |
| } else { |
| // Switch to satellite map |
| map.eachLayer((layer) => { |
| if (layer instanceof L.TileLayer) { |
| map.removeLayer(layer); |
| } |
| }); |
| satelliteLayer.addTo(map); |
| document.getElementById('map-type-text').textContent = translations[currentLanguage].satellite; |
| } |
| }); |
| |
| // Tracking button |
| document.getElementById('tracking-btn').addEventListener('click', startTracking); |
| |
| // Add marker on map click |
| map.on('click', function(e) { |
| document.getElementById('marker-modal').classList.remove('hidden'); |
| // Store click coordinates for later use |
| window.lastClickCoords = e.latlng; |
| }); |
| |
| // Modal buttons |
| document.getElementById('save-marker-btn').addEventListener('click', function() { |
| const name = document.getElementById('marker-name').value; |
| const description = document.getElementById('marker-description').value; |
| const category = document.getElementById('marker-category').value; |
| const image = document.getElementById('marker-image').value; |
| |
| if (window.lastClickCoords) { |
| addMarker(window.lastClickCoords.lat, window.lastClickCoords.lng); |
| document.getElementById('marker-modal').classList.add('hidden'); |
| |
| // Add to inventory |
| addToInventory({ |
| name: name, |
| description: description, |
| category: category, |
| image: image, |
| lat: window.lastClickCoords.lat, |
| lng: window.lastClickCoords.lng, |
| date: new Date().toLocaleString() |
| }); |
| }); |
| |
| document.getElementById('cancel-marker-btn').addEventListener('click', function() { |
| document.getElementById('marker-modal').classList.add('hidden'); |
| }); |
| |
| // Clear markers |
| document.getElementById('clear-markers-btn').addEventListener('click', function() { |
| markersLayer.clearLayers(); |
| }); |
| }); |
| </script> |
| </body> |
| </html> |