ojamas / nyc-street-parking

Interactive map for viewing NYC street parking regulations
2 stars 0 forks source link

Feature Highlighting #7

Open ojamas opened 7 years ago

ojamas commented 7 years ago

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
        });
    })```