質問

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);
            }
        }
    });
役に立ちましたか?

解決

Solution:

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top