作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用以下方法:- (void)loadTileAtPath:(MKTileOverlayPath)path
result:(void (^)(NSData *data, NSError *error))result
MKTileOverlayPath 给了我一个 x、y 和 z。我正在尝试沿此路径拍摄该区域的 Apple Maps 版本的快照,以便我可以对图像应用过滤器。
我正在使用 MKMapSnapshotter,但不知道给它什么值来绘制该区域的苹果 map 表示。
MKMapSnapshotOptions *options = [[MKMapSnapshotOptions alloc] init];
options.scale = [[UIScreen mainScreen] scale];
options.showsBuildings = NO;
options.showsPointsOfInterest = NO;
options.mapType = MKMapTypeStandard;
MKMapSnapshotter *snapshotter = [[MKMapSnapshotter alloc] initWithOptions:options];
[snapshotter startWithCompletionHandler:^(MKMapSnapshot *snapshot, NSError *error) {
if (error || !snapshot) {
NSLog(@"snapshotter error: %@", error);
return;
}
}];
最佳答案
x/y/z
之间的转换坐标在这里完成:
https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
使用它来确定(间接)和MKMapRect
捕获,设置您的 map View ,然后使用 MKMapSnapshotter
抓取要处理的图像。
关于ios - 将 MKTileOverlayPath 转换为 MKMapRect?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24209133/
我正在使用以下方法: - (void)loadTileAtPath:(MKTileOverlayPath)path result:(void (^)(NSData *data, NSError *er
我搜索了很多答案,我无法想象这样的方法不存在!!我有一个 MKTileOverlayPath (x , y & z) 并且还能够得到这个矩形中心的经度/纬度。现在我需要获取每个矩形的跨度,这可能吗?
我是一名优秀的程序员,十分优秀!