feat: Ajout des données P4Pillon
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Simon 2023-03-02 11:11:50 +01:00
parent db020a2e78
commit 05126f8458
3 changed files with 167 additions and 24 deletions

View File

@ -27,7 +27,7 @@
<div id="map" style="width: 100%; height: 100%;"></div>
<script>
<script type="module">
var mappos = L.Permalink.getMapLocation();
var map = L.map('map').setView(mappos.center || [46.55886, 3.21924], mappos.zoom || 6);
L.Permalink.setup(map);
@ -43,30 +43,52 @@
name: 1,
name_long: 2,
dep: 3,
tel: 4,
siret: 5,
x: 6,
y: 7,
adresse: 4,
tel: 5,
siret: 6,
x: 7,
y: 8,
}
var json = fetch('./data.json').then(response => {
return response.json();
})
.then(jsondata => {
var markersCluster = new L.MarkerClusterGroup();
for (const msp of jsondata) {
const marker = L
.marker([msp[columns.x], msp[columns.y]])
.bindPopup(
(msp[columns.name_long] ? msp[columns.name_long] : msp[columns.name]) + " (" + msp[columns.dep] + ")<br>" +
"Établissement FINESS N°" + msp[columns.finessET] + "<br>" +
(msp[columns.siret] != null ? "SIREN : <a rel='noreferrer' target='_blank' href='https://data.inpi.fr/entreprises/" + msp[columns.siret].substring(0, 9) + "'>" + msp[columns.siret].substring(0, 9) + "</a><br>" : "") +
(msp[columns.tel] != null ? "<a href='tel:" + msp[columns.tel] + "'>" + msp[columns.tel] + "</a>" : "")
);
markersCluster.addLayer(marker);
}
map.addLayer(markersCluster);
});
async function getDataP4Pillon() {
const data = await fetch('./data_p4pillon.json')
return data.json()
}
async function getData() {
const data = await fetch('./data.json')
return data.json()
}
function getPopup(msp, dataP4Pillon) {
console.log(dataP4Pillon)
const nom = dataP4Pillon ? dataP4Pillon[0] : (msp[columns.name_long] ? msp[columns.name_long] : msp[columns.name])
const dep = msp[columns.dep]
const adresse = msp[columns.adresse]
return nom + " (" + dep + ")" +
"<br>Établissement FINESS N°" + msp[columns.finessET] +
(msp[columns.siret] != null ? "<br>SIREN : <a rel='noreferrer' target='_blank' href='https://data.inpi.fr/entreprises/" + msp[columns.siret].substring(0, 9) + "'>" + msp[columns.siret].substring(0, 9) + "</a>" : "") +
(msp[columns.tel] != null ? "<br><a href='tel:" + msp[columns.tel] + "'>" + msp[columns.tel] + "</a>" : "") +
(dataP4Pillon ? "<br>" +
(dataP4Pillon[1] || dataP4Pillon[2] ? "<br>Leader : " + dataP4Pillon[1] + " " + dataP4Pillon[2] : "") +
(dataP4Pillon[3] ? "<br>Adhérent à l'association AVEC Santé : ✅" : "") +
(dataP4Pillon[4] ? "<br>Accord conventionnel interprofessionnel : ✅" : "")
: "")
}
var data = await getData()
var dataP4Pillon = await getDataP4Pillon()
var markersCluster = new L.MarkerClusterGroup();
for (const msp of data) {
const marker = L
.marker([msp[columns.x], msp[columns.y]])
.bindPopup(
getPopup(msp, dataP4Pillon[msp[columns.finessET]])
);
markersCluster.addLayer(marker);
}
map.addLayer(markersCluster);
</script>
</body>
</html>

View File

@ -67,7 +67,7 @@ header_drop = [
'commune',
#'departement',
'libdepartement',
'ligneacheminement',
#'ligneacheminement',
#'telephone',
'telecopie',
'categetab',

121
static/data_p4pillon.json Normal file
View File

@ -0,0 +1,121 @@
{
"190012427": [
"PSP Millesoins",
"Antoine",
"PRIOUX",
true,
true
],
"190013144": [
"Maison de Santé des Eaux Vives",
"Anaïs",
"CARTEGNIE",
true,
true
],
"190013805": [
"MSP MANSAC",
"Hélène",
"SCHWARTZ",
false,
null
],
"190012443": [
"Pole de santé de Haute-Corrèze",
"Cyril",
"MOESCH",
null,
null
],
"190012294": [
"MSP lubersac projet pompadour",
"Maryline",
"DUMONT",
null,
true
],
"190012278": [
"MSP du pays acadien",
"Benjamin",
"LECAVELIER",
true,
null
],
"190013466": [
"MSP d'Argentat",
"Laurent",
"MAHE",
null,
false
],
"190013441": [
"MSP du Sud Corrézien",
"",
"",
null,
true
],
"190012401": [
"MSP de Seilhac",
"",
"",
null,
null
],
"190013425": [
"MSP de Chamberet",
"",
"",
null,
true
],
"190012468": [
"MSP des Gorges de la Dordogne",
"",
"",
null,
null
],
"190013128": [
"MSP des 7 collines",
"",
"",
"",
true
],
"190013409": [
"MSP d'Arnac Pompadour",
"",
"",
null,
true
],
"190013169": [
"MSP Union des collines",
"",
"",
null,
null
],
"190013623": [
"MSP de Juillac",
"",
"",
null,
true
],
"190013789": [
"MSP Montplaisir",
"",
"",
null,
true
],
"570028480": [
"MSP de St Privat",
"",
"",
null,
null
]
}