Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Route-Me how to draw a path on the map for example, not exactly but close.</p> <p>Use RMPath to Draw a polygon on overlay layer</p> <pre><code>//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; } </code></pre> <p>Note:</p> <p>The latest RouteMe has addLineToCoordinate:(CLLocationCoordinate2D)coordinate instead of addLineToLatLong.</p> <p>This is newer one found in the MapTestBed in example in Route-me</p> <pre><code>- (RMMapLayer *)mapView:(RMMapView *)aMapView layerForAnnotation:(RMAnnotation *)annotation { if ([annotation.annotationType isEqualToString:@"path"]) { RMPath *testPath = [[[RMPath alloc] initWithView:aMapView] autorelease]; [testPath setLineColor:[annotation.userInfo objectForKey:@"lineColor"]]; [testPath setFillColor:[annotation.userInfo objectForKey:@"fillColor"]]; [testPath setLineWidth:[[annotation.userInfo objectForKey:@"lineWidth"] floatValue]]; CGPathDrawingMode drawingMode = kCGPathStroke; if ([annotation.userInfo containsObject:@"pathDrawingMode"]) drawingMode = [[annotation.userInfo objectForKey:@"pathDrawingMode"] intValue]; [testPath setDrawingMode:drawingMode]; if ([[annotation.userInfo objectForKey:@"closePath"] boolValue]) [testPath closePath]; for (CLLocation *location in [annotation.userInfo objectForKey:@"linePoints"]) { [testPath addLineToCoordinate:location.coordinate]; } return testPath; } if ([annotation.annotationType isEqualToString:@"marker"]) { return [[[RMMarker alloc] initWithUIImage:annotation.annotationIcon anchorPoint:annotation.anchorPoint] autorelease]; } return nil; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload