fix looping through hash object in IE8 (indexOf is a property of object)

When looping an object in Javascript in IE8, check for ```layerArray.hasOwnProperty(property)```

In IE8, object has indexOf and it will loop through that method causing errors.