Ajout du nom générique sur les lieux
This commit is contained in:
parent
42e6d47fe4
commit
bb779faa49
2 changed files with 26 additions and 4 deletions
|
|
@ -5,6 +5,7 @@ const TEMPLATE = document.createElement("template")
|
|||
TEMPLATE.innerHTML = `
|
||||
<camp-feature-legend class="feature-legend"></camp-feature-legend>
|
||||
<h2 class="feature-name"></h2>
|
||||
<small class="feature-generic-name"></small>
|
||||
<camp-coords class="feature-location" lat="0" lon="0"></camp-coords>
|
||||
`
|
||||
|
||||
|
|
@ -37,10 +38,18 @@ export class FeatureShortHeaderElement extends HTMLElement {
|
|||
this.querySelector(".feature-legend").feature = this.feature
|
||||
this.querySelector(".feature-legend").updateContent()
|
||||
|
||||
this.querySelector(".feature-name").textContent =
|
||||
this.feature?.properties?.name ||
|
||||
let name = this.feature?.properties?.name ||
|
||||
this.feature.mapSymbol.genericName ||
|
||||
this.feature.id
|
||||
this.feature.id;
|
||||
|
||||
this.querySelector(".feature-name").textContent = name;
|
||||
|
||||
if(name != this.feature.mapSymbol.genericName){
|
||||
this.querySelector(".feature-generic-name").textContent = this.feature.mapSymbol.genericName
|
||||
} else {
|
||||
this.querySelector(".feature-generic-name").replaceChildren()
|
||||
}
|
||||
|
||||
|
||||
let featurePoint = this.feature.asPoint()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue