小编Mee*_*era的帖子

AFOAuth2Client和刷新令牌

如何在iPad应用程序中实现Oauth?

AFOAuth2Client如何在oauth 2.0中管理刷新令牌机制?

有什么方法可以在类中实现它,还是我们必须以自己的方式实现它?如何检查令牌是否已过期?

ipad ios oauth-2.0 afnetworking

10
推荐指数
1
解决办法
3899
查看次数

要旋转的MKOverlayView

我有一个叠加的路线放在地图上.我必须调整它的旋转,使其与底层地图视图完全重叠.我怎样才能做到这一点?我找到了旋转的角度.如何旋转叠加视图?到目前为止,我已经添加了叠加层,但无法使用变换进行旋转.我注意到的是,当我改变角度时,图像不会旋转,而是沿x轴(侧面)滑动.

这是我试过的代码

- (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context
{
    NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"routeImage" ofType:@"png"];
    UIImage *image = [[UIImage alloc] initWithContentsOfFile:imagePath];

    MKMapRect theMapRect = self.overlay.boundingMapRect;
    CGRect theRect = [self rectForMapRect:theMapRect];

    CGAffineTransform transform = CGAffineTransformMakeRotation((-35.88) / 180.0 * M_PI);
    [self setTransform:transform];

    CGContextSaveGState(context);

    CGContextScaleCTM(context, 1.0, -1.0);
    CGContextTranslateCTM(context, 0.0, -theRect.size.height);
    CGContextDrawImage(context, theRect,image.CGImage);
    CGContextRestoreGState(context);
}
Run Code Online (Sandbox Code Playgroud)

这就是我得到的

在此输入图像描述

我有一个解决方法,我使用GIMP手动旋转图像并放置它.但我需要它来定制.

这是使用GIMP转换的图像,当作为叠加层放置在地图上时

这是我使用变换旋转上下文时[注意:旋转上下文时图像旋转但不在确切的位置见图像.此外,图像在缩放时中断]

这就是我做的

      //Hayl-Road-Final.png is the actual image without transformation using GIMP

        UIImage *image   = [[UIImage imageNamed:@"Hayl-Road-Final.png"] retain];
        CGImageRef imageReference = image.CGImage;


        MKMapRect theMapRect …
Run Code Online (Sandbox Code Playgroud)

mapkit ios mkoverlay

5
推荐指数
1
解决办法
856
查看次数

标签 统计

ios ×2

afnetworking ×1

ipad ×1

mapkit ×1

mkoverlay ×1

oauth-2.0 ×1