各位 gta5小地图放大的地图比例能放大吗

[ios]设置缩放比例和中心,一些地图中的位置
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.
我试着修复缩放和好几个地图中的位置的中心。这是它使用了没有工作的代码:
MKCoordinateR
CLLocationDegrees maxLat = -90;
CLLocationDegrees maxLon = -180;
CLLocationDegrees minLat = 90;
CLLocationDegrees minLon = 180;
for(int idx = 0; idx & arrLocation. idx++)// here use your array or points
CLLocation* currentLocation = [arrLocation objectAtIndex:idx];
if(currentLocation.coordinate.latitude & maxLat)
maxLat = currentLocation.coordinate.
if(currentLocation.coordinate.latitude & minLat)
minLat = currentLocation.coordinate.
if(currentLocation.coordinate.longitude & maxLon)
maxLon = currentLocation.coordinate.
if(currentLocation.coordinate.longitude & minLon)
minLon = currentLocation.coordinate.
region.center.latitude
= (maxLat + minLat) / 2;
region.center.longitude
= (maxLon + minLon) / 2;
region.span.latitudeDelta
= (maxLat - minLat) * 2;
region.span.longitudeDelta = (maxLon - minLon) * 2;
[mapView setRegion:region animated:YES];
尝试了它在 didAddAnnotationViews 和 didUpdateUserLocation ,但没有用。 你能帮我吗?
解决方法 1:
最后我以这种方式找到解决方案:
CLLocationCoordinate2D topLeftC
topLeftCoord.latitude = -90;
topLeftCoord.longitude = 180;
CLLocationCoordinate2D bottomRightC
bottomRightCoord.latitude = 90;
bottomRightCoord.longitude = -180;
for(id&MKAnnotation& annotation in mapView.annotations) {
topLeftCoord.longitude = fmin(topLeftCoord.longitude, annotation.coordinate.longitude);
topLeftCoord.latitude = fmax(topLeftCoord.latitude, annotation.coordinate.latitude);
bottomRightCoord.longitude = fmax(bottomRightCoord.longitude, annotation.coordinate.longitude);
bottomRightCoord.latitude = fmin(bottomRightCoord.latitude, annotation.coordinate.latitude);
MKCoordinateR
region.center.latitude = topLeftCoord.latitude - (topLeftCoord.latitude - bottomRightCoord.latitude) * 0.5;
region.center.longitude = topLeftCoord.longitude + (bottomRightCoord.longitude - topLeftCoord.longitude) * 0.5;
region.span.latitudeDelta = fabs(topLeftCoord.latitude - bottomRightCoord.latitude) * 1.1;
// Add a little extra space on the sides
region.span.longitudeDelta = fabs(bottomRightCoord.longitude - topLeftCoord.longitude) * 1.1;
region = [mapView regionThatFits:region];
[mapView setRegion:region animated:YES];查看: 1624|回复: 4
佣兵, 积分 626, 距离下一级还需 124 积分
精华0帖子威望0 点积分626 点注册时间最后登录
打开地图还是有点卡,找个路牌不容易啊
群丑目击者
精华2帖子威望10 点积分5634 点注册时间最后登录
游戏选项菜单里有,可以的
佣兵, 积分 626, 距离下一级还需 124 积分
精华0帖子威望0 点积分626 点注册时间最后登录
深衣 发表于
游戏选项菜单里有,可以的
主机版~~~
佣兵, 积分 375, 距离下一级还需 375 积分
精华0帖子威望0 点积分375 点注册时间最后登录
h0n9 发表于
主机版~~~
主机版小地图也有大,小,和关闭设置,你自己设置里改
佣兵, 积分 626, 距离下一级还需 124 积分
精华0帖子威望0 点积分626 点注册时间最后登录
chennnnng 发表于
主机版小地图也有大,小,和关闭设置,你自己设置里改
该死的汉化,翻译成显示器
Powered by
扫描二维码
下载 A9VG 客户端(iOS, Android)主题 : 有人知道地图缩放等级怎么设置吗?
级别: 侠客
可可豆: 743 CB
威望: 743 点
在线时间: 266(时)
发自: Web Page
来源于&&分类
有人知道地图缩放等级怎么设置吗?&&&
我想限制地图的缩放等级, 缩到一定程度就不能再缩了,请问怎么限制呢? 感谢各位了。。
级别: 侠客
可可豆: 743 CB
威望: 743 点
在线时间: 266(时)
发自: Web Page
顶。。。。。
级别: 新手上路
可可豆: 363 CB
威望: 363 点
在线时间: 53(时)
发自: Web Page
这个,我前几天刚刚搞定了,用的是开源的代码。看这个,不能解决你砍我,哈哈哈,实现效果是和安卓系统对地图封装一样的。
此人神经病有所好转
关注本帖(如果有新回复会站内信通知您)
苹果公司现任CEO是谁?2字 正确答案:库克
发帖、回帖都会得到可观的积分奖励。
按"Ctrl+Enter"直接提交
关注CocoaChina
关注微信 每日推荐
扫一扫 浏览移动版本帖子已过去太久远了,不再提供回复功能。}

我要回帖

更多关于 gta5小地图怎么放大 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信