diff --git a/index.html b/index.html index 1751353..1161d34 100644 --- a/index.html +++ b/index.html @@ -61,6 +61,8 @@ +
+
@@ -105,10 +107,10 @@ href="https://openstreetmap.org">OpenStreetMap

-
+ - -
+ +
- + +
@@ -169,7 +171,7 @@

- Puissances des stations: 🔽 + 🚀 Puissances des stations: 🔽

diff --git a/js/lcm_config.js b/js/lcm_config.js index 30e029a..20635fa 100644 --- a/js/lcm_config.js +++ b/js/lcm_config.js @@ -6,15 +6,15 @@ const lcm_config = { max_possible_station_output : 400, tileServers:{ osm : 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - cycle : 'https://{s}.tile.thunderforest.org/{z}/{x}/{y}.png', + cycle : 'https://{s}.tile.thunderforest.org/cycle/{z}/{x}/{y}.png', cartodb : 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', stamen : 'https://a.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', transport : 'https://a.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png' }, tags_to_display_in_popup: [ + 'description', 'name', 'capacity', - 'description', 'date_start', 'charging_station:output', 'socket:type_2', diff --git a/js/lcm_main.js b/js/lcm_main.js index ccedf37..11556f0 100644 --- a/js/lcm_main.js +++ b/js/lcm_main.js @@ -109,7 +109,7 @@ var baseLayers = { 'Transport': transport } let overlays = { - stations_bof: all_stations_markers + stations: all_stations_markers } const layerControl = L.control.layers(baseLayers, overlays, {collapsed: true}).addTo(map) @@ -180,6 +180,8 @@ function displayStatsFromGeoJson(resultAsGeojson) { let count_found_type2combo = 0; let count_found_type2 = 0; + $('#count_features_fond').html('⚡'+count+' stations'); + resultAsGeojson.features.map(feature => { let found_type2_combo = false; let found_type2 = false; @@ -205,9 +207,6 @@ function displayStatsFromGeoJson(resultAsGeojson) { // filtres // filtrer les valeurs inconnues - if(filters_features.display_unknown_max_power_station === 'hide'){ - return; - } if (outputPower >= 200 && !found_type2_combo) { count_estimated_type2combo++; } @@ -296,8 +295,8 @@ function bindEventsOnJosmRemote() { } -function displayPointsFromApi(points) { - if (points) { +function displayPointsFromApi(points, convert_to_osm_json) { + if (points && convert_to_osm_json) { geojsondata = osmtogeojson(points); } @@ -375,14 +374,35 @@ function eachFeature(feature, layer) { let displayOutPowerGuessed = '? kW'; if (outPowerGuessed) { displayOutPowerGuessed = outPowerGuessed + ' kW max'; + if(display_unknown_max_power_station === 'show_only'){ + return; + } + } + else{ + // on cache cette station si on ne veut pas voir les stations à la puissance inconnue + if(display_unknown_max_power_station === 'hide'){ + return; + } } if (!popupContent) { popupContent = ` Aucune information renseignée, ajoutez la dans OpenStreetMap!`; } - let html = ` 🚗🚴‍♀️👠 -✏️JOSM ${displayOutPowerGuessed}${popupContent}`; + // Ajout du lien vers Panoramax + const panoramaxLink = `https://api.panoramax.xyz/#focus=map&map=16.7/${feature.geometry.coordinates[1]}/${feature.geometry.coordinates[0]}&speed=250`; + + + + let html = ` 🚗 +🚴‍♀️ +👠 +✏️ +JOSM + +icone +${displayOutPowerGuessed} +${popupContent}`; let zoom = map.getZoom(); let radius = 20; @@ -508,7 +528,7 @@ function loadOverpassQuery() { $.get(overpassApiUrl, function (geoDataPointsFromApi) { geojsondata = geoDataPointsFromApi; - refreshDisplay(); + refreshDisplay(true); $('#spinning_icon').fadeOut(); $('#message-loading').fadeOut(); isLoading = false; @@ -516,9 +536,9 @@ function loadOverpassQuery() { } } -function refreshDisplay() { +function refreshDisplay(convert_points_to_osm=false) { supprimerMarqueurs(); - displayPointsFromApi(geojsondata); + displayPointsFromApi(geojsondata,convert_points_to_osm); } @@ -728,7 +748,10 @@ function copyCurrentUrl() { document.body.removeChild(dummy); } -function searchLocation() { +function searchLocation(event) { + event.preventDefault(); + event.stopPropagation(); + const location = document.getElementById('searchLocation').value; if (!location) { alert('Veuillez entrer un lieu à rechercher.'); diff --git a/styles/images/panoramax.ico b/styles/images/panoramax.ico new file mode 100644 index 0000000..14edc0c Binary files /dev/null and b/styles/images/panoramax.ico differ diff --git a/styles/style.css b/styles/style.css index 13ca87c..1602265 100644 --- a/styles/style.css +++ b/styles/style.css @@ -547,4 +547,13 @@ header img{ margin-bottom: 10px; border: 1px solid var(--button-border); border-radius: 5px; +} +#count_features_fond{ + position: fixed; + bottom: 1rem; + right: 1rem; + z-index: 10; + background: white; + padding: 1rem; + border-radius: 8px; } \ No newline at end of file