-
我使用了有角度的谷歌 Map 来显示多个标记,并使用fit = "true"来显示单个视图中的所有标记 .
-
但是在缩放到特定标记时,单击标记时, Map 会缩小到默认拟合中心以显示infoWindow,而不是在放大位置本身显示infoWindow .
-
Code Snippet(这是我定义谷歌 Map 而不是整个代码的页面的一部分):
<ui-gmap-google-map center="mapView.viewPort.center" zoom="mapView.viewPort.zoom" options="mapView.options">
<ui-gmap-markers fit="true" models="mapView.markers.notes" coords="'self'" idkey="'id'" doCluster="true" clusterOptions={maxZoom:20,averageCenter:true,styles:[{url:'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m5.png',height:90,width:90},]} icon="'icon'">
<ui-gmap-windows templateUrl="'template'" templateParameter="'templateParam'">
</ui-gmap-windows>
</ui-gmap-markers>
</ui-gmap-google-map>
-
mapView.markers.notes包含一个json数组,该数组由与每个音符相关的信息组成,例如id,contents等 .
-
我试过这个没有使用fit =“true”并且它工作得很好但我也希望 Map 调整以查看第一个视图中的所有标记,所以我也需要使用fit =“true” .
1 回答
通过使用较旧版本的角度谷歌 Map 解决了这个问题,这是2.1.3以上版本的问题,其中它没有正确支持图标属性中的更多细节而不是网址 . 我在github上提出了与此相对应的问题,网址为:
https://github.com/angular-ui/angular-google-maps/issues/1785