简体   繁体   English

Mapkit显示注释区域

[英]Mapkit showing annotation region

I have a MKMapView with several annotations. 我有一个带有几个注释的MKMapView。 These annotations differ from varios location all over Sweden. 这些注释与瑞典各地的杂音位置不同。 What I want to do is to zoom the map so all annotations show. 我要做的是缩放地图,以便显示所有注释。

I do not want to position the map to my position (although I do want to show it), but want all annotations to show and center the map according those locations. 我不想将地图定位到我的位置(尽管我确实想显示它),但希望所有注释根据这些位置显示并居中地图。

Ie if one annotation would be "kiruna" (upper left sweden) and the otherone would be "stockholm" (middle right sweden), I want the map to show both. 也就是说,如果一个注解是“ kiruna”(瑞典左上方)而另一个注解是“斯德哥尔摩”(瑞典中右瑞典),我希望地图同时显示两者。 If the map would only show "uppsala" (above stockholm) and "stockholm", I want the map zo zoom that "uppsala" is in the top left and "stockholm" bottom middle/right. 如果地图仅显示“ uppsala”(在斯德哥尔摩上方)和“ stockholm”,我希望地图缩放以使“ uppsala”在左上方,“ stockholm”在底部中/右。

How can I do this? 我怎样才能做到这一点? I have the lat/lon positions ofcouce for every location. 我在每个位置都提供经纬度的经纬度。

Regards, 问候,
Paul Peelen 保罗·皮伦

重复使用大量材料来解决您的问题: 定位MKMapView一次显示多个注释

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM