Search for specific name onEachFeature

Update your code to add hardcoded style:

function oef(feature, layer) {
    if (feature.properties && feature.properties.name) {
        layer.bindTooltip(feature.properties.name, {
            opacity: 1.00,
            direction: 'top',
            offset: [0, -7]
        });
        
        if(feature.properties.name === "* Testing"){
            layer.setStyle({
                color: "LightSkyBlue"
            })
        }
    }
}

But I recommand to readout the umap options:

function oef(feature, layer) {
    if (feature.properties && feature.properties.name) {
        layer.bindTooltip(feature.properties.name, {
            opacity: 1.00,
            direction: 'top',
            offset: [0, -7]
        });
        
        if(feature.properties.name === "* Testing"){
            layer.setStyle(feature.properties._umap_options);
        }
    }
}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top