data transform first approach

This commit is contained in:
concierge committed 2026-10-19 22:19:20 +02:00
1 parent 638102d095
commit 0ce24cabe1
8 files changed
+64131 -28

No files matched your search

+56
View File
@@ -34,6 +34,50 @@
<div id="map" style="width: 600px; height: 400px;"></div>
<script>
var Kennedyallee_18 = [
[50.7024044, 7.1522011],
[50.7024193, 7.152445],
[50.7025108, 7.152652],
[50.7026283, 7.1529199],
[50.7027407, 7.1532263],
[50.7028256, 7.1534808],
[50.7029354, 7.1538683],
[50.7030046, 7.1541476],
[50.703052, 7.1543684],
[50.7030948, 7.1545908],
[50.7031075, 7.1546643],
[50.7031221, 7.1547482],
[50.7031414, 7.1548639],
[50.7031773, 7.1550791],
[50.7032251, 7.155402],
[50.7032586, 7.1556214],
[50.7032865, 7.1558294],
[50.7033214, 7.1561731],
[50.7033291, 7.1562563],
[50.7033347, 7.1563181],
[50.7033544, 7.1565642],
[50.7033639, 7.1567531],
[50.7033734, 7.1570199],
[50.7033753, 7.1572494],
[50.7033735, 7.1576616],
[50.7033566, 7.1580302],
[50.703345, 7.1582227],
[50.7033307, 7.158379],
[50.7033174, 7.1585524],
[50.7032707, 7.1589466],
[50.7032079, 7.1593587],
[50.7031844, 7.1594936],
[50.7031701, 7.1596051],
[50.7031391, 7.1597899],
[50.7030517, 7.1602379],
[50.7029535, 7.1607034],
[50.7028796, 7.1610266],
[50.7028348, 7.1612158],
[50.7028103, 7.1613202],
[50.7027092, 7.1617351],
[50.7026355, 7.1619778],
];
function getPixelsFor10Meters(map, latlng) {
var meters = 10;
@@ -56,6 +100,7 @@
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
/**
const marker = L.marker([51.5, -0.09]).addTo(map)
.bindPopup('<b>Hello world!</b><br />I am a popup.').openPopup();
@@ -87,14 +132,25 @@
map.on('click', onMapClick);
**/
// 2. Create the polyline and style it
var polyline = L.polyline(Kennedyallee_18, {
color: 'yellow',
weight: 10,
opacity: 0.7
}).addTo(map);
function onZoom(e) {
// Anwendung:
console.log("10 m in pixel:");
var pixelCount = getPixelsFor10Meters(map, map.getCenter());
console.log(pixelCount);
polyline.setStyle( { weight: 5*pixelCount });
}
map.on('zoom', onZoom);
map.fitBounds(polyline.getBounds());
</script>