【发布时间】:2017-01-26 16:22:34
【问题描述】:
我有一个应用程序,我在 mkmapkit 中像这样显示折线 -
self.routeLine = [MKPolyline polylineWithCoordinates:coordinateArray count:4];
//[self.mapView setVisibleMapRect:[self.routeLine boundingMapRect]]; //If you want the route to be visible
[self.mapView addOverlay:self.routeLine];
-(MKPolylineRenderer *)mapView:(MKMapView *)mapView viewForOverlay:(id<MKOverlay>)overlay
{
if(overlay == self.routeLine)
{
if(nil == self.routeLineView)
{
self.routeLineView = [[MKPolylineRenderer alloc] initWithPolyline:self.routeLine];
self.routeLineView.fillColor = [UIColor redColor];
self.routeLineView.strokeColor = [UIColor redColor];
self.routeLineView.lineWidth = 2;
}
return self.routeLineView;
}
return nil;
}
现在我想在多段线上添加一个箭头来显示这样的方向
How to draw an arrow on every polyline segment on Google Maps V3
。我用谷歌搜索了同样的结果,但到目前为止还没有运气。谁能指导我如何实现这一目标?
【问题讨论】:
标签: iphone ipad mkmapview mkpolyline