Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function forEachFeature(feature, layer) {
- var popupContent = "<p> <b>" + feature.properties.name +
- "</b></br>"+ feature.properties.adress +
- "</br></br>"+ feature.properties.openings + "</p>";
- var coords = feature.geometry.coordinates.toString();
- var cArr = coords.split(",");
- let lat = cArr[1];
- let lon = cArr[0];
- var weather = "";
- $.getJSON("http://api.openweathermap.org/data/2.5/weather?lat="+lat+"&lon="+lon+"&&units=metric&APPID=30af4e59addaddcb8c5f04f21be6da79", function(result){
- weather = "Väder: "+result.main.temp + "°c";
- popupContent += weather;
- layer.bindPopup(popupContent);
- //alert("Weather: "+ result.list[0].weather[0].description)
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement