Tag: mapkit

如何在MKAnnotations上方显示MKOverlay?

我正在尝试使用MKOverlay (特别是MKPolyline )在地图上显示路线。 但是,我需要显示在我现有的引脚(自定义MKAnnotationView )上方的路线。 有没有一种好方法将MKPolyline放在引脚上方?

地图注释显示所有点的所有相同图像/引脚

我有一个条件语句来添加地图注释图标/引脚在下面的方法。 我遇到的问题是地图上正在填充所有相同的图标。 它应该检测到的猫ID和显示图标取决于检测到的猫ID。 我不知道是什么问题,因为这在iOS 6中工作,现在在iOS 7中,地图只显示所有相同的注释图标图像。 – (MKAnnotationView *) mapView:(MKMapView *)mapingView viewForAnnotation:(id <MKAnnotation>) annotation { annView = nil; if(annotation != mapingView.userLocation) { static NSString *defaultPinID = @""; annView = (MKAnnotationView *)[mapingView dequeueReusableAnnotationViewWithIdentifier:defaultPinID]; if ( annView == nil ) annView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID] ; UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [rightButton setTitle:annotation.title forState:UIControlStateNormal]; annView.rightCalloutAccessoryView = […]

MKLocalSearch找不到明显的结果

我的代码实际上与以下示例相同: https://github.com/iamamused/Example-MKLocalSearch.git 这里有一些重要的部分: @interface ViewController : UIViewController @property (strong, nonatomic) IBOutlet MKMapView *ibMapView; @end @implementation ViewController { MKLocalSearch *localSearch; MKLocalSearchResponse *results; } – (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [localSearch cancel]; MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init]; request.naturalLanguageQuery = searchBar.text; request.region = self.ibMapView.region; localSearch = [[MKLocalSearch alloc] initWithRequest:request]; [localSearch startWithCompletionHandler:^(MKLocalSearchResponse *response, NSError *error){ [self.resultTable reloadData]; } } 当Sutter和Mason […]

缩放后MKMapview注解dynamicpin图像发生变化

我正在研究一个在地图上显示7种不同types的注释的小项目。 我的注释取自数组中的url结果,并使用JSONparsing。 我有很多的注释,一旦地图加载,一切似乎都很好看。 在放大和缩小之后,针图像由于某种原因而改变为错误的针图像(具体图像,不知道为什么)。 我相信我在这里失去了一些东西…你可以请帮助:)? 这里是我的代码的一部分,让我知道如果你需要它了: -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation{ static NSString *identifier; if(_mapView.tag==1){identifier = @"TurbulencePin";} if(_mapView.tag==2){identifier = @"IcingPin";} if(_mapView.tag==3){identifier = @"WindsPin";} if(_mapView.tag==4){identifier = @"TemperaturePin";} if(_mapView.tag==5){identifier = @"CloudsPin";} if(_mapView.tag==6){identifier = @"VisibilityPin";} if(_mapView.tag==7){identifier = @"MultiplePin";} if ([annotation isKindOfClass:[MKUserLocation class]]) return nil; if ([annotation isKindOfClass:[Annotation class]]) { CustomAnnotationView* annotationView = (CustomAnnotationView*)[mapView dequeueReusableAnnotationViewWithIdentifier:identifier]; annotationView = nil; if (annotationView […]

用MapKit框架在Google地图上绘制多边形

我想在地图视图中显示Google地图,在该地图视图上要绘制多边形/圆形。 有什么build议?

ios mapkit通过点击地图closures注释标注

我有一个mapkit应用程序,它将注释放在地图上,当你按下它时,它会显示标题属性的标注。 这工作正常,但用户不能closures它们。 他们保持开放,直到他们点击另一个注释。 我不能让用户可以在地图上点击其他地方(或再次点击注释)closures它吗? 我有一种感觉,这是默认设置,所以也许我正在做的东西是填塞? 我有一个手势识别器,我用它来检测一些地图水龙头 UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; tap.numberOfTapsRequired = 1; [self.mapView addGestureRecognizer: tap]; 这引发了这个问题: – (void)handleTap:(UITapGestureRecognizer *)sender { if (sender.state == UIGestureRecognizerStateEnded) { CGPoint tapPoint = [sender locationInView:sender.view.superview]; CLLocationCoordinate2D coordinate = [self.mapView convertPoint: tapPoint toCoordinateFromView: self.mapView]; if (pitStopMode && !pitStopMade){ pitStopMade = YES; InfoAnnotation *annotation = [[InfoAnnotation alloc] initNewPitstopWithCoordinate:coordinate]; […]

使地图缩放到用户位置和注释(swift 2)

我正在使用mapkit。 我想让地图缩放以显示用户的位置和注释点,而不是缩放到用户的当前位置。 目前我有: let annotation = MKPointAnnotation() annotation.coordinate = CLLocationCoordinate2DMake(mapLat, mapLon) annotation.title = mapTitle self.map.addAnnotation(annotation) func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { let userLoction: CLLocation = locations[0] let latitude = userLoction.coordinate.latitude let longitude = userLoction.coordinate.longitude let latDelta: CLLocationDegrees = 0.05 let lonDelta: CLLocationDegrees = 0.05 let span:MKCoordinateSpan = MKCoordinateSpanMake(latDelta, lonDelta) let location: CLLocationCoordinate2D = CLLocationCoordinate2DMake(latitude, […]

MapKit中的MapTypeStyle

我想知道是否有任何方法来configuration我们的MapKit地图,就像我们在Google Maps API中使用MapTypeStyle对象一样。 如果我参考苹果文件,MKMapView有一个mapType选项, MKMapType常量,但没有像MapOptions的MapTypeStyle和MapTypeStyler风格参数,这是非常强大的快速地图定制。 所以我的问题是:有没有什么办法可以实现与MapKit框架相似的东西,如果没有,最好的框架/库是做什么的? 我正在考虑MapBox和类似的产品。

ETA(预计到达时间)从任何位置到达当前位置的正确方法是什么?

想知道什么是从任何地点到我目前所在地的ETA(估计时间到达)的正确方法,考虑到以下情况: 一个。 恩。 – 我从另一个设备获得它的位置(lon / lat),并希望当其他人接我时…在这种情况下,我可以使用什么networking服务来获取用户的信息? mapkit是否提供了这种select? 湾 如果它将在服务器端完成,我将发送我的用户位置,我的服务器端程序员可以使用什么工具获取ETA信息,以便将其发回给我的用户? 谢谢大家。 我看到: 有什么方法可以使用Apple的Maps API来确定两个地点之间的驾驶时间? – 这个问题,就像我在其他地方发现的那样(据我的理解)是,google api需要使用现在没有安装在每个iOS用户上的Google Maps应用程序。

如何从iPhone应用程序启动另一个应用程序

我正在开发iPhone应用程序中的地图应用程序。 我有一个buttongo 。 当用户在这个方法中点击这个button时,我想检查用户是否已经在他的iphone上安装了waze应用程序。 如果是,那么导航到waze应用程序,否则打开iPhone的默认地图应用程序。