【发布时间】:2015-09-07 17:32:02
【问题描述】:
我正在使用 google 'idle' 事件侦听器在地图上上传标记(使用 angularjs)。我的代码是
$scope.LoadSearchPropertyOnPortFolioSales = function (PropertyName) {
if(PropertyName == ''){
google.maps.event.addListener(map, 'idle', function () {
var PropertyList = PropertyService.GetSearchPropertyForPortfolio($scope.PortfolioId, $scope.PropertyName, this.center.lat(), this.center.lng(), 0.005, 0.005);
PropertyList.then(function (pl) {
DrawPropertyOnPortFolioSale(pl.data, $scope.PropertyName);
},
});
}
else
{
//Stop event listener
}
}
我希望事件侦听器仅在传递的 PropertyName 没有值时工作。但是当 PropertyName 有一些价值时,我想停止事件监听器。我如何停止事件监听器......
【问题讨论】:
标签: javascript angularjs google-maps