gpt4 book ai didi

ios - 带有 UIImage 的 GMSPolygon 或 GMSGroundOverlay

转载 作者:行者123 更新时间:2023-11-29 10:32:32 31 4
gpt4 key购买 nike

我想绘制一个带有图像的 GMSPolygon 或裁剪 GMSGroundOverlay 的图像。

GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:48.774052
longitude:-110.375980
zoom:0];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = YES;

GMSMutablePath *shapePath = [[GMSMutablePath alloc] init];
[shapePath addLatitude:48.774052 longitude:-110.375980];
[shapePath addLatitude:40.676195 longitude:-123.911136];
[shapePath addLatitude:33.682907 longitude:-101.762699];

/*** **/
GMSCoordinateBounds *overlayBounds = [[GMSCoordinateBounds alloc] initWithPath:shapePath];

UIImage *icon = [UIImage imageNamed:@"usaimages.jpg"];
GMSGroundOverlay *overlay =
[GMSGroundOverlay groundOverlayWithBounds:overlayBounds icon:icon];
overlay.bearing = 0;
overlay.map = mapView_;
/*** **/

GMSPolygon *shape = [GMSPolygon polygonWithPath:shapePath];
shape.strokeWidth= 2;
shape.title=@"xx";
shape.fillColor= [UIColor redColor];
//shape.strokeColor= [UIColor brownColor];
shape.map=mapView_;

self.view = mapView_;
mapView_.delegate=self;

现在这是我看到的:

enter image description here

这就是我想看到的:

enter image description here

我想将标志放入 GMSPolygon 或通过裁剪 GMSGroundOverlay 的图标来获得相同的结果。我不知道哪一个是可能的,或者我该怎么做。

最佳答案

先裁剪图像然后使用。我建议使用 Gmsgroundoverlay,因为你将对图像有很多控制。比如对齐角度、旋转等

关于ios - 带有 UIImage 的 GMSPolygon 或 GMSGroundOverlay,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28903768/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com