0

我正在使用库angular-google-maps但是当我从标记数组中推送或删除标记时,它似乎没有更新标记,这在下面的 plnker 中演示。控制台显示已添加一个新标记,而这并未反映在地图上。

http://plnkr.co/edit/Si5tANvbU8Fro14OC4ny?p=preview

$scope.addPlace = function() {

       $scope.places.push({
        id: 3,
        latitude: 42,
        longitude: -79
      });

      console.log($scope.places);

  };
4

1 回答 1

1

你需要 modelsbyref在 指令false中设置ui-gmap-markers

 <ui-gmap-markers models="places" coords="'self'" modelsbyref="false">  

   </ui-gmap-markers>
于 2015-03-28T19:52:39.673 回答