martenwilmink / reframe-brain

0 stars 0 forks source link

Ability to style markers based on properties #1

Open martenwilmink opened 3 weeks ago

martenwilmink commented 3 weeks ago

Issue description (i)

For the dataset Mineral Showings we have many markers that represent different types of resources like Gold, Silver, Copper, Lead etc. These are all defined as a property of the marker. It would be great if we are able to style the markers based on these properties.

New specification (i)

New design (i)

sgpc-map-deposits-cluster

Additional information

Adding something like this in code or elsewhere:

L.geoJSON(geoJsonMiningSites, {
    style: function(feature) {
        switch (feature.properties.ACOMMODITY) {
            case 'Amethyst':   return {color: "#6C2DC7"};
            case 'Gold': return {color: "#FFD700"};
            case 'Lead':   return {color: "#382969"};
        case 'Silver': returen {color: "#C0C0C0"}
        }
    }

TODO


/label ~"Workflow::Specification"

hugopeek commented 2 weeks ago

@martenwilmink The current markers are PNG images, so we can't set their colors like with the example snippet above.

I'll try to change them into custom markers. Maybe a plugin such as https://github.com/coryasilva/Leaflet.ExtraMarkers is all we need.

martenwilmink commented 2 weeks ago

@martenwilmink The current markers are PNG images, so we can't set their colors like with the example snippet above.

I'll try to change them into custom markers. Maybe a plugin such as https://github.com/coryasilva/Leaflet.ExtraMarkers is all we need.

Nice! Yes, I also came across that plugin. I do wonder: