Tag: mapkit

如何在MapKit中获得可见的覆盖? (即来自Mapkit Ivew的MKOverlay / MKOverlayRender)

如何从MapkitView获取当前可见覆盖的列表(数组)? 背景 – 例如,我想在我的mapkitview上显示方向箭头到某些Overlaytypes的中心,但是如何获得可见的? 似乎没有办法做到这一点,我可以看到? 所以我需要通过所有的覆盖(实际上〜8000),并做我自己的检查,看看会显示在屏幕上? 如果MapKit已经有效地做到了这一点,那么看起来是浪费,因为它决定了在给定的时间内需要显示哪些叠加层。

在地图上实现雾(模糊)

我会尽量持续一些日子,但没有得到任何想法,我怎么能解决这个。有一些截图 当第一次屏幕显示比只有userlocation显示在地图和其他地图是模糊的,但是当用户可以移动到另一个位置比清除每个位置模糊效果像我的第二个屏幕截图 请给我一些逻辑如何解决这个问题。

在模拟器中,MKMapview不会在iOS-7.0中显示地图

我在我的应用程序中使用MKMapView。 我需要在地图上显示当前位置。 当我在iOS 6.0或6.1上显示它时,它工作正常。 在iOS 7.0上,Map没有正确显示。 在iOS 7.0中看看地图 – 任何人都可以提出为什么地图的背景不出现在这里,是否有任何额外的方法forms的iOS 6.0,我们将不得不执行在iOS 7.0中的模拟器中显示地图?

MKPointAnnotations的Swift Offset用于不同高度范围的相同位置坐标

我之前遇到过一个问题, 这里已经回答了 。 此外,我还有一个问题,我尝试了一种方法,但失败了。 我需要在地图上显示两个注释,它们具有相同的位置坐标。 数据来自于一项服务,我应用了一个逻辑来为相同纬度的位置增加一个0.0001的偏移量。 ( SO答案 ) 现在,当我放大/缩小时,我正在使用计算高度 let updatedRadius = (mapView.camera.altitude)/1000 //in KM 然后,我有以下保持注释之间的不断偏移(我的意思是,注释在任何缩放级别并排显示) switch updatedRadius { case 0 … 5: allStoresInfo.map { currentStore in allStoresInfo.filter{$0.latLng![0] == currentStore.latLng![0]}.enumerated().forEach{ index, matchingStore in matchingStore.latLng![0] += Double(index)*0.0001 } } case 5 … 10: allStoresInfo.map { currentStore in allStoresInfo.filter{$0.latLng![0] == currentStore.latLng![0]}.enumerated().forEach{ index, matchingStore in matchingStore.latLng![0] += […]

如何获取与ios中的位置search相关的图像

我正在创build一个基于地图search的iPad MasterDetail应用程序。 MasterViewController对关键字执行search,并将结果传递给TableView和DetailView并提供MasterView所选项目的映射。 我想在selectannotation时在子视图中添加与search位置相关的图像。

Swift:“mapView.showUserLocation = true”返回“致命错误:意外地发现零,而解包可选值(lldb)”

所以我试图用“bar”或“pizza”这样的关键词来searchSwift中的本地商家。 我将search链接到一个button动作,以便位置将在定义的区域内的地图上popup。 但是,我甚至不能让应用程序加载用户位置,因为我得到一个零错误。 这是我的AppDelegate: import UIKit import CoreLocation @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var locationManager: CLLocationManager? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. locationManager = CLLocationManager() locationManager?.requestWhenInUseAuthorization() return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is […]

更改用户位置蓝色脉冲圆半径

是否有可能改变MapKit当前用户位置周围的蓝色脉冲圆的半径? 我有一个应用程序,查看当前位置在某个半径内的兴趣点。 我想向用户展示此圈子,而不必完全为当前用户位置提供新的注释。 有任何想法吗?

用户位置Mapkit ViewDidLoad

所以从我在这里看到的多个答案,这是如何中心和缩放应用程序加载时的用户位置,它的工作原理。 -(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation{ NSLog(@"Did update user location"); MKCoordinateRegion mapRegion; mapRegion.center = mapView.userLocation.coordinate; mapRegion.span.latitudeDelta = 0.2; mapRegion.span.longitudeDelta = 0.2; [map setRegion:mapRegion animated: YES]; } 但是,每当这个委托方法被调用时,当你开始使用地图的时候,它会把我带回到用户的位置。 我该如何处理这个应该停止用户位置更新? 我曾试图把这个代码在视图中加载,所以我得到的初始缩放和中心,但它不工作? 或者,也许我可以把代码放在另一个地图工具包委托方法,我只是不知道正确的做它在其他人如何做到这一点?

Swift + didUpdateUserLocation没有被调用

我无法调用MKMapView委托方法didUpdateUserLocation 。 我到目前为止做了什么: 在项目中添加框架MapKit.framwork 通过import MapKit行import MapKit视图控制器中的框架 添encryption钥在plist文件中 <key>NSLocationAlwaysUsageDescription</key> <true/> 代码在视图控制器 增加了委托didUpdateUserLocation方法来检查位置是否更新,但从来没有调用。 // MARK: – MapView delegate methods func mapView(mapView: MKMapView!, regionDidChangeAnimated animated: Bool) { // Calling… } func mapView(mapView: MKMapView!, didUpdateUserLocation userLocation: MKUserLocation!) { // Not getting called } // MARK: – View lifeCycle methods override func viewDidLoad() { super.viewDidLoad() var locationManager = CLLocationManager() […]

标注放大iOS7后打开错误的视图

在我的应用程序中一切正常,除了一件事:放大和缩小后,看到整个地图,一些标注打开错误的detailview。 我不知道如果我错过了一些代码或其他。 使用Xcode 5.1.1 for iOS7。 这是我目前所掌握的: Annotation.h #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface Annotation: NSObject <MKAnnotation> @property (nonatomic, assign) CLLocationCoordinate2D coordinate; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *subtitle; @end Annotation.m #import "Annotation.h" @implementation Annotation @synthesize coordinate,title,subtitle; @end MapView.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface Nameofthemap : UIViewController <MKMapViewDelegate> @property (strong, nonatomic) IBOutlet MKMapView […]