NgMap cluster change markers colors after zoom

两盒软妹~` 提交于 2019-12-02 08:57:59

I solved the problem!

If anyone has the same problem, the solution is in adding the icon filed when pushing new a marker:

NgMap.getMap().then(function (map) {
                for (var i = 0; i < $scope.paths.length; i++) {
                    var latLng = new google.maps.LatLng($scope.paths[i].positions[0], $scope.paths[i].positions[1]);
                    $scope.dynMarkers.push(new google.maps.Marker({position: latLng, icon: $scope.paths[i].icon}));
                }
                $scope.markerClusterer = new MarkerClusterer(map, $scope.dynMarkers, {});
            });
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!