I'm using NgMap and angular 1 to display a google map, and draw various shapes on it. I'm trying to change the color of the shape dynamically, by changing a scope variable.
In the template I have:
<shape id="circle" name="circle" fill-color='{{circle.color}}' stroke-color='{{circle.color}}' stroke-opacity="0.8" stroke-weight="2" center="[41,-87]" radius="4000" editable="false">
</shape>
and in the controller I create an object:
function CircleColorTestController($scope, $interval) {
$scope.circle = {
color: '#00FF00'
};
var colors = ['#FF0000', '#00FF00', '#0000FF'];
var i = 0;
$interval(function() {
$scope.circle.color = colors[i];
console.log('Changing color to: ' + $scope.circle.color);
++i;
if (i > 2) {
i = 0;
}
}, 1000);
}
Check out this plunkr: https://plnkr.co/edit/nx5i5h
The color of the circle should change every second, but it remains green. Is it even possible with NgMap? Is it a bug?
Thanks!