angular-google-maps
angular-google-maps copied to clipboard
ui-gmap-map-control with issues on ng-repeat
When I try to use ng-repeat inside ui-gmap-map-control it calls three times. It doesn't matter if the controller of ui-gmap-map-control is in another file, or if its the same controller as the directive that I've made. If I don't use ng-repeat and use the positions in the array, like: filtrosRegiao[0], filtrosRegiao[1]... It works fine. How can I use ng-repeat?
<ui-gmap-map-control position="left">
<div>
<ul class="maps__mapa-filtro__list">
<li class="maps__mapa-filtro__list__item"
ng-class="{'maps__mapa-filtro__list__item--selected' : filtroRegiao.valor == filtroSelecionado.filtroRegiao.valor}"
ng-repeat="filtroRegiao in filtrosRegiao">
<a ng-click="maps.mudaRegiaoSelecionada(filtroRegiao.valor)">
{{ filtroRegiao.label }}
({{ filtroRegiao.qtde }} escolas)
</a>
</li>
</ul>
</div>
</ui-gmap-map-control>
M4rkux,
I had the same issue and was able to fix by putting a ng-if="!initialize" on the div inside the control and set in controller $scope.initialize = true; then at uiGmapIsReady.promise().then(function (instances) { $scope.initialize = false; });