2015-04-30 127 views
0

我已经在这个角度指令的Marker API guide读到的一切,但我不能显示在地图上的标记。角谷歌,地图不显示标记在地图上

这里的HTML代码:

<ui-gmap-google-map center='map.center' zoom="map.zoom" draggable="false" options="options"> 
    <ui-gmap-markers models="marker.id" coords="marker.coords" icon="marker.options.icon"></ui-gmap-markers> 
</ui-gmap-google-map> 

,这是处理地图对象,所述控制器:

angular.module( 'twoSpecials') .controller( 'MapCtrl',函数($范围,uiGmapGoogleMapApi){

$scope.map = { 

    center: { 
     latitude : 45.5674402, 
     longitude: 12.4277687 
    }, 
    zoom: 15   
} 

$scope.options = {scrollwheel: false, 
        styles: [ 
          { 
          "featureType": "landscape.natural", 
          "stylers": [ 
           { "saturation": 100 }, 
           { "weight": 0.1 }, 
           { "hue": "#0077ff" }, 
           { "color": "#f5f5dc" } 
          ] 
          } 
          ], 
        disableDefaultUI: true, 
       }; 

$scope.marker = { 
    id : 0, 
    coords : { 
     latitude : 45.5674402, 
     longitude: 12.4277687 
    }, 
    options: { 
     icon: 'images/marker.jpg' 
    } 

} 
    }); 

由于我使用Yeomann,我已经建立使用该工具的角度应用程序,我已经把标记图标中的“图片”文件夹Yeomann创造。我必须将图像放入另一个文件夹吗?我是否以错误的方式使用此指令?

回答

0

你的UI-GMAP的标志图标的属性是不正确。试试icon =“marker.options.icon”。

+0

不显示,即使在这种情况下。你有任何线索吗? –

+0

嗯你能提供一个小提琴吗? – gerl