This code is designed to show markers on a map based on selected dates. Only the markers created during the chosen time period will be visible.
I am monitoring a value from an external JavaScript script called obj.dateRangeSlider("values")
.
as shown below;
//this function watches for changes in the time slider values and updates $scope.filteredMarks accordingly. It can also be expanded to include a search bar.
$scope.$watch(function () {
return obj.dateRangeSlider("values");
}, function (newValue, oldValue) {
$scope.filteredMarks = $filter("filter")($scope.marks, function(value, index){
if(value.date >= newValue.min && value.date <= newValue.max){
return true;
}
return false;
});
});
The filtered marks are then displayed on the webpage like so;
<ui-gmap-google-map center='map.center' zoom='map.zoom' ng-init="lat = 'observation_latitude'">
<ui-gmap-markers models="filteredMarks" coords="'self'" icon="'icon'" fit="true">
</ui-gmap-markers>
</ui-gmap-google-map>
However, I am encountering this error multiple times;
Error: [$rootScope:infdig] http://errors.angularjs.org/1.2.20/$rootScope/infdig?p0=10&p1=%5B%5B%22fn%3…return%20m%3Da%7D%3B%20newVal%3A%20%5B%5D%3B%20oldVal%3A%20%5B%5D%22%5D%5D
at Error (native)
at http://localhost:56499/Scripts/Angular/angular.min.js:6:450
at k.$digest (http://localhost:56499/Scripts/Angular/angular.min.js:110:38)
at k.$apply (http://localhost:56499/Scripts/Angular/angular.min.js:112:173)
at h (http://localhost:56499/Scripts/Angular/angular.min.js:72:454)
at w (http://localhost:56499/Scripts/Angular/angular.min.js:77:347)
at XMLHttpRequest.z.onreadystatechange (http://localhost:56499/Scripts/Angular/angular.min.js:78:420)
Returned from $scope.marks
:
> [Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]
>
> 0: Object
> date: "2014-11-30T23:21:44.823Z"
> id: 11
> latitude: -27.46009230397052
> longitude: 153.0309266845481
> __proto__: Object
> Object1:
> Object2:
> Object3:
> __proto__: Array[0]
I am unsure of the cause of this issue and would appreciate any hints or suggestions. More information can be provided if needed.
Thank you, Sean