Open GoogleCodeExporter opened 8 years ago
same problem here, did you find a solution?? I moved the RMPath to the lowest
index in the sublayers array from RMLayerCollection but the result was not the
desired effect. the markers were still under the RMPath polygon area..
Original comment by adrian.h...@gmail.com
on 23 Feb 2011 at 3:18
no, haven't had any time to look
Original comment by macegh...@gmail.com
on 24 Feb 2011 at 8:36
Finally I found out how to do it. Since [[[mapView contents] overlay]
sublayers] contains all RMPaths and RMMarkers, I set the RMPath to the lowest
index. But only this is not sufficient. I have to set the zPosition of the
RMPath to -2.0f (all my other markers have zPosition=-1.0f).
//polygonArray is a NSMutableArray of CLLocation
- (RMPath*)addLayerForPolygon:(NSMutableArray*)polygonArray
toMap:(RMMapView*)map {
RMPath* polygonPath = [[[RMPath alloc] initForMap:map] autorelease];
[polygonPath setLineColor:[UIColor colorWithRed:1 green:0 blue:0 alpha:0.5]];
[polygonPath setFillColor:[UIColor colorWithRed:1 green:0 blue:0 alpha:0.5]];
[polygonPath setLineWidth:1];
BOOL firstPoint = YES;
for (CLLocation* loc in polygonArray) {
if (firstPoint) {
[polygonPath moveToLatLong:loc.coordinate];
firstPoint = NO;
} else {
[polygonPath addLineToLatLong:loc.coordinate];
}
}
[polygonPath closePath];
polygonPath.zPosition = -2.0f;
NSMutableArray *sublayers = [[[[mapView contents] overlay] sublayers] mutableCopy];
[sublayers insertObject:polygonPath atIndex:0];
[[[mapView contents] overlay] setSublayers:sublayers];
return polygonPath;
}
Original comment by adrian.h...@gmail.com
on 28 Feb 2011 at 11:47
Original issue reported on code.google.com by
macegh...@gmail.com
on 18 Nov 2010 at 7:09