Skip to content

Commit

Permalink
Ajout du bouton d'accès aux fiches espèces
Browse files Browse the repository at this point in the history
  • Loading branch information
Adri-Charbonneau authored Oct 4, 2023
1 parent 7835806 commit 441b716
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
12 changes: 8 additions & 4 deletions ASSETS/autres.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ choix.onchange = function() {

var espece = this.options[this.selectedIndex].getAttribute('espece');

carte_interactive.innerHTML = '<button><a href="../">➤ Carte interactive</a></button>';

// MISE A JOUR DE L'URL EN TEMPS REEL //
if (espece !== null) {
var change_url = { Title: espece, Url: 'index.html?'+ espece };
history.pushState(change_url, change_url.Title, change_url.Url);
}


// MISE A JOUR DES CARTES + intégration si l'espèce n'existe pas dans la BDD //
carte_interactive.innerHTML = '<button><a href="../index.html?' + espece + '">➤ Carte interactive</a></button>';
// MISE A JOUR DES CARTES + intégration si l'espèce n'existe pas dans la BDD //
carte_interactive.innerHTML = '<button><a href="../index.html?' + espece + '">➤ Carte interactive</a></button>';
fiche_espece.innerHTML = '<button><a href="https://www.cigalesdefrance.fr/espece:' + espece + '" target="_blank">➤ Fiche espèce</a></button>';

};

var ff_url = 'https://cartes.cigalesdefrance.fr/BDD/FAUNE-FRANCE/' + espece + '.png';
var onem_url = 'https://cartes.cigalesdefrance.fr/BDD/ONEM/' + espece + '.jpg';
Expand Down Expand Up @@ -64,6 +69,5 @@ choix.onchange = function() {
}
}


};
choix.onchange();
5 changes: 3 additions & 2 deletions ASSETS/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ window.onload = function go() {
// Fonds de carte de base : OSM et BDOrtho IGN
var layer_osm = new ol.layer.Tile({
source: new ol.source.OSM({attributions: [
'<span style="color:#b70000; font-weight:bold">Version bêta</span> | <a href="https://github.com/CigalesdeFrance/CARTES/">Code source/Erreurs</a> | © <a href="https://www.cigalesdefrance.fr">Cigales de France</a> |',ol.source.OSM.ATTRIBUTION,'<br><a href="https://inpn.mnhn.fr"><img class="copyright" src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/INPN.png" alt="Logo de l\'INPN"></a><a href="https://observation.org"><img class="copyright" src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/OBSERVATION.svg" alt="Logo d\'Observation.org"></a><a href="https://www.gbif.org"><img class="copyright" src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/GBIF.svg" alt="Logo de GBIF"></a><a href="https://www.inaturalist.org/"><img class="copyright" src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/INATURALIST.svg" alt="Logo d\'iNaturalist"></a>']}),
'<span style="color:#b70000; font-weight:bold">Version en développement</span> | <a href="https://github.com/CigalesdeFrance/CARTES/">Code source/Erreurs</a> | © <a href="https://www.cigalesdefrance.fr">Cigales de France</a> |',ol.source.OSM.ATTRIBUTION,'<br><a href="https://inpn.mnhn.fr"><img class="copyright" src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/INPN.png" alt="Logo de l\'INPN"></a><a href="https://observation.org"><img class="copyright" src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/OBSERVATION.svg" alt="Logo d\'Observation.org"></a><a href="https://www.gbif.org"><img class="copyright" src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/GBIF.svg" alt="Logo de GBIF"></a><a href="https://www.inaturalist.org/"><img class="copyright" src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/INATURALIST.svg" alt="Logo d\'iNaturalist"></a>']}),
opacity: 1
});

Expand Down Expand Up @@ -241,6 +241,7 @@ window.onload = function go() {
history.pushState(change_url, change_url.Title, change_url.Url);

autres_cartes.innerHTML = '<button><a href="./AUTRES/index.html?' + espece + '" target="_blank">➤ Autres sources</a></button>';
fiche_espece.innerHTML = '<button><a href="https://www.cigalesdefrance.fr/espece:' + espece + '" target="_blank">➤ Fiche espèce</a></button>';

// Adresses des KML et ajout des sources aux couches
var url_bdd1 = 'https://cartes.cigalesdefrance.fr/BDD/INATURALIST/' + espece + '.kml';
Expand Down Expand Up @@ -290,4 +291,4 @@ window.onload = function go() {
};
};
choix.onchange();
};
};
4 changes: 2 additions & 2 deletions ASSETS/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ button {
margin: 2px;
}

#boutons_obs, #carte_interactive {
#boutons_obs {
margin: 5px;
}

#boutons_obs a, #carte_interactive a {
#boutons_obs a {
text-decoration: none;
color: black;
font-weight: bold;
Expand Down
4 changes: 2 additions & 2 deletions AUTRES/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<option espece="Tibicina_steveni">Cigale orientale / <i>Tibicina steveni</i></option>
<option espece="Tibicina_picta">Cigale cotonneuse / <i>Tibicina picta</i></option>
</select>
<div id="carte_interactive"></div>
<div id="boutons_obs"><span id="carte_interactive"></span><span id="fiche_espece"></span></div>
</div>
<h2><br><br>Répartition française</h2>
<div class="row">
Expand All @@ -89,7 +89,7 @@ <h2>Répartition européenne</h2>
</div>
<div id="copy" class="ol-attribution ol-unselectable ol-control">
<ul>
<li><span style="color:#b70000; font-weight:bold">Version bêta</span> | <a href="https://github.com/CigalesdeFrance/CARTES/">Code source/Erreurs</a> | © <a href="https://www.cigalesdefrance.fr">Cigales de France</a></li>
<li><span style="color:#b70000; font-weight:bold">Version en développement</span> | <a href="https://github.com/CigalesdeFrance/CARTES/">Code source/Erreurs</a> | © <a href="https://www.cigalesdefrance.fr">Cigales de France</a></li>
<li><br><a href="http://www.onem-france.org/cigales/"><img src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/ONEM.png" alt="Logo de l'ONEM"></a><a href="https://www.faune-france.org/"><img style="height: 100%" src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/FAUNE-FRANCE.png" alt="Logo de Faune-France"></a><a href="https://www.gbif.org"><img src="https://cartes.cigalesdefrance.fr/ASSETS/LOGOS/GBIF.svg" alt="Logo de GBIF"></a></li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<option espece="Tibicina_steveni">Cigale orientale / <i>Tibicina steveni</i></option>
<option espece="Tibicina_picta">Cigale cotonneuse / <i>Tibicina picta</i></option>
</select>
<div id="boutons_obs"><span id="autres_cartes"></span><span id="observation"></span></div>
<div id="boutons_obs"><span id="autres_cartes"></span><span id="fiche_espece"></span><span id="observation"></span></div>
</div>
<div id="map" class="map"></div>
<script src="./ASSETS/index.js"></script>
Expand Down

0 comments on commit 441b716

Please sign in to comment.