如何使用skobbler Maps ios从我当前位置开始移动路径

时间:2016-02-05 11:17:12

标签: ios objective-c routes maps skmaps

我使用此代码但是用于查找两点之间的路线,但我需要使用location地图基于device moving更新skobbler

-(void)Draw_Route
{
    SKRouteSettings* route = [[SKRouteSettings alloc]init];
    route.startCoordinate=prevlocation;//CLLocationCoordinate2DMake(13.0270, 80.2602);
    //prevlocation;



    //CLLocationCoordinate2DMake(13.5, 80.21);//CLLocationCoordinate2DMake(37.9667, 23.7167);

    route.destinationCoordinate=currentUserLocation;


    //currentLocation.coordinate;//CLLocationCoordinate2DMake(13.0270, 80.2602);//currentLocation.coordinate;//CLLocationCoordinate2DMake(37.9677, 23.7567);
    route.shouldBeRendered = YES; // If NO, the route will not be rendered.
    route.requestAdvices = YES;
    route.maximumReturnedRoutes = 1;
    route.requestExtendedRoutePointsInfo = NO;
    [[SKRoutingService sharedInstance] calculateRoute:route];
    SKAnnotation *startCoordinateAnnotation = [SKAnnotation annotation];
    startCoordinateAnnotation.identifier = 9998;
    startCoordinateAnnotation.annotationType = SKAnnotationTypeGreen;
    startCoordinateAnnotation.location = route.startCoordinate;
    [skMapView_ addAnnotation:startCoordinateAnnotation withAnimationSettings:nil];

    //add destination flag annotation
    SKAnnotation *destinationFlagAnnotation = [SKAnnotation annotation];
    destinationFlagAnnotation.identifier = 9999;
    destinationFlagAnnotation.annotationType = SKAnnotationTypeDestinationFlag;
    destinationFlagAnnotation.location = route.destinationCoordinate;
    [skMapView_ addAnnotation:destinationFlagAnnotation withAnimationSettings:nil];
}

0 个答案:

没有答案