From 984cac9884ac56437acee03a66c4c696a72bf8e3 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Tue, 31 Dec 2024 23:27:19 +0100 Subject: [PATCH] add panoramax link, enable filter unknown, count displayed --- index.html | 16 ++++++------ js/lcm_config.js | 4 +-- js/lcm_main.js | 47 +++++++++++++++++++++++++++--------- styles/images/panoramax.ico | Bin 0 -> 15406 bytes styles/style.css | 9 +++++++ 5 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 styles/images/panoramax.ico 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 0000000000000000000000000000000000000000..14edc0c82adaab2864b19eb13d3195e3641925e4 GIT binary patch literal 15406 zcmeHO*_#wqmaq9{{(zo`dH1Qme(a}to);AmWM5oZ1Q7(;QI-NM5m022eXT+YN?EJe z5tSW9L4lUNbp#buM0Tn&GvY31e!mkLX=GMrEtK6a)AfD#i^zz$_bm79=T=$Szm@%a z*`NMYhU;TxL;s_!?7z#(${u?x`u&&xEGt`sXMg=`_WhsB%8vh6S=nFk4W?j5^c ze?CY_a@fVqcroXl}fo?K?m`zH$6+^OoFN zVO_1*1q;RWdRAN!*ztV6bNI$ASS)t?j@g zC2sjj@w46*mxb?s`&EMKYH>4WihC1d)oQVCyeaOTIpVwa5Zkq<*rm(Fzdc9a@f(j} z-+NE&)hpugKKBf3*p+}W^>wjZw~DP^CwA>Raa%zvo;kqhTn>drdN>Gs)?4D{&cppI z9d_?tanmZqO_?Tc!$$CIsd&DdGf(`)$vTI8;e3nv;ajsM10Fh#7l%l2^oZDjgT)Vf zMcn7d#ZADR)s^CBzoYAV%!%h4+^6Tym(;{bVwWrxvwfS`@~Jr<5?5POBkuhV#EpAZ z{OfPz;B$=-^D{GMNU(CH1fL$2VD#ABT!jJI2`Z*bc<^9^AJ!(#@jK#QKWDat@4O@C z%^5ko_&zz5w#ie(O`oAOd&=aGSHa`8lB%kdpk}@JPF?fnBu|sH$~m#_ZQ3ku33LL(y*xbH(fR4Jm|>HkJrJ~ef&{LTi&}*#jULtPgzb3T^qKo5Elde4mxxa(+=~%LyKW} zeG&t-yOz=)%Q58=eDIjh;j$xW-&t)*A^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