nationalparkservice/npmap.js — pull request #180 by ryanjhodge (2014-12-30 04:07:26+00:00)
Title: Fix layer/spot.js to work with single features

While working a spot feed map, I noticed that the spot layer would only work when there were more than one message (i.e. point feature) in the spot xml feed. What I think was going on is that in this scenario, the messages property was not an Array, so so the "messages.length" was returning undefined in the For loop expression that adds the spot points to the geojson Features array.

I added an if statement that tests if the count property of the feedMessageResponse is equal to 1, and if so it pushes the single feature to the Feature Array of the geoJson variable, using the messages property.