-
Notifications
You must be signed in to change notification settings - Fork 109
Fix/leaflet overlap #3779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Fix/leaflet overlap #3779
Conversation
a2b0718 to
f720385
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3779 +/- ##
========================================
Coverage 84.48% 84.48%
========================================
Files 133 133
Lines 10361 10361
========================================
Hits 8754 8754
Misses 1607 1607
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Peut être que surcharger la méthode |
|
Et dans Leaflet 2.0 qui arrive, y a pas une piste plus intéressante ?
…________________________________
[http://pnx.espaces-naturels.fr/signature/embleme_pne.png]
[http://pnx.espaces-naturels.fr/signature/pointilles_pne.png]
Camille MONCHICOURT
Responsable du pôle SI / Géomaticien
Parc national des Ecrins
Tél : +33 (0)4 92 40 20 30 / +33 (0)6 99 77 37 53
www.ecrins-parcnational.fr<https://www.ecrins-parcnational.fr/>
[https://geonature.fr/img/pne-image-signature.jpg]<http://actu.ecrins.info/>
________________________________
De : Théo Lechémia ***@***.***>
Envoyé : vendredi 31 octobre 2025 09:11
À : PnX-SI/GeoNature ***@***.***>
Cc : Subscribed ***@***.***>
Objet : Re: [PnX-SI/GeoNature] Fix/leaflet overlap (PR #3779)
[https://avatars.githubusercontent.com/u/15265745?s=20&v=4]TheoLechemia left a comment (PnX-SI/GeoNature#3779)<#3779 (comment)>
Peut être que surcharger la méthode addTo(map) de la classe Layer<https://github.com/Leaflet/Leaflet/blob/main/src/layer/Layer.js#L53> serait plus propre et transparent pour les developpeur.
Le point faible de cette solution est surement les perf, car on est obligé de reboucler une deuxième fois sur toutes les features afin de les mettre dans le bon featureGroup.
Dans l'idéal et pour éviter cette double boucle, on aurait pu le faire en surcharcheant cette fonction qui construit la layer : https://github.com/Leaflet/Leaflet/blob/main/src/layer/GeoJSON.js#L170, mais elle est utiliser en fonction statique dans la fonction addData de GeoJSON, du coup la surcharge dans la classe custo ne fonctionne pas ...
On peut toujours réécrire toute la fonction addData<https://github.com/Leaflet/Leaflet/blob/main/src/layer/GeoJSON.js#L102>, mais c'est plus lourd et il faudra répercuter les changement si leaflet bouge
—
Reply to this email directly, view it on GitHub<#3779 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABBW2GDAPT5BDLSTULCTEM332MKSDAVCNFSM6AAAAACKV7MR2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINZRG42TKMJTGQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Solutionne le problème d'accès aux point qui se superpose avec des polygone. Voir : #1381
En surchargeant la classe GeoJSON, on ajoute une fonction qui crée 3 featureGroup différents. Ceux ci sont ajoutés dans un ordre précis faisant que les points sont toujours au dessus et donc cliquables