我想绘制一个带有图像的 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;
现在这就是我所看到的:
这就是我想看到的:
我想将标志放入 GMSPolygon 或通过裁剪 GMSGroundOverlay 的图标获得相同的结果。我不知道这是可能的,也不知道我怎么能做到。