-
구글맵 클러스터 색깔 변경안드로이드 2016. 2. 2. 00:08
다음과 같이 하면 되는걸 확인했습니다.
public class MyRenderer extends DefaultClusterRenderer<CompanyItem> {
@Override
protected void onBeforeClusterRendered(Cluster<CompanyItem> cluster, MarkerOptions markerOptions){
// Main color
int clusterColor = mContext.getResources().getColor(R.color.primary);
int bucket = this.getBucket(cluster);
BitmapDescriptor descriptor = this.mIcons.get(bucket);
if(descriptor == null) {
this.mColoredCircleBackground.getPaint().setColor(clusterColor);
descriptor = BitmapDescriptorFactory.fromBitmap(
this.mIconGenerator.makeIcon(this.getClusterText(bucket)));
this.mIcons.put(bucket, descriptor);
}
markerOptions.icon(descriptor);
}
}
시간이 없어서.. 설명은 생략ㅋ
'안드로이드' 카테고리의 다른 글
안드로이드 스크롤 화면 캡쳐 구현 (0) 2016.02.25 java arraylist class 객체 오름차순, 내림차순 정렬 (0) 2016.02.02 strings.xml 에서 특수문자 사용하기 (0) 2016.01.26 otto 이벤트버스 사용 (0) 2016.01.20 PagerAdapter 에서 뷰 혹은 데이터 갱신하는 법 (0) 2016.01.19