9
wunderground의 api 인 Leaflet and Cloudmade를 사용하여지도 아이콘에 날씨 아이콘을 표시하려고합니다. 텍스트를 표시하고 아이콘 이미지로 변수를 가져 왔지만 표시 방법을 모르겠습니다. 여기 내 코드는 다음과 같습니다전단지 팝업 이미지 표시
jQuery(document).ready(function($) {
$.ajax({
url: "http://api.wunderground.com/api/cd48ac26fb540679/conditions/q/pws:KCASANFR128.json",
dataType: "jsonp",
success: function(parsed_json) {
var location = parsed_json['current_observation']['observation_location']['city'];
var temp_f = parsed_json['current_observation']['temp_f'];
var icon = parsed_json['current_observation']['icon_url'];
marker1.bindPopup("Current temperature in " +location+ " is: " + temp_f).openPopup();
}
});
});
내가 더 성공이 시도 :
marker1.bindPopup(<img src=icon> "Current temperature in " +location+ " is: " + temp_f).openPopup();
어떤 제안? 당신은뿐만 아니라 따옴표 태그를 둘러싸고해야합니다 있도록