Skip to content

Commit

Permalink
updated address keys due to missing city
Browse files Browse the repository at this point in the history
  • Loading branch information
p3t3r67x0 committed Oct 6, 2024
1 parent 2632949 commit f3ab89b
Show file tree
Hide file tree
Showing 11 changed files with 2,075 additions and 2,039 deletions.
4 changes: 2 additions & 2 deletions data/kreis-nordfriesland-denkmalschutz.geojson
Git LFS file not shown
2 changes: 1 addition & 1 deletion data/kreis-nordfriesland-denkmalschutz.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/kreis-nordfriesland.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions data/kreis-schleswig-flensburg-denkmalschutz.geojson
Git LFS file not shown
2 changes: 1 addition & 1 deletion data/kreis-schleswig-flensburg-denkmalschutz.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions data/stadt-flensburg-denkmalschutz.geojson
Git LFS file not shown
2 changes: 1 addition & 1 deletion data/stadt-flensburg-denkmalschutz.json

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ function capitalizeEachWord(str) {

function renderFeatureDetails(feature) {
const slug = feature.properties.slug
const address = feature.properties.address
const postal_code = feature.properties.postal_code
const district = feature.properties.place_name.slice(6)
const street = feature.properties.street
const housenumber = feature.properties.housenumber
const postcode = feature.properties.postcode
const city = feature.properties.city
const monument_type = feature.properties.monument_type
const description = feature.properties.description
const designation = feature.properties.designation
Expand Down Expand Up @@ -191,7 +192,7 @@ function renderFeatureDetails(feature) {
let detailOutput = ''

detailOutput += `<li class="pb-2 text-xl lg:text-2xl"><strong>${designation}</strong></li>`
detailOutput += `<li class="last-of-type:pb-2 py-1 mb-3">${address}<br>${postal_code} ${district}</li>`
detailOutput += `<li class="last-of-type:pb-2 py-1 mb-3">${street} ${housenumber}<br>${postcode} ${city}</li>`
detailOutput += `<li class="last-of-type:pb-2 pt-2"><strong>Beschreibung</strong><br>${description}</li>`
detailOutput += `<li class="last-of-type:pb-2 pt-2"><strong>Schutzumfang</strong><br>${scope}</li>`
detailOutput += `<li class="last-of-type:pb-2 pt-2"><strong>Begründung</strong><br>${reasons}</li>`
Expand Down Expand Up @@ -252,7 +253,15 @@ function marker(data) {
})
},
pointToLayer(feature, latlng) {
const label = String(feature.properties.address)
const street = feature.properties.street
const housenumber = feature.properties.housenumber
const designation = feature.properties.designation

let label = designation

if (street.length > 0) {
label = `${street} ${housenumber}`
}

return L.marker(latlng, { icon: defaultIcon }).bindTooltip(label, {
permanent: false,
Expand Down
Loading

0 comments on commit f3ab89b

Please sign in to comment.