facilmap/leaflet/icontest.html

46 wiersze
1.4 KiB
HTML
Czysty Zwykły widok Historia

2021-03-07 21:56:30 +00:00
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>facilmap-leaflet Example</title>
<style>
span {
display: inline-block;
height: 50px;
background: #faa;
margin: 5px;
}
#icons span {
width: 50px;
}
</style>
</head>
<body>
<script src="https://unpkg.com/leaflet"></script>
<!-- <script src="https://unpkg.com/socket.io-client/dist/socket.io.js"></script> -->
<script type="text/javascript" src="dist/facilmap-leaflet.full.js"></script>
<script type="text/javascript">
function createIcons(id, createIcon) {
const el = document.createElement("div");
el.id = id;
document.body.appendChild(el);
for (const icon of ["", "O", "g", "j", "a", "*", ...L.FacilMap.symbolList]) {
const span = document.createElement('span');
2021-03-13 23:54:10 +00:00
span.title = icon;
2021-03-07 21:56:30 +00:00
span.innerHTML = createIcon(icon);
el.appendChild(span);
}
}
2021-03-27 17:17:28 +00:00
createIcons("icons", (icon) => L.FacilMap.getSymbolHtml("#000000", 50, icon));
2021-04-10 19:59:20 +00:00
for (const shape of ["drop", "rectangle-marker", "circle", "rectangle", "diamond", "pentagon", "hexagon", "triangle", "triangle-down", "star"]) {
createIcons(`icons-${shape}`, (icon) => L.FacilMap.getMarkerHtml("#ccffcc", 50, icon, shape));
createIcons(`icons-${shape}-highlight`, (icon) => L.FacilMap.getMarkerHtml("#ccffcc", 50, icon, shape, true));
}
2021-03-07 21:56:30 +00:00
</script>
</body>
</html>