You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
leaflet-components/index.html

75 lines
2.4 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Leaflet Components Demo</title>
<style>
body {
margin: 0;
padding: 20px;
font-family: sans-serif;
}
leaflet-map {
height: 500px;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<h1>Leaflet Web Components</h1>
<leaflet-map lat="51.505" lng="-0.09" zoom="13">
<leaflet-tile-layer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution="&copy; <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors"
>
</leaflet-tile-layer>
<leaflet-marker lat="51.505" lng="-0.09" title="A Marker">
<leaflet-popup><b>Hello world!</b><br />I am a popup.</leaflet-popup>
<leaflet-tooltip>I am a tooltip</leaflet-tooltip>
</leaflet-marker>
<leaflet-circle
lat="51.508"
lng="-0.11"
color="red"
fill-color="#f03"
fill-opacity="0.5"
radius="500"
>
<leaflet-popup>I am a circle.</leaflet-popup>
</leaflet-circle>
<leaflet-polygon color="blue" fill-color="cyan" fill-opacity="0.3">
<leaflet-line lat="51.509" lng="-0.08"></leaflet-line>
<leaflet-line lat="51.503" lng="-0.06"></leaflet-line>
<leaflet-line lat="51.51" lng="-0.047"></leaflet-line>
<leaflet-popup>I am a polygon.</leaflet-popup>
</leaflet-polygon>
<leaflet-feature-group>
<leaflet-marker lat="51.513" lng="-0.07" title="Feature Group Marker">
<leaflet-tooltip>Part of a feature group</leaflet-tooltip>
</leaflet-marker>
<leaflet-circle lat="51.513" lng="-0.07" radius="100" color="purple" fill-color="purple" fill-opacity="0.2">
</leaflet-circle>
</leaflet-feature-group>
<leaflet-geojson
color="#e67e22"
weight="3"
fill-color="#f39c12"
fill-opacity="0.4"
data='{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-0.13,51.50],[-0.12,51.50],[-0.12,51.51],[-0.13,51.51],[-0.13,51.50]]]},"properties":{}}'
></leaflet-geojson>
<leaflet-control-scale position="bottomleft"></leaflet-control-scale>
</leaflet-map>
<!-- script type="module" src="./src/index.ts"></script -->
<script type="module" src="/dist/index.js"></script>
</body>
</html>