Last active
June 10, 2021 06:52
-
-
Save cladjidane/9870d941a8ea3524f4c3e443f3dde28f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Permet de filtrer les features d'un layer pour affecter leur parametres */ | |
/* Il est possible avec ça de masquer que les feature.properties.cat = "cat1" */ | |
// https://stackoverflow.com/questions/59181258/how-to-use-mapbox-expressions-to-toggle-layer-class-styles/59185488#59185488 | |
map.setLayoutProperty("points", "icon-image", [ | |
"match", // Si match | |
["get", "id"], // properties.id | |
e.features[0].properties.id, // est égal à une variable passée, ici via un click sur une feature | |
"hu-motorway-2", // On défini l'option "Icon Image" avec cette valeur | |
"hu-main-2", // Si non on utilise celle là | |
] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
J'ai essayé de filtrer sur l'attribut "id" au dessus de "properties" ... sans succès.
J'ai essayé ça
map.setPaintProperty("game_step", "circle-radius", [ "case", ["==", ["id"], stepAfter.id], 40, 5, ]);