【问题标题】:How to Filter Markers with Angular-Leaflet-Directive and a Custom Filter如何使用 Angular-Leaflet-Directive 和自定义过滤器过滤标记
【发布时间】:2023-03-19 13:42:01
【问题描述】:

我正在使用 Angular-Leaflet 指令并试图弄清楚如何使用来自输入文本框的数据和标记对象的数据属性来过滤标记。我尝试的一切都会导致角度无限的摘要循环。

这是我目前所拥有的:

var app = angular.module('mapApp', ['leaflet-directive']);

//Filter
$scope.filterTerm;

//Controller
    app.controller("mapController", ['$scope', function ($scope) {

        $scope.center = {
            lat: 53.4239,
            lng: -7.9407,
            zoom: 7
        };
        //declare sample points
        $scope.samplePoints = [
              {
                  lat: 53.37,
                  lng: -9.48,
                  data : 'K',
                  hidden: true
              },
            {
                lat: 54.2314131,
                lng: -8.5744558,
                data: 'L',
                hidden: true
            }
        ];

    }]);

还有html

 <input type="text" ng-model="filterTerm" />

 <leaflet center="center" markers="markers| markers="markers | filter: filterTerm " style="height: 900px;"></leaflet>

我已经使用了this Stack Overflow 的答案,并且已经尝试了几个小时,但我尝试的所有内容都得到了同样的错误。非常感谢您的帮助。

【问题讨论】:

标签: angularjs leaflet angular-leaflet-directive


【解决方案1】:

这是 Visual Studio 2013 的问题 - 我执行了 Visual Studio 2013 的全新安装并解决了问题。

【讨论】:

    猜你喜欢
    • 2023-03-03
    • 1970-01-01
    • 1970-01-01
    • 2019-12-08
    • 2016-12-26
    • 2015-04-26
    • 1970-01-01
    • 2016-04-17
    • 1970-01-01
    相关资源
    最近更新 更多