carte graph avancé: centroides de batiments
This commit is contained in:
parent
ed9e5b6b47
commit
205a653bee
1 changed files with 8 additions and 4 deletions
|
@ -260,7 +260,9 @@
|
|||
{{ parent() }}
|
||||
<script src='{{ asset('js/maplibre/maplibre-gl.js') }}'></script>
|
||||
<script>
|
||||
const overpassQuery = `{% if overpass_query is defined %}{{ overpass_query|e('js') }}{% endif %}`;
|
||||
const overpassQuery = `{% if overpass_query is defined %}{{ overpass_query|replace({
|
||||
'(._;>;);\nout meta;\n>;': 'out center;'
|
||||
})|e('js') }}{% endif %}`;
|
||||
const mapToken = '{{ maptiler_token }}';
|
||||
// Liste des tags attendus pour la complétion de ce thème
|
||||
const completionTags = {{ completion_tags[theme]|json_encode|raw }};
|
||||
|
@ -345,11 +347,13 @@
|
|||
}
|
||||
// Marqueurs
|
||||
data.elements.forEach(e => {
|
||||
let lat = e.lat, lon = e.lon;
|
||||
if (!lat && !lon && e.type === 'way' && e.center) {
|
||||
let lat = null, lon = null;
|
||||
if (e.type === 'node') {
|
||||
lat = e.lat; lon = e.lon;
|
||||
} else if (e.center) {
|
||||
lat = e.center.lat; lon = e.center.lon;
|
||||
}
|
||||
if (!lat || !lon) return;
|
||||
if (!lat || !lon) return; // On ignore les ways sans centroïde
|
||||
// Calcul de la complétion
|
||||
let filled = 0;
|
||||
let missingTags = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue