mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
add Vite-based app for example TypeScript application
This commit is contained in:
26
app/public/examples/leaflet.html
Normal file
26
app/public/examples/leaflet.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
|
||||
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
||||
<script src="https://unpkg.com/pmtiles@1.0.0/dist/index.js"></script>
|
||||
<!-- <script src="../js/dist/index.js"></script> -->
|
||||
<style>
|
||||
body, #map {
|
||||
height:100vh;
|
||||
margin:0px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<script>
|
||||
const map = L.map('map',{maxZoom:4}).setView([0,0],0)
|
||||
const p = new pmtiles.PMTiles('osm_carto.pmtiles')
|
||||
pmtiles.leafletLayer(p,{attribution:'© <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'}).addTo(map)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user