MapXL / route-me

Automatically exported from code.google.com/p/route-me
0 stars 0 forks source link

RMPath: path out of visible area ramain invisible when moving programly. #141

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Use SampleMapwith following code in viewDidLoad:

[CODE]
// Set map view center coordinate
    CLLocationCoordinate2D center;
    center.latitude = 47.582;
    center.longitude = -122.333;
    slideLocation = center;
    [mapView.contents moveToLatLong:center];
    [mapView.contents setZoom:17.0f];

    // Add 2 markers(start/end)  and RMPath with 2 points
    RMMarker *newMarker;
    UIImage *startImage = [UIImage imageNamed:@"marker-blue.png"];
    UIImage *finishImage = [UIImage imageNamed:@"marker-red.png"];
    UIColor* routeColor = [[UIColor alloc] initWithRed:(27.0 /255) green:(88.0 /255) blue:(156.0 /255) alpha:0.75];
    RMPath* routePath = [[RMPath alloc] initWithContents:mapView.contents];
    [routePath setLineColor:routeColor];
    [routePath setFillColor:routeColor];
    [routePath setLineWidth:10.0f];
    [routePath setDrawingMode:kCGPathStroke];
    CLLocationCoordinate2D newLocation;
    newLocation.latitude = 47.580;
    newLocation.longitude = -122.333;   
    [routePath addLineToLatLong:newLocation];
    newLocation.latitude = 47.599;
    newLocation.longitude = -122.333;   
    [routePath addLineToLatLong:newLocation];
    [[mapView.contents overlay] addSublayer:routePath];

    newLocation.latitude = 47.580;
    newLocation.longitude = -122.333;   
    newMarker = [[RMMarker alloc] initWithUIImage:startImage anchorPoint:CGPointMake(0.5, 1.0)];
    [mapView.contents.markerManager addMarker:newMarker AtLatLong:newLocation];
    [newMarker release];
    newMarker = nil;

    newLocation.latitude = 47.599;
    newLocation.longitude = -122.333;   
    newMarker = [[RMMarker alloc] initWithUIImage:finishImage anchorPoint:CGPointMake(0.5, 1.0)];
    [mapView.contents.markerManager addMarker:newMarker AtLatLong:newLocation];
    [newMarker release];
    newMarker = nil;

    // Start moving map (after few moves path become invisible until user touch screen)
    [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(slide) userInfo:nil repeats:YES];
}

-(void)slide{
    slideLocation.latitude = slideLocation.latitude + 0.0002;
    [mapView moveToLatLong:slideLocation];
}
[/CODE]

2. Run project.
3. see how path becomes invisible.
3. Touch/drag map. path becomes visible.
4. Map continue to move and 

What is the expected output?
Path visible all the way map moves on it.

What do you see instead?
Visible only initial part of route. 

What subversion release are you using? Does the behavior occur on the
simulator, a real iPhone/iPod Touch, or both?
Both.

If you can reproduce your bug, please provide the source code for a
reproducing case. The best place to start is with the SampleMap project.

Please don't send patches/diffs. Post source code directly to the issue
tracker, noting your suggested revisions. If they are extensive, use a
branch in subversion with the same name as your issue number (e.g.
branches/issue59).

Please provide any additional information below.

Original issue reported on code.google.com by vit...@gmail.com on 21 Jun 2010 at 8:50

Attachments:

GoogleCodeExporter commented 8 years ago
As workaround im calling on each moveToLatLong moveBy.

[mapView moveToLatLong:slideLocation];
[mapView moveBy:CGSizeMake(0,0)];

it works but Im not sure if its correct way to avoid this bug. 

Original comment by vit...@gmail.com on 21 Jun 2010 at 12:48