• <small id='uhqql'></small><noframes id='uhqql'>

      • <bdo id='uhqql'></bdo><ul id='uhqql'></ul>

    1. <i id='uhqql'><tr id='uhqql'><dt id='uhqql'><q id='uhqql'><span id='uhqql'><b id='uhqql'><form id='uhqql'><ins id='uhqql'></ins><ul id='uhqql'></ul><sub id='uhqql'></sub></form><legend id='uhqql'></legend><bdo id='uhqql'><pre id='uhqql'><center id='uhqql'></center></pre></bdo></b><th id='uhqql'></th></span></q></dt></tr></i><div id='uhqql'><tfoot id='uhqql'></tfoot><dl id='uhqql'><fieldset id='uhqql'></fieldset></dl></div>
      <legend id='uhqql'><style id='uhqql'><dir id='uhqql'><q id='uhqql'></q></dir></style></legend>
        <tfoot id='uhqql'></tfoot>

        在传单弹出窗口中显示图像

        时间:2023-08-08
        • <small id='KoNN2'></small><noframes id='KoNN2'>

            <tbody id='KoNN2'></tbody>

          1. <i id='KoNN2'><tr id='KoNN2'><dt id='KoNN2'><q id='KoNN2'><span id='KoNN2'><b id='KoNN2'><form id='KoNN2'><ins id='KoNN2'></ins><ul id='KoNN2'></ul><sub id='KoNN2'></sub></form><legend id='KoNN2'></legend><bdo id='KoNN2'><pre id='KoNN2'><center id='KoNN2'></center></pre></bdo></b><th id='KoNN2'></th></span></q></dt></tr></i><div id='KoNN2'><tfoot id='KoNN2'></tfoot><dl id='KoNN2'><fieldset id='KoNN2'></fieldset></dl></div>

              <bdo id='KoNN2'></bdo><ul id='KoNN2'></ul>
              <legend id='KoNN2'><style id='KoNN2'><dir id='KoNN2'><q id='KoNN2'></q></dir></style></legend>

                1. <tfoot id='KoNN2'></tfoot>
                  本文介绍了在传单弹出窗口中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试使用 wunderground 的 API、Leaflet 和 Cloudmade 让天气图标显示在地图标记中.我已经显示了文本和带有图标图像的变量,但我不确定如何显示它.这是我的代码:

                  I'm trying to get the weather icon to show in a map marker using wunderground's api, Leaflet and Cloudmade. I've got the text showing and a variable with the icon image, but I'm not sure how to get it to show. Here's my code:

                  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();
                  

                  有什么建议吗?

                  推荐答案

                  标记的 bindPopup 方法只是将 HTML 内容作为一个字符串,所以你也需要用引号将你的标签括起来 - 比如

                  The marker's bindPopup method just takes HTML content as a string, so you'll need to surround your tags with quotes as well - something like

                  marker1.bindPopup( "<img src=" + icon_url + "/> Current temperature in " + location + " is: " + temp_f)
                  

                  应该适合你.

                  这篇关于在传单弹出窗口中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何从地图外的链接打开传单标记弹出窗口? 下一篇:传单:添加标记的链接

                  相关文章

                  最新文章

                      <legend id='c8mVx'><style id='c8mVx'><dir id='c8mVx'><q id='c8mVx'></q></dir></style></legend>
                    1. <tfoot id='c8mVx'></tfoot>

                    2. <small id='c8mVx'></small><noframes id='c8mVx'>

                      <i id='c8mVx'><tr id='c8mVx'><dt id='c8mVx'><q id='c8mVx'><span id='c8mVx'><b id='c8mVx'><form id='c8mVx'><ins id='c8mVx'></ins><ul id='c8mVx'></ul><sub id='c8mVx'></sub></form><legend id='c8mVx'></legend><bdo id='c8mVx'><pre id='c8mVx'><center id='c8mVx'></center></pre></bdo></b><th id='c8mVx'></th></span></q></dt></tr></i><div id='c8mVx'><tfoot id='c8mVx'></tfoot><dl id='c8mVx'><fieldset id='c8mVx'></fieldset></dl></div>
                        <bdo id='c8mVx'></bdo><ul id='c8mVx'></ul>