Meilleur affichage des coordonnées
This commit is contained in:
parent
709a83fc3f
commit
42e6d47fe4
2 changed files with 53 additions and 4 deletions
|
|
@ -1,10 +1,11 @@
|
|||
import "./feature-legend.js"
|
||||
import "./coords.js"
|
||||
|
||||
const TEMPLATE = document.createElement("template")
|
||||
TEMPLATE.innerHTML = `
|
||||
<camp-feature-legend class="feature-legend"></camp-feature-legend>
|
||||
<h2 class="feature-name"></h2>
|
||||
<small class="feature-location"></small>
|
||||
<camp-coords class="feature-location" lat="0" lon="0"></camp-coords>
|
||||
`
|
||||
|
||||
export class FeatureShortHeaderElement extends HTMLElement {
|
||||
|
|
@ -43,9 +44,8 @@ export class FeatureShortHeaderElement extends HTMLElement {
|
|||
|
||||
let featurePoint = this.feature.asPoint()
|
||||
|
||||
this.querySelector(".feature-location").textContent =
|
||||
this.feature?.properties?.["location-description"] ||
|
||||
`${featurePoint.geometry.coordinates[1]}, ${featurePoint.geometry.coordinates[0]}`
|
||||
this.querySelector(".feature-location").lon = featurePoint.geometry.coordinates[0]
|
||||
this.querySelector(".feature-location").lat = featurePoint.geometry.coordinates[1]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue