Tag: 谷歌地图

ios定期获取我的位置,并设置button来获取我的位置 – 谷歌地图不工作

我正在使用Google Map Module,使用1.9.0 Bundle来定期查找我的位置,比如说10秒钟,并创build一个button来获取我的位置button作为一个地图视图设置 当执行和位置服务打开时,单击右下angularbutton后没有响应,位置pipe理器不工作。 我可以显示使用位置服务的任何迹象。 我不知道我在设置这个地图上缺less什么,因为我严格遵循SDKDemos – iOS的谷歌演示项目来设置我的模块。 你能告诉我确切的方法来设置它吗? 以下是我的代码: @implementation MapViewController -(bool)isNetworkAvailable { SCNetworkReachabilityFlags flags; SCNetworkReachabilityRef address; address = SCNetworkReachabilityCreateWithName(NULL, "www.apple.com" ); Boolean success = SCNetworkReachabilityGetFlags(address, &flags); CFRelease(address); bool canReach = success && !(flags & kSCNetworkReachabilityFlagsConnectionRequired) && (flags & kSCNetworkReachabilityFlagsReachable); return canReach; } – (void)requestAlwaysAuthorization { CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; // If […]

无法让我的位置显示在iOS 8的Google地图中

我正在尝试在iOS 8的Swift项目中使用Google Maps for iOS。我添加了Objective-C桥接标头,并按照其文档中的说明添加了Google Maps SDK。 我试过这个例子,它工作得很好。 我需要显示我目前的位置。 我在我的iOS 8模拟器中设置自定义位置的坐标,并修改了这个 StackOverflow答案中显示的代码。 下面是它的Swift版本。 import UIKit import Foundation class MapViewController: UIViewController { @IBOutlet var mapView: GMSMapView! var firstLocationUpdate: Bool? override func viewDidLoad() { super.viewDidLoad() let camera = GMSCameraPosition.cameraWithLatitude(-33.86, longitude: 151.20, zoom: 12) mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera) mapView.settings.compassButton = true mapView.settings.myLocationButton = true mapView.addObserver(self, forKeyPath: "myLocation", […]

未find<GoogleMaps / GoogleMaps.h>文件的Google Maps SDK for iOS

昨天我收到谷歌的一封电子邮件,说我可以访问ios的地图API,我从应用程序控制台生成了我的密钥,然后按照https://developers.google.com/maps/documentation/ios/start但Xcode抛出这个错误。 #import <GoogleMaps/GoogleMaps.h> //file not found 感谢您的支持。 出现Headers可执行文件而不是文件夹是正常的? 解决了!

谷歌地图iOS SDK:用作标记的自定义图标

Android API有一个非常方便的类IconGenerator 。 在我的Android应用程序中使用IconGenerator ,我可以很容易地创build一个标记: 是一个简单的矩形与我select的颜色。 resize来保存任何长度的文本。 是不是一个信息窗口 – 我想标记本身包含Android的版本下面的图像中显示的文本。 // Android – problem solved with IconGenerator IconGenerator iconGenerator = new IconGenerator(context); iconGenerator.setStyle(IconGenerator.STYLE_GREEN); // or any other color Bitmap iconBitmap = iconGenerator.makeIcon(myString); Marker m = new MarkerOptions().icon(BitmapDescriptorFactory.fromBitmap(iconBitmap)) .position(myLatLng); map.addMarker(m); // map is a com.google.android.gms.maps.GoogleMap 有没有办法在iOS中使用Swift做这样简单的事情? 最近有一个允许“标记自定义”的iOS API 版本 ,但是我不知道如何将其应用到这个用例。 // iOS (Swift) – I don't […]

iOS谷歌地图textField没有响应

#import "MyLocationViewController.h" #import <GoogleMaps/GoogleMaps.h> @interface MyLocationViewController () @end @implementation MyLocationViewController { GMSMapView *mapView_; CLLocationManager *locationManager; } – (void)viewDidLoad { [super viewDidLoad]; locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBest; [locationManager startUpdatingLocation]; NSLog(@"Current identifier: %@", [[NSBundle mainBundle] bundleIdentifier]); GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:6]; mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; mapView_.myLocationEnabled = YES; […]

ios Google SDK Map不能创build虚线多段线

我已经调用下面的方法来绘制标记之间的虚线折线。 当涉及到执行时,它显示只绘制实线。 您能否告诉我如何在Google Map上绘制虚线? – (void) createDashedLine:(CLLocationCoordinate2D )thisPoint:(CLLocationCoordinate2D )nextPoint: (UIColor *)colour { NSLog(@"next pt latitude %ff" , nextPoint.latitude); NSLog(@"next pt longitude %ff" , nextPoint.longitude); NSLog(@"this pt laatitude %ff" , thisPoint.latitude); NSLog(@"this pt longitude %ff" , thisPoint.longitude); double difLat = nextPoint.latitude – thisPoint.latitude; double difLng = nextPoint.longitude – thisPoint.longitude; double scale = camera.zoom * 2; double […]

用箭头replaceGMSMapView中的蓝点 – Swift

我使用Google SDK作为应用程序iOS8(Swift)。 我想用智能手机的方向旋转的箭头来replaceGMSMapView中的蓝点(我的位置)。 我怎样才能做到这一点? 编辑: 我设法看到我的箭头,但我有三个问题: 1:箭头被切断,我没有find放大的区域 2:箭头的位置不完全在我的位置我通过删除“0,5”来解决这个问题: CGContextTranslateCTM(context, size.width, size.height) 3:箭头的方向与原来的对称我在“度”之前加“ – ”来解决这个问题: CGContextRotateCTM(context, CGFloat(DegreesToRadians(Double(-degrees)))) 如何解决这些问题?

用Google maps iOS sdk在swift中创build自定义信息窗口?

我创build了一个xib和一个视图控制器,并希望在swift中为其显示一个标记的自定义信息窗口。 在互联网上search后,我发现在OBJ-C的老教程,但这不会帮助我。 谢谢。

iPhone – 从Latitude和Longtiude获取城市名称

我想在我的iPhone应用程序中获取我的当前城市名称。 我目前正在使用CLLocationManager获取经度和纬度,比我将我的坐标传递到CLGeocoder。 CLGeocoder * geoCoder = [[CLGeocoder alloc] init]; [geoCoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) { for (CLPlacemark * placemark in placemarks) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Current City" message:[NSString stringWithFormat:@"Your Current City:%@",[placemark locality]] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel", nil]; [alert show]; } }]; 这在iOS 5.0中工作正常,但不在iOS 4.3中工作。 另外,我开始使用Google Web服务 -(void)findLocationFor:(NSString *)latitudeStr andLontitude:(NSString *)longtitudeStr{ if ([self connectedToWiFi]){ […]

Google Maps iOS SDK,获取2个位置之间的路线

在使用Google Maps SDK的同时,我试图在iOS上的两个位置之间取得驾驶方向。 我知道我们可以用两种方法做到这一点: 1.)使用URL Scheme,为此,需要将Google Maps App安装在您的设备上。 2.)使用Directions API,通过请求响应,然后parsingJSON。 显示标记以显示方向。 现在,我的问题是有什么其他方式可以在iOS上做到这一点? 我需要显示从我的当前位置到具有纬度/经度的特定位置的方向。 我的意思是真的不可能简单地通过2位置作为参数和谷歌地图SDK,会给我的方向? 谢谢,