tiles / index.html
Omnibus's picture
Update index.html
b9a367d verified
Raw
History Blame Contribute Delete
996 Bytes
<!DOCTYPE html>
<html>
<head>
<title>OSM Map on Hugging Face Spaces</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<style>
#map { height: 400px; } /* Adjust map height as needed */
</style>
</head>
<body>
<div id="map"></div>
<script>
// Replace placeholders with your Hugging Face dataset details
const tileUrl = 'https://huggingface.co/datasets/{username}/{dataset_name}/resolve/main/{z}/{x}/{y}.png';
const attribution = '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
// Initialize the map centered on a location (adjust coordinates as needed)
const map = L.map('map').setView([51.505, -0.09], 13); // Example: London
// Add the tile layer using your Hugging Face dataset URL
L.tileLayer(tileUrl, { attribution }).addTo(map);
</script>
</body>
</html>