Question

I'm using the z weatherfeed plugin.

It already pulls most of the data from yweather api but I need the latitude and longitude.

The plugin gets the data for each item element like this for example:

html += '<div class="weatherCountry">'+ feed.location.country +'</div>';

However, if I try this...

html += '<div class="latitude">' + feed.item.geo.lat + '</div>';
html += '<div class="longitude">' + feed.item.geo.long + '</div>';

...it doesn't get the data for these elements.

How should I go about accessing both the geo:lat and geo:long?

Here's a live example: http://jsbin.com/sibafeke/1/edit

Was it helpful?

Solution

The data for geo:lat and geo:long can be accessed this way:

html += '<div class="latitude">' + feed.item.lat + '</div>';
html += '<div class="longitude">' + feed.item.long + '</div>';
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top