ISSUE:
With the implementation of objects/arrays and Feature Groups to dynamically access/hide/show features, the highlighting is no longer working properly. Now, when a feature (borough or neighborhood) is selected and then deselected - by choosing a different feature - the previously selected feature's highlight does not reset; it remains as if still affected by mouseover (hover). Upon a subsequent mouseover and mouseout, the highlight will reset appropriately.
THEORY:
The highlight and resetHighlight functions for these features are called during the corresponding onEachFeature functions. The onEachFeature functions are created during the L.geoJSON call and applied to a single layer (boroLayer or nbhdLayer). This surely fails to connect with the new implementation of Feature Groups and arrays of layers.
boroLayer = L.geoJSON(data, {
style: boroStyle, // function to set default styling
onEachFeature: onEachBoro // function to create borough interactivity
});
})```
ISSUE: With the implementation of objects/arrays and Feature Groups to dynamically access/hide/show features, the highlighting is no longer working properly. Now, when a feature (borough or neighborhood) is selected and then deselected - by choosing a different feature - the previously selected feature's highlight does not reset; it remains as if still affected by
mouseover
(hover). Upon a subsequentmouseover
andmouseout
, the highlight will reset appropriately.THEORY: The highlight and resetHighlight functions for these features are called during the corresponding onEachFeature functions. The onEachFeature functions are created during the L.geoJSON call and applied to a single layer (boroLayer or nbhdLayer). This surely fails to connect with the new implementation of Feature Groups and arrays of layers.