1- const mailleBorderColor = String (
2- getComputedStyle ( document . documentElement ) . getPropertyValue (
3- "--map-maille-border-color" ,
4- ) ,
5- ) ;
6- const mailleLastObsBorderColor = String (
7- getComputedStyle ( document . documentElement ) . getPropertyValue (
8- "--map-maille-lastobs-border-color" ,
9- ) ,
10- ) ;
111const territoryBorderColor = String (
122 getComputedStyle ( document . documentElement ) . getPropertyValue (
133 "--map-territory-border-color" ,
144 ) ,
155) ;
16- const areaBorderColor = String (
17- getComputedStyle ( document . documentElement ) . getPropertyValue (
18- "--map-area-border-color" ,
19- ) ,
20- ) ;
216
227// Feature group de chaque élément de floutage (M1, M5 etc...)
238const overlays = { } ;
24- const mailleSelectorrGenerated = false ;
259let current_type_code = [ ] ;
2610const control = L . control . layers ( null , null , {
2711 collapsed : false ,
@@ -96,7 +80,7 @@ function addExternalOverlays() {
9680 document . getElementById ( "legend-other-info" ) . appendChild ( div ) ;
9781 } ) ;
9882
99- overlays [ elem . name ] . addEventListener ( "remove" , ( event ) => {
83+ overlays [ elem . name ] . addEventListener ( "remove" , ( ) => {
10084 // Remove legend item
10185 const item = document . querySelector (
10286 `.legend-item[data-name='${ elem . name } ']` ,
@@ -116,7 +100,7 @@ function addExternalOverlays() {
116100 . then ( ( response ) => response . json ( ) )
117101 . then ( ( data ) => {
118102 overlays [ elem . name ] = L . geoJSON ( data , {
119- style : function ( feature ) {
103+ style : function ( ) {
120104 return elem . style || { } ;
121105 } ,
122106 } ) ;
@@ -264,6 +248,7 @@ function createLayersSelector(selectedAllLayer = false) {
264248 } ) ;
265249}
266250
251+ // eslint-disable-next-line no-unused-vars
267252function generateMap ( zoomHomeButton ) {
268253 // Map initialization
269254 firstMapTile = L . tileLayer ( configuration . MAP . FIRST_MAP . url , {
@@ -291,7 +276,7 @@ function generateMap(zoomHomeButton) {
291276 // Keep Layers in the same order as specified by the
292277 // overlays variable so Departement under Commune
293278 // under 10km2 under 1km2
294- map . on ( "overlayadd" , function ( e ) {
279+ map . on ( "overlayadd" , function ( ) {
295280 Object . values ( overlays ) . forEach ( ( e ) => e . bringToFront ( ) ) ;
296281 } ) ;
297282
@@ -454,7 +439,7 @@ function onEachFeatureMaille(feature, layer) {
454439}
455440
456441function zoomMaille ( layer ) {
457- layer . on ( "click" , function ( e ) {
442+ layer . on ( "click" , function ( ) {
458443 map . fitBounds ( layer . getBounds ( ) ) ;
459444 } ) ;
460445}
@@ -478,15 +463,6 @@ function getColor(d) {
478463 : "#FFEDA0" ;
479464}
480465
481- function styleMaille ( feature ) {
482- return {
483- fillColor : getColor ( feature . properties . nb_observations ) ,
484- weight : 1 ,
485- color : mailleBorderColor ,
486- fillOpacity : 0.8 ,
487- } ;
488- }
489-
490466function generateLegend ( isMaille = false ) {
491467 if ( ! configuration . AFFICHAGE_MAILLE && ! isMaille ) {
492468 return generalLegendPoint ( ) ;
@@ -535,6 +511,7 @@ function generalLegendPoint() {
535511
536512// Display Maille layer
537513
514+ // eslint-disable-next-line no-unused-vars
538515function displayMailleLayerFicheEspece ( observationsMaille ) {
539516 myGeoJson = observationsMaille ;
540517 // Get all different type code
@@ -593,6 +570,7 @@ function generateGeojsonPointFicheEspece(
593570}
594571
595572// Display marker Layer (cluster or not)
573+ // eslint-disable-next-line no-unused-vars
596574function displayMarkerLayerFicheEspece (
597575 observationsPoint ,
598576 yearMin ,
@@ -612,7 +590,7 @@ function displayMarkerLayerFicheEspece(
612590 ) ;
613591
614592 if ( typeof customizeMarkerStyle === "undefined" ) {
615- customizeMarkerStyle = function ( feature ) {
593+ customizeMarkerStyle = function ( ) {
616594 return { } ;
617595 } ;
618596 }
@@ -674,21 +652,17 @@ function onEachFeaturePoint(feature, layer) {
674652 layer . bindPopup ( popupContent ) ;
675653}
676654
677- function onEachFeaturePointArea ( feature , layer ) {
678- popupContent = generateObservationPopup ( feature , true ) ;
679- layer . bindPopup ( popupContent ) ;
680- }
681-
682655function getCustomizeMarkerStyle ( ) {
683656 if ( typeof customizeMarkerStyle === "undefined" ) {
684- customizeMarkerStyle = function ( feature ) {
657+ customizeMarkerStyle = function ( ) {
685658 return { } ;
686659 } ;
687660 } else {
688661 return customizeMarkerStyle ;
689662 }
690663}
691664
665+ // eslint-disable-next-line no-unused-vars
692666function displayGeoJsonPoint ( geojson ) {
693667 currentLayer = L . geoJson ( geojson , {
694668 onEachFeature : onEachFeaturePoint ,
@@ -705,6 +679,7 @@ function displayGeoJsonPoint(geojson) {
705679 createTabControl ( control ) ;
706680}
707681
682+ // eslint-disable-next-line no-unused-vars
708683function refreshStyle ( layers ) {
709684 // fonction to refresh style of a list of layers from the customizeMarkerStyle (set green for sensibility and blue for non sensible obs)
710685 layers . forEach ( ( layer ) => {
@@ -714,12 +689,6 @@ function refreshStyle(layers) {
714689
715690// ** MAILLE ***
716691
717- function compare ( a , b ) {
718- if ( a . id_maille < b . id_maille ) return - 1 ;
719- if ( a . id_maille > b . id_maille ) return 1 ;
720- return 0 ;
721- }
722-
723692function buildSpeciesEntries ( taxons ) {
724693 rows = [ ] ;
725694 taxons . forEach ( ( taxon ) => {
@@ -894,6 +863,7 @@ function addInFeatureGroup(feature, layer) {
894863 }
895864}
896865
866+ // eslint-disable-next-line no-unused-vars
897867function displayGeojsonMailles ( observationsMaille ) {
898868 // Get all different type code
899869 observationsMaille . features . forEach ( ( elem ) => {
@@ -910,16 +880,18 @@ function displayGeojsonMailles(observationsMaille) {
910880// Legend
911881
912882var div ;
883+ // eslint-disable-next-line no-unused-vars
913884var mySlider ;
914885
886+ // eslint-disable-next-line no-unused-vars
915887function generateSliderOnMap ( ) {
916888 var SliderControl = L . Control . extend ( {
917889 options : {
918890 position : "bottomleft" ,
919891 //control position - allowed: 'topleft', 'topright', 'bottomleft', 'bottomright'
920892 } ,
921893
922- onAdd : function ( map ) {
894+ onAdd : function ( ) {
923895 var sliderContainer = L . DomUtil . create (
924896 "div" ,
925897 "leaflet-bar leaflet-control leaflet-slider-control" ,
@@ -956,11 +928,3 @@ function generateSliderOnMap() {
956928 $ ( "#yearMax" ) . html ( " " + YEARMAX ) ;
957929 $ ( "#yearMin" ) . html ( taxonYearMin + "  " ) ;
958930}
959-
960- function find_id_observation_in_array ( tab_id , id_observation ) {
961- i = 0 ;
962- while ( i < tab_id . length && tab_id [ i ] !== id_observation ) {
963- i = i + 1 ;
964- }
965- return i !== tab_id . length ;
966- }
0 commit comments