在启动模式下显示地图 [英] Show Map on bootstrap modal

查看:101
本文介绍了在启动模式下显示地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在引导模式中显示一个新的Google地图,但似乎不起作用。请帮助

$ scope.show = function(lat,long){$ ('#body')。append('< div id =map>< / div>)在这里输入代码$ scope.newMap = new google.maps.Map(document.getElementById('map')) ,{zoom:14,center:{lat:37.77,lng:-122.447},mapTypeId:'roadmap'});

解决方案

不是我的代码,但是这里有一个你想要的实例 - plnkr



这个例子使用模块'ngMap',它有指令'map',
如需了解更多信息,请参阅 ngMap 主页。

I want to show a new google map on a bootstrap modal but it doesnt seem to work. please help

$scope.show = function (lat, long) {
        $('#body').append('<div id="map"></div>')
        enter code here$scope.newMap=new google.maps.Map(document.getElementById('map'), {
            zoom: 14,
            center: {lat: 37.77, lng: -122.447},
            mapTypeId:'roadmap'
        });

解决方案

Not my code but here's a working example of what you want - plnkr

This example uses the module 'ngMap' which has the directive 'map', For more you can see the ngMap home page.

这篇关于在启动模式下显示地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆