【发布时间】:2015-08-10 13:12:09
【问题描述】:
当我点击打开热图时,我试图关闭我的地图标记。
我的标记对象如下所示:
var markers = {
id: id,
displayId: displayId,
latitude: job.geolocation.location.latitude,
longitude: job.geolocation.location.longitude,
icon: icon,
options: {
title: 'ID: ' + displayId,
visible: showMarkers
}
我默认 showMarkers 为 true:
var showMarkers = true;
然后在我的热图点击处理程序中,我将 showMarkers 更改为 false:
vm.turnOnHeat = function() {
vm.showHeat = true;
showMarkers = false;
};
但是,标记永远不会消失。我很困惑为什么markers.options.visible 从来没有接受过这个改变。
【问题讨论】:
-
您是否尝试过使用 $scope 变量而不是 local($scope.markers)?
标签: javascript angularjs google-maps angular-google-maps