我缩放了画布,但实际标记未在 android 地图应用程序中缩放。以下代码写在我的代码中:
public void onCameraChange(CameraPosition position) {
float angle = position.bearing;
float tilt = position.tilt;
for (String key:canvases.keySet()) {
Float angle2 = angle;
Float markerAngle = Float.parseFloat(markerDirection.get(key));
if (angle==0){
angle2 = markerAngle;
}
else{
angle2 = (360 -angle) + markerAngle;
}
Bitmap x = canvases.get(key);
Bitmap bmResult = Bitmap.createBitmap(x.getHeight(), x.getWidth(), Bitmap.Config.ARGB_8888);
Canvas tempCanvas = new Canvas(bmResult);
tempCanvas.rotate(angle2 , x.getHeight(), x.getWidth());
tempCanvas.drawBitmap(x, 0, 0, null);
markers.get(key).setIcon(BitmapDescriptorFactory.fromBitmap(bmResult));
}
}