Angularjs 使用infowindow创建地图集群
我正在尝试在集群上显示infowindow。我的问题是,infowindow的显示距离集群很远,而不在集群上 以下是我将单击事件添加到集群的方式:Angularjs 使用infowindow创建地图集群,angularjs,google-maps,ng-map,Angularjs,Google Maps,Ng Map,我正在尝试在集群上显示infowindow。我的问题是,infowindow的显示距离集群很远,而不在集群上 以下是我将单击事件添加到集群的方式: $scope.markerCluster = new MarkerClusterer(map, markers); google.maps.event.addListener($scope.markerCluster, 'clusterclick', function(cluster) {
$scope.markerCluster = new MarkerClusterer(map, markers);
google.maps.event.addListener($scope.markerCluster, 'clusterclick', function(cluster) {
$scope.map.showInfoWindow('bar', $scope.markerCluster);
console.log("cluster click");
});
要在标记群集上定位信息窗口,需要显式调用,例如:
google.maps.event.addListener($scope.markerCluster, 'clusterclick', function (cluster) {
var infoWindow = $scope.map.infoWindows["myInfoWindow"]; //get infoWindow instance
infoWindow.setPosition(cluster.getCenter()); //<-set position
$scope.map.showInfoWindow('myInfoWindow', cluster);
});
{{content}}
当群集最大化缩放以显示特定标记时,是否可能?