2

I want MKPolylineView lineWidth needs to be same everytime when zoom in or zoom out on MKMap ?

I am drawing Route from A to B using MKPolylineView with all the specified points on the route.

I want to find corridor(polygon) around route as per specified distance in meters.suppose its 5 km (5000 meters). So corridor will be drawn on the mapview along with route.

I am attaching final image as output.

How to draw corridor(polygon) around the route ?

How to achieve this ?

enter image description here

4

1 回答 1

1

你需要一个 MKOverlayview,它根据你给它的 MKPolyline 和你给它的距离绘制蓝色的“走廊”

@interface MyCooridor : MKOverlayView 
@property(retain) MKPolyline *polyline; 
@property(assign) double distance;
@end

绘制,实施-(void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context


在地图上添加覆盖以mapview:viewForOverlay:返回走廊视图

于 2013-05-07T09:26:34.263 回答