I have a geojson layer. I set the style of some features based on property values. It displays correctly. When "highlight" on a mouseover it changes style to highlight correctly, when I mouseout it changes the style back to the default blue and not the changes made based on property values. As can be seen in the code, I have tried both L.Util.setOption and layer.setStyle. There is no difference with either. Help please.

var schemaL = new L.GeoJSON(schema, {
 onEachFeature:  schemaConvert,

 function schemaConvert(feature,layer) {

  function getOptions(properties) {
     if ((properties.CodeLink == '14159500' && properties.PerFlow > 15) || 
         (properties.CodeLink == '14162200' && properties.PerFlow >1) || 
         (properties.CodeLink == '14158850' && properties.PerFlow > 5)) {
        return {
        weight: 6,
        color: "red",
        fillColor: "#FFCC00"

//  L.Util.setOptions(layer,  (getOptions(feature.properties)));

            mouseout: function(e) {

          mouseover: highlightFeature,


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.