Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 多边形指令不考虑可见属性_Angularjs_Google Maps Api 3_Angular Google Maps - Fatal编程技术网

Angularjs 多边形指令不考虑可见属性

Angularjs 多边形指令不考虑可见属性,angularjs,google-maps-api-3,angular-google-maps,Angularjs,Google Maps Api 3,Angular Google Maps,我正试图使用该模块在google地图上显示多边形,但当修改模型的visible属性时,uiGmapPolygons指令没有隐藏/显示 下面是一个例子来说明这个问题: 标记: <ui-gmap-google-map center="map.center" zoom="map.zoom" draggable="true" options="options" bounds="map.bounds"> <ui-gmap-polygons models="polygons" p

我正试图使用该模块在google地图上显示多边形,但当修改模型的visible属性时,uiGmapPolygons指令没有隐藏/显示

下面是一个例子来说明这个问题:

标记:

<ui-gmap-google-map center="map.center" zoom="map.zoom" draggable="true" options="options" bounds="map.bounds">
    <ui-gmap-polygons models="polygons" path="'path'" stroke="'stroke'" visible="'visible'" fill="{ color: '#2c8aa7', opacity: '0.3' }">
    </ui-gmap-polygons>
     <ui-gmap-markers models="markers" idKey="'id'" options="'options'" coords="'coords'"></ui-gmap-markers>        
</ui-gmap-google-map>
我希望当我更改visible属性时,多边形将显示/隐藏

我不确定是否发现了错误,或者是否试图错误地调整多边形的可见性

编辑:

几天前,我提交了一个关于模块github repo的问题,昨晚得到了一个回复,在版本2.0.11中解决了这个问题。不幸的是,我使用的是2.0.12版

链接到围绕该问题的github讨论:

https://github.com/angular-ui/angular-google-maps/issues/1059
在控制器中

$scope.showPolygon = false;
$scope.toggelPolygon = function(){$scope.showPolygon=!$scope.showPolygon};
在您的ui gmap多边形中

visible='showPolygon'

投稿人nmccready在一月份修复了这个问题,但那时我已经放弃了谷歌地图。

有同样的问题。你发现什么了吗?我几天前在github上提交了一个问题,昨天刚收到回复。评论者找到了一个可能的解决方案,但在版本2.0.12中似乎无法解决该问题。
visible='showPolygon'