As somebody succeeded including openweather n leafltejs?
I developed this map:
http://lucamoiana.github.io/stresa/
And I was wondering how to include in leaflet-control-container the current weather or forecast.
how would you do?
tahnks
function myOwmMarker(data) { // just a Leaflet default marker return L.marker([data.coord.lat, data.coord.lon]); }
But how??
Have a great day
So, it looks like the easiest way would be to use By geographic coordinates in HTML and include it on the
info.update = function (props) {
this._div.innerHTML = '<h4><span style="text-align:center"><h2>Stresa Night Trail - 2014</h2><h3>Lago Maggiore Trail ©</h3></span></h4>';
};
but I can’t get it to work nor pasting the link (http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&mode=html) in a plain <div> nor using <iframe>.
Any help??
thanks for your help
<div id="placeholder"></div>
$.getJSON('http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139', function(data) {
$('#placeholder').html("<p>Description="+data.weather[0].main+" <br>Country="+data.sys.country+"<br> Max temp="+data.main.temp_max+"</p>");
});