Tag: mapkit

mapkit默认显示注释

我有一个注释,显示在一个自定义图像的mapkit,显示罚款, 但是贴上后贴着标注, 当我开始视图的时候,怎么能默认显示注释? 丝毫敲出别针。 – (MKAnnotationView *)mapView:(MKMapView *)mv viewForAnnotation:(id <MKAnnotation>)annotation { if([annotation isKindOfClass:[MKUserLocation class]]) return nil; NSString *annotationIdentifier = @"PinViewAnnotation"; MKPinAnnotationView *pinView = (MKPinAnnotationView *) [mapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier]; if (!pinView) { pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationIdentifier] autorelease]; [pinView setPinColor:MKPinAnnotationColorGreen]; pinView.animatesDrop = YES; pinView.canShowCallout = YES; UIImageView *houseIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tijereta.png"]]; pinView.leftCalloutAccessoryView = houseIconView; […]

如何使用自动布局在MKAnnotation中显示多行?

我正在使用mapkit,我怎么可以在MKAnnotation视图中多行。 每个注释都有标题和副标题。 如何显示与多行自动布局的帮助子标题? 我发现它的答案.plz试试我的答案。 我们只需要做代码 – (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { } 在这里我展示了如何使用MKAnnotation自动布局的想法。

iOS7地图工具包删除默认的位置图标

我想知道是否有可能从地图工具包中删除所有的默认图标 。 我做了很多研究,尝试了几种不同的方法。 找不到任何方法来做到这一点。 不知道有没有人能帮助我们。

在MKMapView上禁用指南针

我在我的应用程序中使用MapView来显示一些注释。 在iOS 7中,指南针随机出现在地图上。 我不能重现错误,因为它随机出现,但我想禁用它。 任何想法如何禁用它? 更新:我发现不是随机出现,而是在一个特定的手势。 当你使用两个手指,一个向右滑动,另一个向左滑动。

MKAnnotationView层不是预期的types:MKLayer

所以我的代码工作正常,但我的logging器充满了这个消息。 有没有办法摆脱它或压制它? PostAnnotation.swift class PostAnnotation: MKPointAnnotation { //MARK: properties let post: Post //MARK: initialization init(post: Post) { self.post = post super.init() self.coordinate = CLLocationCoordinate2D(latitude: post.latitude, longitude: post.longitude) self.title = post.title self.subtitle = post.timeString() } } 添加注释 let annotation = PostAnnotation(post: post) self.map.addAnnotation(annotation) func mapView func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? { if […]

更新MKannotation图像而不闪烁

我想每5秒更新一次mapview的一些注释图像,但是我不想删除并重新添加到地图中,因为这会导致它们“刷新”或刷新,(即disapear然后重新出现) 。 我希望它是无缝的。 我已经尝试了以下内容: //get the current icon UserAnnotation *annotation = [self GetUserIconWithDeviceId:deviceId]; //make a new annotation for it UserAnnotation *newAnnotation = [[UserAnnotation alloc] initWithCoordinate: userCoordinates addressDictionary:nil]; newAnnotation.title = name; newAnnotation.userDeviceId = deviceId; NSInteger ageIndicator = [[userLocation objectForKey: @"ageIndicator"] integerValue]; newAnnotation.customImage = [UserIconHelpers imageWithAgeBorder:ageIndicator FromImage: userImage]; //if its not there, add it if (annotation != […]

是否有提供交通信息的iOS版Google Maps API?

我想知道是否有人获得了有关Google Maps API的文档, 但我只是在寻找想要在我的iOS应用程序上实现的stream量实时信息 。 这样的API是否存在?

用MKMapView显示当前用户位置?

我试图通过设置MKMapView的属性,即setShowsUserLocation为YES来显示用户的当前位置。 默认情况下,当应用程序开始更新用户位置时,会在iPhone屏幕的左上angular出现一个箭头。但是在显示当前位置之后,箭头应该消失,但是只要应用程序正在运行,它仍然存在,这意味着应用程序仍然是在后台更新位置? 所以我如何停止更新当前位置? 我已经实现了被立即调用的代理

使用MKLocalSearchsearch地图上的位置

我想使用MKLocalSearch在地图中search。 此function在iOS 6.1+中可用。 有谁知道如何使用这个或任何人都可以举例说明如何使用MKLocalSearch ? MKLocalSearchResponse文档

在CoreGraphics / MapKit中debugging崩溃

当我的应用程序在iPhone上运行时,发生间歇性崩溃。 所有的崩溃是相同的,并以某种方式涉及MKMapView覆盖(MKCircleViews)。 从典型的iPhone 4s崩溃报告: 报告标题: Hardware Model: iPhone4,1 Process: EL-GPS-01 [1021] Path: /var/mobile/Applications/61288E15-74B5-45B9-99A9-E0B58C767816/EL-GPS-01.app/EL-GPS-01 Identifier: EL-GPS-01 Version: ??? (???) Code Type: ARM (Native) Parent Process: launchd [1] Date/Time: 2011-11-22 15:59:41.065 +0000 OS Version: iPhone OS 5.0.1 (9A405) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000000 Crashed Thread: 6 和坠毁的线程: Thread 6 name: […]