Skip to content

Commit

Permalink
set 2022 as default selection
Browse files Browse the repository at this point in the history
  • Loading branch information
joergreichert committed Nov 8, 2023
1 parent cbdbfd0 commit 56a6160
Show file tree
Hide file tree
Showing 7 changed files with 290 additions and 14 deletions.
6 changes: 3 additions & 3 deletions docs/08_leaflet_stadtteil_einwohner.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@
if (karte) {
var eigenschaften = ereignis.layer.feature.properties
var ortsteilName = eigenschaften.Name
var einwohnerAnzahl2020 = Array.from(einwohner.daten).find(function (datenSatz) {
var einwohnerAnzahl2022 = Array.from(einwohner.daten).find(function (datenSatz) {
return datenSatz.ortsteil == ortsteilName
&& datenSatz.name == 'Einwohner insgesamt'
&& datenSatz.jahr == 2020;
&& datenSatz.jahr == 2022;
}).wert;
var inhalt = "<h3>" + ortsteilName + "</h3>Einwohner 2020: " + einwohnerAnzahl2020;
var inhalt = "<h3>" + ortsteilName + "</h3>Einwohner 2022: " + einwohnerAnzahl2022;
geojsonEbenenHover = L.popup()
.setLatLng(hoverKoordinaten)
.setContent(inhalt)
Expand Down
2 changes: 1 addition & 1 deletion docs/09_d3js_stadtteil_einwohner.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</ul>
</p>
<p>
<h4>Entwicklung der Einwohneranzahl für Leipzig Zentrum-Süd von 2000 bis 2020</h4>
<h4>Entwicklung der Einwohneranzahl für Leipzig Zentrum-Süd von 2000 bis 2022</h4>
<div id="Diagramm"></div>
</p>
<script>
Expand Down
2 changes: 1 addition & 1 deletion docs/10_leaflet_stadtteil_einwohner_interaktiv.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
Array.from(einwohner.daten)
.filter(function (datenSatz) {
return datenSatz.name == 'Einwohner insgesamt'
&& datenSatz.jahr == 2020;
&& datenSatz.jahr == 2022;
})
.forEach(function (datenSatz) {
if (datenSatz.ortsteil != null) {
Expand Down
6 changes: 3 additions & 3 deletions docs/11_leaflet_stadtteil_einwohner_torque.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<body>
<div style="float: right">
<div style="float: left">Jahrauswahl = </div>
<div style="float: left; margin-left: 4px;" id="ausgewaehltesJahr">2020</div>
<div style="float: left; margin-left: 4px;" id="ausgewaehltesJahr">2022</div>
<div style="float: left">: </div>
<div style="float: left"><input type="range" min="2000" max="2020" value="2020" id="jahrAuswahl"
<div style="float: left"><input type="range" min="2000" max="2022" value="2022" id="jahrAuswahl"
onchange="reagiereAufJahrAuswahl()"></div>
</div>
<p>
Expand Down Expand Up @@ -58,7 +58,7 @@
var legende = undefined;
var geojsonEbene = undefined;

var ausgewaehltesJahr = 2020;
var ausgewaehltesJahr = 2022;

var reagiereAufJahrAuswahl = function () {
ausgewaehltesJahr = parseInt(document.getElementById("jahrAuswahl").value);
Expand Down
6 changes: 3 additions & 3 deletions docs/12_leaflet_stadtteil_einwohner_dichte.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
<body>
<div style="float: right">
<div style="float: left">Jahrauswahl = </div>
<div style="float: left; margin-left: 4px;" id="ausgewaehltesJahr">2020</div>
<div style="float: left; margin-left: 4px;" id="ausgewaehltesJahr">2022</div>
<div style="float: left">: </div>
<div style="float: left"><input type="range" min="2000" max="2020" value="2020" id="jahrAuswahl"
<div style="float: left"><input type="range" min="2000" max="2022" value="2022" id="jahrAuswahl"
onchange="reagiereAufJahrAuswahl()"></div>
</div>
<p>
Expand Down Expand Up @@ -62,7 +62,7 @@
var legende = undefined;
var geojsonEbene = undefined;

var ausgewaehltesJahr = 2020;
var ausgewaehltesJahr = 2022;

var reagiereAufJahrAuswahl = function () {
ausgewaehltesJahr = parseInt(document.getElementById("jahrAuswahl").value);
Expand Down
6 changes: 3 additions & 3 deletions docs/13_leaflet_stadtteil_einwohner_veraenderung.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
<body>
<div style="float: right">
<div style="float: left">Jahrauswahl = </div>
<div style="float: left; margin-left: 4px;" id="ausgewaehltesJahr">2020</div>
<div style="float: left; margin-left: 4px;" id="ausgewaehltesJahr">2022</div>
<div style="float: left">: </div>
<div style="float: left"><input type="range" min="2001" max="2020" value="2020" id="jahrAuswahl"
<div style="float: left"><input type="range" min="2001" max="2022" value="2022" id="jahrAuswahl"
onchange="reagiereAufJahrAuswahl()"></div>
</div>
<p>
Expand Down Expand Up @@ -62,7 +62,7 @@
var legende = undefined;
var geojsonEbene = undefined;

var ausgewaehltesJahr = 2020;
var ausgewaehltesJahr = 2022;

var reagiereAufJahrAuswahl = function () {
ausgewaehltesJahr = parseInt(document.getElementById("jahrAuswahl").value);
Expand Down
276 changes: 276 additions & 0 deletions docs/16_pumpen_zine.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PumepnZine</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>
<style>
#KarteMitPunkt { height: 480px; }
</style>
</head>
<body>
<p>
<div id="KarteMitPunkt" />
</p>
<script>
// Karte mit Mittelpunkt Leipzig erzeugen
var laengenGrad = 12.3742236;
var breitenGrad = 51.3399028;
var kartenMittelpunktKoordinaten = [ breitenGrad, laengenGrad ];
var zoomStufe = 14;
var karte = L.map('KarteMitPunkt').setView(kartenMittelpunktKoordinaten, zoomStufe);
// Hintergrundkarte setzen
L.tileLayer('https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg', {
attribution: 'Map tiles by &copy; <a href="https://stadiamaps.com/" target="_blank">Stadia Maps</a> &copy; <a href="https://www.stamen.com/" target="_blank">Stamen Design</a> &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>',
minZoom: 0,
maxZoom: 20,
ext: 'png'
}).addTo(karte);
var geoJsonDaten = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"numberOfficial": "264",
"district": "Südvorstadt",
"address": "Bernhard-Göring-Straße 104 (andere Straßenseite)",
"type": "Kleiner Löwe",
"state": "gelb"
},
"geometry": {
"type": "Point",
"coordinates": [12.376775, 51.316723]
},
"id": "14"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "270",
"district": "Connewitz",
"address": "Bornaische Straße 3c",
"type": "Großer Löwe",
"state": "Lieblingspumpe"
},
"geometry": {
"type": "Point",
"coordinates": [12.374656, 51.309456]
},
"id": "18"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "266",
"district": "Möckern",
"address": "Blücherstraße",
"type": "Kleiner Löwe",
"state": "Lieblingspumpe"
},
"geometry": {
"type": "Point",
"coordinates": [12.348969, 51.368187]
},
"id": "16"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "235",
"district": "Lößnig",
"address": "Lobstädter Straße 9",
"type": "Vogelkäfig",
"state": "Lieblingspumpe"
},
"geometry": {
"type": "Point",
"coordinates": [12.38863, 51.29841]
},
"id": "86"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "17",
"district": "Zentrum-Nordwest",
"address": "Waldstraße 48",
"type": "Gotik",
"state": "gelb"
},
"geometry": {
"type": "Point",
"coordinates": [12.35732, 51.34554]
},
"id": "150"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "226",
"district": "Dölitz-Dösen",
"address": "Leinestraße",
"type": "Delphin",
"state": "Lieblingspumpe"
},
"geometry": {
"type": "Point",
"coordinates": [12.41067, 51.28604]
},
"id": "82"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "57",
"district": "Zentrum-Ost",
"address": "Schützenstraße 8",
"type": "Gotik",
"state": "gelb"
},
"geometry": {
"type": "Point",
"coordinates": [12.384303, 51.34243]
},
"id": "135"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "181",
"district": "Volkmarsdorf",
"address": "Mariannenstraße / Eastpark",
"type": "Delphin",
"state": "gelb"
},
"geometry": {
"type": "Point",
"coordinates": [12.40906, 51.34675]
},
"id": "96"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "229",
"district": "Neustadt-Neuschönefeld",
"address": "Hedwigstraße 3",
"type": "unbekannt",
"state": "gelb"
},
"geometry": {
"type": "Point",
"coordinates": [12.4032, 51.34583]
},
"id": "57"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "172",
"district": "Kleinzschocher",
"address": "Dieskaustraße",
"type": "Delphin",
"state": "In Arbeit"
},
"geometry": {
"type": "Point",
"coordinates": [12.328836, 51.319324]
},
"id": "35"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "246",
"district": "Schönefeld-Ost",
"address": "Gorkistraße 27",
"type": "Vogelkäfig",
"state": "In Arbeit"
},
"geometry": {
"type": "Point",
"coordinates": [12.41761, 51.3585]
},
"id": "52"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "234",
"district": "Gohlis-Süd",
"address": "Fritz-Seger-Straße",
"type": "Vogelkäfig",
"state": "In Arbeit"
},
"geometry": {
"type": "Point",
"coordinates": [12.37124, 51.3586]
},
"id": "47"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "25",
"district": "Zentrum",
"address": "Magazingasse 1 (andere Straßenseite)",
"type": "Vogelkäfig",
"state": "In Arbeit"
},
"geometry": {
"type": "Point",
"coordinates": [12.37649, 51.33728]
},
"id": "92"
},
{
"type": "Feature",
"properties": {
"numberOfficial": "185",
"district": "Sellerhausen-Stünz",
"address": "Wurzner Straße",
"type": "Delphin",
"state": "Erfolg"
},
"geometry": {
"type": "Point",
"coordinates": [12.42677, 51.34355]
},
"id": "158"
}]
};

// Punkt-Marker setzen
var geojsonEbene = L.geoJson(geoJsonDaten);
karte.addLayer(geojsonEbene);

var hoverZuMarkerAbstand = function(aktuelleZoomStufe) {
return 0.39 / Math.pow(2, aktuelleZoomStufe - 6);
};
var geojsonEbenenHover;
geojsonEbene.on('mouseover', function(ereignis) {
var koordinaten = ereignis.layer.feature.geometry.coordinates;
var hoverKoordinaten = [koordinaten[1] + hoverZuMarkerAbstand(karte.getZoom()), koordinaten[0]];
if (karte) {
var eigenschaften = ereignis.layer.feature.properties
geojsonEbenenHover = L.popup()
.setLatLng(hoverKoordinaten)
.setContent(eigenschaften.state)
.openOn(karte);
}
});
geojsonEbene.on('mouseout', function (ereignis) {
if (geojsonEbenenHover && karte) {
karte.closePopup(geojsonEbenenHover);
geojsonEbenenHover = null;
}
});
</script>
</body>
</html>

0 comments on commit 56a6160

Please sign in to comment.