1
在我的情況集羣custome圖像是白色的背景,我需要改變文本的顏色,使其更小如何更改GoogleMaps iOS中羣集標記的標題顏色和大小?
- (void)configureMap {
// Set up the cluster manager with a supplied icon generator and renderer.
id<GMUClusterAlgorithm> algorithm = [[GMUNonHierarchicalDistanceBasedAlgorithm alloc] init];
id<GMUClusterIconGenerator> iconGenerator = [self iconGeneratorWithImages];
id<GMUClusterRenderer> renderer = [[GMUDefaultClusterRenderer alloc] initWithMapView:_mapView clusterIconGenerator:iconGenerator];
_clusterManager = [[GMUClusterManager alloc] initWithMap:_mapView
algorithm:algorithm
renderer:renderer];
}
- (id<GMUClusterIconGenerator>)iconGeneratorWithImages {
UIImage *clusterImage = [UIImage imageNamed:@"customClusterImage"];
return [[GMUDefaultClusterIconGenerator alloc] initWithBuckets:@[@10, @50, @100, @200, @1000]
backgroundImages:@[clusterImage, clusterImage, clusterImage, clusterImage, clusterImage]
];
}
UPD:沒有答案在這裏:https://github.com/googlemaps/google-maps-ios-utils/issues/127
網址:「https://googlemaps.github.io/js-marker-clusterer/images/m1.png」, width:53, height:53, fontFamily:「comic sans ms」, textSize:15, textColor:「red」, // color:#00FF00, }] –
請查看[Marker Clustering]的文檔(https://developers.google.com/maps/documentation/ios-sdk/utility/marker-clustering),請閱讀「自定義標記羣集」部分。 – Priyal