2014-12-05 91 views
0

不能找到对<ui-gmap-markers>任何文件,只是想获得非常基本的标记信息窗口中的角

content = "<div><h3>Title</h3>Text here..</div>"添加上点击使用大量的标记时。所有文档都是用于单数标记。

$scope.change_type = function(val) { 
    content = "<div><h3>Title</h3>Text here..</div>" 
    $scope.markers = [] //clears the map 
    $scope.markers = Events.venues(val.type) 
} 

其中标志物的数据就像是

{options:{ title:"Barney's"},type:'Bar', latitude: 42.992538, longitude: -81.251819}

我已经中index.html

<script src='lib/lodash/dist/lodash.js'></script> 
<script src='lib/angular-google-maps/dist/angular-google-maps.js'></script> 
<script src='lib/addons/markerwithlabel.js'></script> 

回答

1

下面我希望这可以帮助你 - 我只是想出了如何利用今天的ui-gmap-markers,所以原谅任何粗糙的边缘。 我的HTML,它工作正常:

<ui-gmap-google-map center='main.map.center' zoom='main.map.zoom' options='main.map.options'> 
    <ui-gmap-markers models="main.markers" coords="'self'" icon="'icon'" options="'options'" click="'onClick'" fit="true"> 
     <ui-gmap-windows show="'showWindow'" closeClick="'closeClick'" ng-cloak> 
      <div data-ui-sref="display">                  
       <span data-ng-non-bindable>{{ title }}</span> 
      </div> 
     </ui-gmap-windows> 
    </ui-gmap-markers> 
</ui-gmap-google-map> 

在我的控制,我做的:

uiGmapGoogleMapApi.then(function(maps) { 
    var markers = []; 
    _.each(vm.itemlist,function(item){ 
     search.getGeometry(item.href).then(function(marker) { // I look up gps coord elsewhere 
      marker.id = item.href; 
      marker.showWindow = false; 
      marker.options = { 
           title: item.name, 
           icon: markericon.normal 
           }; 
      marker.onClick = function() { vm.markerClick(marker); }; 
      marker.closeClick = function() { vm.markerCloseClick(marker); }; 
      markers.push(marker); 
     });   
    });   
    vm.markers = markers; 
}); 

希望你从此得到一些线索..