Highly Styled Interactive Map - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Highly Styled Interactive Map</title> <link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" /> <style> body { margin: 0; font-family: 'Arial', sans-serif; background: #2c3e50; color: #ecf0f1; } #map { height: 100vh; width: 100vw; position: relative; } .leaflet-popup-content { font-size: 16px; font-weight: bold; display: flex; align-items: center; justify-content: center; } .leaflet-container { background: linear-gradient(135deg, #1abc9c, #3498db); border: 5px solid #2980b9; border-radius: 15px; box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); transition: all 0.5s ease; } .leaflet-container:hover { transform: scale(1.05); border-color: #e74c3c; box-shadow: 0 0 30px rgba(0, 0, 0, 0.8); } .leaflet-marker-icon { transition: transform 0.3s ease; } .leaflet-marker-icon:hover { transform: scale(1.5); } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); } 50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); } } .animated-bounce { animation: bounce 1s infinite; } .leaflet-control-attribution { display: none; } </style> </head> <body> <div id="map"></div> <script src="https://unpkg.com/leaflet/dist/leaflet.js"></script> <script> const map = L.map('map').setView([51.505, -0.09], 13); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '© OpenStreetMap' }).addTo(map); const emojiIcon = L.divIcon({ className: 'emoji-icon animated-bounce', html: '📍', iconSize: [30, 30], iconAnchor: [15, 30] }); L.marker([51.5, -0.09], { icon: emojiIcon }).addTo(map) .bindPopup('<div>📍 London</div>'); const customIcon = L.divIcon({ className: 'custom-icon animated-bounce', html: '<i class="fas fa-map-marker-alt" style="color: red; font-size: 30px;"></i>', iconSize: [30, 30], iconAnchor: [15, 30] }); L.marker([51.515, -0.1], { icon: customIcon }).addTo(map) .bindPopup('<div><i class="fas fa-map-marker-alt" style="color: red;"></i> Custom Icon</div>'); const circle = L.circle([51.508, -0.11], { color: '#e74c3c', fillColor: '#e74c3c', fillOpacity: 0.5, radius: 500 }).addTo(map); </script> <script src="https://kit.fontawesome.com/a076d05399.js"></script> </body> </html>