如何将圆形叠加更改为图像?
这是我的代码MainActivity扩展了Circle Overlay的MapActivity代码:
ListOverlay listOverlay = new ListOverlay();
List<OverlayItem> overlayItems = listOverlay.getOverlayItems();
Cursor campgroundList = campgroundDB.getCampgrounds();
if(campgroundList != null) {
while(campgroundList.moveToNext()) {
GeoPoint campgroundLocation = new GeoPoint(campgroundList.getDouble(campgroundList.getColumnIndex("latitude")),campgroundList.getDouble(campgroundList.getColumnIndex("longitude")));
//if(shouldShowCampground(campgroundLocation)) {
Circle circle = showCampground(campgroundLocation);
//overlayItems.setMarker(defaultMarker);
overlayItems.add(circle);
//}
}
}
mapView.getOverlays().add(listOverlay);
private static Circle showCampground(GeoPoint location) {
Paint paintFill = new Paint(Paint.ANTI_ALIAS_FLAG);
paintFill.setStyle(Paint.Style.FILL);
paintFill.setColor(Color.MAGENTA);
paintFill.setAlpha(64);
Paint paintStroke = new Paint(Paint.ANTI_ALIAS_FLAG);
paintStroke.setStyle(Paint.Style.STROKE);
paintStroke.setColor(Color.MAGENTA);
paintStroke.setAlpha(128);
paintStroke.setStrokeWidth(3);
return new Circle(location, 200, paintFill, paintStroke);
}