MapBox缩放级别不被接受 [英] MapBox zoom level not honored

查看:477
本文介绍了MapBox缩放级别不被接受的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用RMMapView构建了一个控件. 我还从MapBox下载了一个地图以供离线使用,并相应地设置了最小和最大缩放级别,如下所示:

I've built a control using the RMMapView. I've also downloaded a map from MapBox to be offline available, and set the minimum and maximum zoom levels accordingly, like this:

RMMapboxSource * tileSource = [[RMMapboxSource alloc] initWithMapID:DEBUG_MAP_ID];
RMMapView *mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:tileSource];
mapView.minZoom = [[[tileSource infoDictionary]objectForKey:@"minzoom"] intValue];
mapView.maxZoom = [[[tileSource infoDictionary]objectForKey:@"maxzoom"] intValue];
[mapView setZoom:mapView.minZoom animated:YES];
mapView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
mapView.adjustTilesForRetinaDisplay = YES;
[mapView setHideAttribution:YES];
[self.view addSubview:mapView];

一切都很好,但是一旦我开始缩小,无论我设置的是什么,似乎都没有遵循最小缩放级别,并且地图也消失了,因为它没有该级别的图块.

All good, but once I start zooming out, it seems like the min-zoom level is not honoured, no matter what I set it to, and the map disappears because it doesn't have tiles for that level.

这里有什么我想念的吗?词典中的值很好,缩放级别已正确设置.最小和最大缩放都适用,这两个似乎都不起作用.

Is there anything I'm missing here? The values in the dictionary are good, the zoom levels are set correctly. This applies to both the min-and max zoom, neither of them seem to have effect.

(在一个简短的旁注中,我找不到MapBox的开发人员论坛.他们确实有一个支持页面,但是可以归结为FAQ,请给我们发电子邮件或付费获得支持.这是最好的选择,放置这些问题的StackOverflow吗?)

(On a quick side-note, I could not find a developer forum for MapBox. They do have a support-page, but it comes down to FAQ, e-mail us or pay for support. Is the best go-to place for these issues StackOverflow?)

推荐答案

我在支持电子邮件中回答了您,但是尝试将mapView属性添加到之后,将其添加到视图层次结构中.

I answered you on support email, but try changing the mapView properties after you've added it to the view hierarchy.

这篇关于MapBox缩放级别不被接受的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆