0

Example:

http://jsfiddle.net/7Cwbn/60/

I'm trying to use array_diff function from PHPJS to check if all of the elements inside selectedFeatures are found inside elem.features, but instead I receive undefined. What gives?

$(markers.houses).each(function(index, elem) {
        //first filter by selected features
        console.log(array_diff(elem.features, selectedFeatures).length);
        if (array_diff(selectedFeatures, elem.features).length == 0) {
            if (!markers.houseMarkers[index].visible) {
                markers.houseMarkers[index].setVisible(true);
            }
        }
    });
4

1 回答 1

1

Solution:

Inside array_diff() definition change the retVal to equal [] instead of {}.

于 2012-06-15T19:31:46.217 回答