简体   繁体   中英

Show Map on bootstrap modal

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM