标签: google-maps-sdk-ios

如何在iOS中确定位置源

我正在获取当前位置,在我的应用程序中,我想知道我的位置来自 GPS、WIFI 或蜂窝数据。我如何检查? 有没有办法确定位置源?

苹果 iOS 使用

辅助全球定位系统 (A-GPS)

众包 Wi-Fi

蜂窝网络搜索

确定您的位置:

这三个阶段按优先级的降序使用。换句话说,iOS 首先尝试使用 GPS 卫星链接来修复您的位置。如果无法获取卫星,iOS 会故障切换到 Wi-Fi。如果您未连接到 Wi-Fi 局域网 (WLAN),则 iOS 会使用基站数据

iphone location objective-c ios google-maps-sdk-ios

1
推荐指数
1
解决办法
1000
查看次数


谷歌地图标记不删除iOS

我正在运行一个线程来每10秒获取一次驱动程序位置,并希望从地图中删除添加的标记,但它不起作用..

我的代码:

-(void)APiResponse:(id)returnJson
{        
        [googleMapsDriverPin setMap:nil];
        googleMapsDriverPin = nil;

        NSMutableArray *driverPins = [[NSMutableArray alloc]init];
        for (int x = 0; x < [[returnJson valueForKey:@"drivers"] count]; x++) {
            CLLocation *driverLocations = [[CLLocation alloc]initWithLatitude:[[[[returnJson valueForKey:@"drivers"] objectAtIndex:x] valueForKey:@"driver_latitude"] doubleValue] longitude:[[[[detail valueForKey:@"drivers"] objectAtIndex:x] valueForKey:@"driver_longitude"] doubleValue]];
            [driverPins addObject:driverLocations];
        }

        for (CLLocation *newLocation in driverPins) {
            googleMapsDriverPin = [[GMSMarker alloc] init];
            [googleMapsDriverPin setPosition:newLocation.coordinate];
            [googleMapsDriverPin setAnimated:YES];
            [googleMapsDriverPin setTitle:@"title"];
            [googleMapsDriverPin setSnippet:@"snippet"];
            [googleMapsDriverPin setIcon:[GMSMarker markerImageWithColor:[UIColor blackColor]]];
            [googleMapsDriverPin setMap:googleMaps];
         }
}
Run Code Online (Sandbox Code Playgroud)

它只是每隔10秒添加和添加而不是删除,请帮忙!谢谢!

iphone objective-c ios google-maps-sdk-ios

0
推荐指数
1
解决办法
5968
查看次数

Google Maps IOS SDK可以免费使用吗?

我们有一个商业网络应用程序,我们正计划为我们的客户开发Android和iOS应用程序(免费)

  1. 谷歌地图ios sdk可以在我的应用程序中免费使用吗?

  2. 我们想通过我们的应用程序使用自定义网址方案打开谷歌地图应用程序来显示行车路线.这种方法有任何限制吗?

objective-c ios google-maps-sdk-ios

0
推荐指数
1
解决办法
2454
查看次数

添加谷歌地图标记,点击并按住手势

我正在Xamarin.IOS中编写一个应用程序,它有一个显示Google Maps MapView的控制器,我想在用户点击并保持地图中的任何一点时添加一个标记

到目前为止,我已经尝试将手势识别器添加到MapView对象,但它无法正常工作.这是我的地图控制器代码:

public async override void ViewDidLoad ()
{
    base.ViewDidLoad ();
    View.BackgroundColor = UIColor.White;
    var geolocator = new Geolocator { DesiredAccuracy = 50 };
    location = await geolocator.GetPositionAsync (10000);

    var camera = CameraPosition.FromCamera (latitude: location.Latitude, 
            longitude: location.Longitude, zoom: 6);
    mapView = MapView.FromCamera (RectangleF.Empty, camera);
    mapView.MyLocationEnabled = true;

    var longGesture = new UILongPressGestureRecognizer (LongPress);
    longGesture.MinimumPressDuration = 2.0;
    mapView.AddGestureRecognizer (longGesture);

    mapView.StartRendering ();
    View = mapView;
}

public override void ViewWillDisappear (bool animated)
{   
    mapView.StopRendering ();
    base.ViewWillDisappear (animated);
}

[Export("LongPress")]
void …
Run Code Online (Sandbox Code Playgroud)

xamarin.ios xamarin google-maps-sdk-ios

0
推荐指数
1
解决办法
1275
查看次数

将Google方向JSON字符串网址转换为网址

let stringOFDirection: String = "https://maps.googleapis.com/maps/api/directions/json?origin=23.0723857839751,72.5160750795044&destination=23.057534,72.577191&waypoints=optimize:true|23.0557874,72.465833"

let directionsURL = URL(string: stringOFDirection)!
Run Code Online (Sandbox Code Playgroud)

问题是directionsURL是零

我知道解决方案但是,在这个URL不起作用

请帮我!

json ios google-maps-sdk-ios swift swift4

0
推荐指数
1
解决办法
163
查看次数

样式功能已添加到Google地图

我通过解析GeoJSON向我的GMSMapView添加了功能。但是,在弄清楚如何设置此功能样式时,我遇到了极大的麻烦。

当前,该功能是默认的蓝色笔触和半透明的蓝色填充。我想改变这些颜色。我尝试查看了文档,但这是毫无帮助的。我在互联网上可以找到的所有其他问题都与JavaScript API有关。

如何在Google Map上设置特定功能的样式(仅是GeoJSON文件中的样式)?优选地,这将是动态的,但并非必须如此。

google-maps geojson ios google-maps-sdk-ios swift

0
推荐指数
1
解决办法
426
查看次数

如何在谷歌地图上绘制正确的折线

我已经成功地从点a到点b绘制了折线,但由于某种原因,它显示的是直线而不是正确的航点

这是代码

let path = GMSMutablePath()
        path.addLatitude(3.1970044, longitude:101.7389365)
        path.addLatitude(3.2058354, longitude:101.729536)
        let polyline = GMSPolyline(path: path)
        polyline.strokeWidth = 5.0
        polyline.geodesic = true
        polyline.map = mapView
Run Code Online (Sandbox Code Playgroud)

我期待它会做一些航点,但它只显示直线折线

在此输入图像描述

google-maps google-maps-api-3 ios google-maps-sdk-ios swift

-1
推荐指数
2
解决办法
9501
查看次数