2015-06-12 149 views
0

我的地图只是部分加载地图控件,但不能造成实际的地图:角谷歌,地图没有绘制的地图,只要在地图控制

enter image description here

我都装入了正确的依赖关系,作为指导,使用this

我的HTML:

<div class="col-xs-3"> 
    <ui-gmap-google-map center="vm.map.center" zoom="vm.map.zoom"> 
     <ui-gmap-layer type="TrafficLayer" show="vm.map.showTraffic"></ui-gmap-layer> 
    </ui-gmap-google-map> 
</div> 

我使用的建议uiGmapGoogleMapApiProvider供应商,以保证角谷歌,地图不开始处理任何指令,直到所有的谷歌地图SDK是完全准备好:

angular.module('app', [ 
    'uiGmapgoogle-maps', 
]).config(config) 

config.$inject = ['uiGmapGoogleMapApiProvider']; 

function config(uiGmapGoogleMapApiProvider) { 
    uiGmapGoogleMapApiProvider.configure({ 
     v: '3.17', 
     libraries: 'weather,geometry,visualizations' 
}) 

}

我的控制器内我的角地图模型:

uiGmapGoogleMapApi.then(function(maps) { 
     console.log(maps, "MAPS"); 
     vm.map = {center: {latitude: 45, logitude: -73}, zoom:8, showTraffic: true, show: true} 
    }) 

为什么我的地图细节不显示?

谢谢!

+0

你好,你的控制台有错误吗? – user1713964

+0

我的控制台没有错误:( –

回答

1

增加了一些基本选项和wa-lah!

uiGmapGoogleMapApi.then(function(maps) { 
     console.log(maps, "MAPS"); 
     var baseOptions = { 
      'maxZoom': 15, 
      'minZoom': 4, 
      'backgroundColor': '#b0d1d4', 
      'panControl': false, 
      'zoomControl': true, 
      'draggable': true, 
      'zoomControlOptions': { 
       'position': 'RIGHT_TOP', 
       'style': 'SMALL' 
      } 
     }; 
     console.log("here") 
     vm.map = {center: {latitude: 51.219053, longitude: 4.404418}, options:baseOptions, zoom:8, showTraffic: true, show: true} 

    })