allenhwkim/angularjs-google-maps

NgMap.getMap( segmentId ) not working if id attr contains expression

Opened this issue · 0 comments

My map is defined as:
<ng-map id="{{box.id}}_map" center="{{box.center}}"></ng-map>

Ng.getMap( "4342342_map" ) can however not return this map, because in addMap the mapCtrl.map.id is undefined. I could debug so far, but I don't know how to fix this to be honest. I guess the expression is not being evaluated.

  var addMap = function(mapCtrl) {
    if (mapCtrl.map) {
      var len = Object.keys(mapControllers).length;
      mapControllers[mapCtrl.map.id || len] = mapCtrl;
    }
  };