
March 3rd, 2011, 04:02 AM
|
|
Registered User
|
|
Join Date: Jan 2011
Posts: 7
Time spent in forums: 41 m 4 sec
Reputation Power: 0
|
|
|
Create Overlayview for set of rectangles..
Hi All,
I am new iPhone developer and really looking for help on following issue I am stuck with. Any help would be appreciated.
I am trying to create overlay of set of rectangles to stack them on one another. I have required coordinates. I know how to create the polyline view and bound them by MapRect to make it visible on loadview.
Code:
// the data representing the route.
MKPolyline* _route;
MKPolylineView* _routeView;
// Following lines create polyline for my coordinateArray, add into overlay, and make it visible on map
self.route = [MKPolyline polylineWithCoordinates:coordinateArray count:points.count];
[self.mapView addOverlay:self.route];
[self.mapView setVisibleMapRect:[self.route boundingMapRect]];
- (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay
{
if ([overlay isKindOfClass:[MKPolyline class]])
{
self.routeView = [[[MKPolylineView alloc] initWithPolyline:self.route] autorelease];
self.routeView.fillColor = [UIColor redColor];
self.routeView.strokeColor = [UIColor redColor];
self.routeView.lineWidth = 8;
return self.routeView;
}
return nil;
}
Now I want to convert all my coordinates into set of rectangles and bound them by the outer rectangle. Could anyone please help me on this.
Thanks in advance.
|