【问题标题】:How to use google maps api v3 in nyromodal如何在 nyromodal 中使用谷歌地图 api v3
【发布时间】:2013-03-21 17:28:43
【问题描述】:

我试图在我的 nyromodal 框中嵌入一个地图 sing google maps api v3,但它没有发生。

我已经测试了没有模态的代码,它可以工作,但是当我尝试在 nyromodal 上打开它时,什么都没有出现。

我该怎么做?

【问题讨论】:

    标签: php jquery google-maps-api-3 nyromodal


    【解决方案1】:

    我刚刚想出了怎么做!

    1 - 在您的索引页面中插入 google 的 js 代码,使用 'rel="forceload"' 和 'rev="shown"' 如下:

    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=false" rel="forceload" rev="shown"></script>

    2 - 在模态页面中插入生成地图的代码,如下所示:

    <script>
        $(document).ready({
            var mylatlng = new google.maps.LatLng(latitude, longitude);
            var mapProp = {
                center: mylatlng,
                zoom: 15,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            var map = new google.maps.Map(document.getElementById("briefmap"), mapProp);
            var marker = new google.maps.Marker({
                position: mylatlng
            });
        });
    </script>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-03
      • 2014-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-09
      相关资源
      最近更新 更多