地図上に画像があり、Google マップ上で線形および回転運動をしたいと考えています。
GMSでどうすればできますか?私を助けてください。
地図上に画像があり、Google マップ上で線形および回転運動をしたいと考えています。
GMSでどうすればできますか?私を助けてください。
実際、次のコードと GMSMarker メソッド setPosition: を使用して問題を解決しました。次のコードは、画像に回転を提供し、setPosition を使用しています。マーカー/画像をどこにでも配置できます。両方の組み合わせにより、必要な直線運動と回転運動が得られます。
- (UIImage *)imageRotatedByDegrees:(CGFloat)degrees image: (UIImage*) image
{
CGSize size = image.size;;
UIGraphicsBeginImageContext(size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextTranslateCTM( context, 0.5f * size.width, 0.5f * size.height ) ;
CGContextRotateCTM (context, DegreesToRadians(degrees));
[ image drawInRect:(CGRect){ { -size.width * 0.5f, -size.height * 0.5f }, size } ] ;
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}