을 가지고지도보기을 빠르게 수행되기 때문에 내 캔버스지도보기 의 가시의 구형 내에 뭔가를 그릴 수 있는지 알고 다음과 같은 오버레이 :
기본적으로 캔버스를 사용하여 backgroundImage에 customImage를 적용해야합니다. 이 구현을 사용하면 효과적으로 'ItemizedOverlay'에 대한 마커로 지정할 수있는 캔버스에서 BitmapDrawable을 효과적으로 만들 수 있습니다. 이것이 당신이 찾고 있던 항목 화 된 오버레이 유형이라면 항목 화 된 오버레이 클래스의 그리기 기능을 오버라이드 할 필요가 없습니다. 다음 코드를 사용하여 생성자에서 ItemizedOverlay에 할당 할 수있는 BitmapDrawable을 만드는 것뿐입니다. 그들은 그냥 같이지도하거나 말든 항목 반복하고 확인하여 내가 지금 이런 짓을
public BitmapDrawable imageOnDrawable(int drawableBackground, Bitmap customImage)
{
//The following line is optional but I'd advise you to minimize the size of
//the size of the bitmap (using a thumbnail) in order to improve draw
//performance of the overlays (especially if you are creating a lot of overlays).
Bitmap customImageThumbnail = ThumbnailUtils.extractThumbnail(
customImage, 100, 100);
Bitmap bm = BitmapFactory.decodeResource(getResources(), drawableId);
bm = Bitmap.createScaledBitmap(bm, 112, 120, false);
Canvas canvas = new Canvas(bm);
canvas.drawBitmap(bm, 0, 0, null);
// The 6,6 in the below line refer to the offset of the customImage/Thumbnail
// from the top-left corner of the background box (or whatever you want to use
// as your background)
canvas.drawBitmap(customImageThumbnail, 6, 6, null);
return new BitmapDrawable(bm);
}
질문하지 .Did 유 여기에 있다고 할 수있는 기능입니다 자세히 설명해 주시겠습니까? – saravanan