Tag: 谷歌地图

我怎样才能检查一个CLLocationCoordinate2D是否在四个CLLocationCoordinate2D Square内? 在目标C与谷歌地图

我想testing一个CLLocationCoordinate2D是否在由其他四个CLLocationCoordinate2D创build的Square中 我有这样的结构: typedef struct { CLLocationCoordinate2D southWest; CLLocationCoordinate2D southEast; CLLocationCoordinate2D northEast; CLLocationCoordinate2D northWest; } Bounds; 并且以param的forms传递一个CLLocationCoordinate2D坐标。 我想testing坐标是否在边界内。 我如何testing? – (BOOL) isCoordinate:(CLLocationCoordinate2D)coordinate insideBounds:(Bounds)bounds { … }

Google路线API无法在iOS中返回结果

我正在尝试使用Google Directions API。 我有SDK的所有设置。 我已经在开发人员控制台中的“服务”下启用了适用于iOS的Google地图SDK 。 以下是我为获取路线所build立的url。 开发者控制台中有两种types的键。 首先,我尝试了iOS应用程序的关键。 https://maps.googleapis.com/maps/api/directions/json?origin=-37.814107,144.96328&destination=-31.953004,115.857469&key=<Key for iOS apps> 但是我得到了错误这个IP,网站或者移动应用程序没有被授权使用这个API密钥 。 当我search这个错误的解决scheme时,我在几个StackOverflow答案( 1,2 )中看到iOS密钥不受支持。 在答案中他们谈论的是Google Places API,但是我认为这可能与Directions相同,因为错误是一样的。 因此,我用Keyreplace了iOS应用程序的Key for browser应用程序 ,然后再次运行它,但是出现了一个新错误。 此API项目未被授权使用此API。 请确保在API控制台中激活此API 。 我的问题是,是否有任何其他的API,我必须在服务中激活,以得到这个工作? 这些是与列表中的其他Google地图相关的Google API。

如何打开谷歌地图导航url在iOS中的方向和声音?

我是新手在iOS我想做一个应用程序,包含地图工具包navigation.i要打开谷歌地图的导航url,如果用户设备有谷歌地图应用程序。 如果它不包含那么我想打开苹果地图在这里,我写了一个类似的代码 -(IBAction)navigationButtonPressed:(id)sender { if ([[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"comgooglemaps://"]]) { NSString *urlString=[NSString stringWithFormat:@"comgooglemaps://?center=%f,%f&zoom=14&views=traffic",self.latitude,self.longitude]; [[UIApplication sharedApplication] openURL: [NSURL URLWithString:urlString]]; } else { NSString *string = [NSString stringWithFormat:@"http://maps.apple.com/?ll=%f,%f",self.latitude,self.longitude]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:string]]; } } 但是,在这里,我想打开谷歌地图或苹果地图与用户之间的转动方向用户当前位置和选定的位置如何可能请给我解决scheme为此。

Google maps ios:Mapview路线垂直折线总是指向北或位置箭头的顶部

我已经在我的应用程序中实现了Google Maps IOS的​​基本function。 我必须设置mapview的方向始终指向顶部或北部。 我需要,如果我点击导航button的地图视图应该animation到顶部的位置箭头相同的谷歌地图ios应用程序。 箭头应该始终固定并指向北方,只有mapview才会按照转弯或位置设置animation或更改方位。 这是我们说的正确的 这是错误的

iOS谷歌地图1.9 – 我的位置图标

我刚刚更新了我的iOS应用程序与最新的谷歌地图版本1.9。 有时候,“当前位置”图标周围会出现这个白色矩形。 任何线索为什么?

如何将animation应用到GMSMarker

我正在改变我的应用程序通过使用谷歌地图SDK的iOS V1.1.0 iOS地图迁移到谷歌地图,我试图在添加/删除标记的animation,但我没有find任何build议在这方面的文档,请build议我如何在GMSMarkers上执行animation

MKCoordinateRegionMakeWithDistance不会在MapView上设置正确的区域

我有这个代码: – (void)viewDidLoad { [super viewDidLoad]; CLLocationCoordinate2D userLocation = CLLocationCoordinate2DMake(48.9793946200, 2.4726272850); CLLocationDistance dist1 = 636.9887048804; CLLocationDistance dist2 = 900.8380655203; CLLocationDistance dist = dist1; [self.myMapView setRegion:MKCoordinateRegionMakeWithDistance(userLocation, dist, dist) animated:YES]; // TEST // ———————————————————— MKCoordinateRegion region = self.myMapView.region; CLLocationDegrees lat = region.center.latitude; CLLocationDegrees lon = region.center.longitude – region.span.longitudeDelta/2; CLLocation *west = [[[CLLocation alloc] initWithLatitude:lat longitude:lon] autorelease]; NSLog(@"User […]

在Google Maps for iOS上路线图不要按照街道线路进行

我正在开发一个iOS应用程序,使用Google Directions API在由Google Maps SDK提供的地图上绘制路线。 它在小距离上效果很好,虽然当我把地图摄像机放得很近的时候,我发现路线多段线经常走出街道。 当距离更长时,这是一个真正的灾难,如果我放大,它不会跟随街道曲线。我从Directions API获得的overview-polyline中的点,但它看起来像多段线不是poly我想要。 在Android上,它完美的作品。 Google可能会向Android发送与iOS不同的方向吗? 你们有没有和我一样的问题? 编辑: -(int) requestDirecionsAndshowOnMap:(GMSMapView *)aMapView{ NSArray* mode=[[NSArray alloc]initWithObjects:@"transit",@"bicycling",@"walking",@"driving", nil]; NSString *depart=[[NSString alloc] initWithFormat:@""]; NSString *origin=[[NSString alloc] initWithFormat:@""]; NSString *destination=[[NSString alloc] initWithFormat:@""]; if (self.setLanguage) self.setLanguage=[NSString stringWithFormat:@"language=%@",self.setLanguage]; else self.setLanguage=@"language=en"; if (searchModeOption==0) { if (self.departDate==nil) { self.departDate=[NSDate date]; } depart=[NSString stringWithFormat:@"&departure_time=%i",(int)[self.departDate timeIntervalSince1970]]; } if (self.origin) { origin=[NSString stringWithFormat:@"origin=%@",self.origin]; […]

在iPhone中的Google地图中添加像UISlider或UIButtom这样的子视图

我是iOS编程的新手,对COCOA Touch知之甚less。 我试图在谷歌地图底部的屏幕上添加一个button,让用户可以select回到上一个屏幕。 我只知道UIButton是UIView的子类,我们可以使button出现在视图上,使其成为该类的子视图。 以前,iOS在默认情况下是通过MKMapView使用谷歌地图的,我曾在互联网上的书籍和书籍中看到过一个例子,在地图上显示一个button或一个文本框的应用程序屏幕截图。 但是现在只需在界面生成器中拖动button并不会有帮助。 这是我的代码: ViewController.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import <GoogleMaps/GoogleMaps.h> @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UIButton *btn; @end ViewController.m #import "ViewController.h" #import <MapKit/MapKit.h> #import <GoogleMaps/GoogleMaps.h> #import <CoreLocation/CoreLocation.h> @interface ViewController () @end @implementation ViewController { GMSMapView *mapView_; } – (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after […]

迦太基和谷歌地图

是否可以通过Carthage安装GoogleMap SDK? 我只看到了Cocoapods的教程。 或者我只能手动安装,如果我使用迦太基?