Android-如何在自定义MyLocationOverlay中添加阴影
我想为MyLocationOverlay的自定义标记添加阴影。我已尝试使用以下方法: 我错过了什么?Android-如何在自定义MyLocationOverlay中添加阴影,android,google-maps,mylocationoverlay,Android,Google Maps,Mylocationoverlay,我想为MyLocationOverlay的自定义标记添加阴影。我已尝试使用以下方法: 我错过了什么? 提前感谢。最后,我可以为MyLocationOverlay的自定义标记画一个阴影,如下所示: @Override protected void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when) { mapView.getProjection().
提前感谢。最后,我可以为MyLocationOverlay的自定义标记画一个阴影,如下所示:
@Override
protected void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when) {
mapView.getProjection().toPixels(myLocation, currentPoint);
canvas.drawBitmap(shadowBitmap, currentPoint.x - this.markerBitmap.getWidth()/2, currentPoint.y - this.markerBitmap.getHeight(), null);
canvas.drawBitmap(markerBitmap, currentPoint.x - this.markerBitmap.getWidth()/2, currentPoint.y - this.markerBitmap.getHeight(), null);
}
我希望这对某人有帮助
@Override
protected void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when) {
mapView.getProjection().toPixels(myLocation, currentPoint);
canvas.drawBitmap(shadowBitmap, currentPoint.x - this.markerBitmap.getWidth()/2, currentPoint.y - this.markerBitmap.getHeight(), null);
canvas.drawBitmap(markerBitmap, currentPoint.x - this.markerBitmap.getWidth()/2, currentPoint.y - this.markerBitmap.getHeight(), null);
}