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);
            }
        }
    });
Bob
  • 1,355
  • 5
  • 19
  • 38

1 Answers1

1

Solution:

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

Bob
  • 1,355
  • 5
  • 19
  • 38