Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/191.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android-如何在自定义MyLocationOverlay中添加阴影_Android_Google Maps_Mylocationoverlay - Fatal编程技术网

Android-如何在自定义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的自定义标记添加阴影。我已尝试使用以下方法:

我错过了什么?
提前感谢。

最后,我可以为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);
}