标签: userlocation

除了用户位置注释之外,如何从MKMapView中删除所有注释?

removeAnnotations用来删除我的注释,mapView但同样删除用户位置ann.我该如何防止这种情况,或者如何让用户回来查看?

NSArray *annotationsOnMap = mapView.annotations;
        [mapView removeAnnotations:annotationsOnMap];
Run Code Online (Sandbox Code Playgroud)

xcode mkmapview mkannotation userlocation ios

40
推荐指数
3
解决办法
3万
查看次数

如何将MKMapView的用户位置蓝点更改为选择的图像?

是否可以将指示用户所在位置的蓝点更改为MKMapView图像?比如一辆小汽车或任何.png形象?

在此输入图像描述

iphone objective-c mkmapview userlocation ios

33
推荐指数
2
解决办法
4万
查看次数

NSLocationWhenInUseUsageDescription警告但我已经添加了它

虽然我已经添加了

NSLocationWhenInUseUsageDescription

我一直收到这个警告

此应用尝试访问隐私敏感数据,但没有使用说明.应用程序的Info.plist必须包含一个NSLocationWhenInUseUsageDescription键,其中包含一个字符串值,向用户解释应用程序如何使用此数据

仅供参考:我在应用程序中有多个info.Plist.不知道该怎么办?

location info.plist userlocation ios swift

16
推荐指数
4
解决办法
3万
查看次数

MKMapView的用户位置在启动或恢复时出错

当我开始我的应用程序新鲜,或在很长一段时间后恢复,MKMapView的userLocation的概念是错误的,并显示我在海中.

我使用以下代码:

self.mapView.centerCoordinate = self.mapView.userLocation.location.coordinate;
[mapView setCenterCoordinate:self.mapView.userLocation.location.coordinate zoomLevel:ZOOM_LEVEL animated:YES];
Run Code Online (Sandbox Code Playgroud)

经过漫长的应用程序简历或全新的开始......

iphone mkmapview userlocation game-center

9
推荐指数
2
解决办法
6895
查看次数

如何在Mapbox for iOS SDK中使用userLocation找到正确的位置数据?(迅速)

我正在尝试找到用户位置的纬度和经度,以便我可以在viewdidload中将地图置于用户的中心位置.

我已经实现了似乎是正确的代码,但userLat(纬度)和userLon(经度)的值是关闭的.

NB有人和我有同样的问题,但他的答案从未得到解决: Mapbox iOS8 Swift mapView.showUsersLocation

import Mapbox

class ViewController: UIViewController, MGLMapViewDelegate, CLLocationManagerDelegate {

//    let locationManager = CLLocationManager()

    @IBOutlet weak var mapView: MGLMapView!

    override func viewDidLoad() {
        super.viewDidLoad()

        // Initalise map's center coordinate as vancouver
        mapView.setCenterCoordinate(CLLocationCoordinate2D(latitude: 49.283382,
            longitude: -123.117394),
            zoomLevel: 15, animated: false)
        view.addSubview(mapView)

        // Set the delegate property of our map view to self after instantiating it.
        mapView.delegate = self

        // User location
        mapView.showsUserLocation = true

        let userLoc = mapView.userLocation!
        userLoc.title = "Hello"
        userLoc.subtitle = "I am …
Run Code Online (Sandbox Code Playgroud)

userlocation ios mapbox

8
推荐指数
2
解决办法
4411
查看次数

如何确定当前用户位置是否在我的MKCoordinateRegion内?

我有一个我确定的坐标区域包含我想要为我的应用程序显示的限制.我把它设置为MKCoordinateRegion,中心点为lat,经度和跨度.如何确定当前userLocation是否在我的坐标区域内?

gps mapkit mkcoordinateregion userlocation ios5

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

当用户位置已知或更改时,如何以可视方式居中显示MKMapView地图?

我已阅读并按照说明如何在没有CLLocationManager的情况下将MKMapView缩放到用户当前位置?

然而,虽然我确实得到了当前的用户位置,但我实际上无法使地图在视觉上居中.

例如,在viewDidLoad函数中,如何使地图围绕用户已知位置进行可视化居中?我已粘贴下面CurrentLocation的代码(请参阅viewDidLoad中的XXX注释


#import "MapViewController.h"
#import "PlacemarkViewController.h"

@implementation MapViewController

@synthesize mapView, reverseGeocoder, getAddressButton;

- (void)viewDidLoad
{
    [super viewDidLoad];

    // XXX HERE: How can I cause self.mapView to actually recenter itself at self.mapview.userLocation.location?


    mapView.showsUserLocation = YES;
}

- (void)viewDidUnload
{
    self.mapView = nil;
    self.getAddressButton = nil;
}

- (void)dealloc
{
    [reverseGeocoder release];
    [mapView release];
    [getAddressButton release];

    [super dealloc];
}

- (IBAction)reverseGeocodeCurrentLocation
{
    self.reverseGeocoder =
        [[[MKReverseGeocoder alloc] initWithCoordinate:mapView.userLocation.location.coordinate] autorelease];
    reverseGeocoder.delegate = self;
    [reverseGeocoder start];
}

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
{ …
Run Code Online (Sandbox Code Playgroud)

iphone center map mkmapview userlocation

6
推荐指数
1
解决办法
2万
查看次数

在地图中显示当前位置时获取纬度和经度0.0

我使用以下代码来获取我当前的位置.但我面临的问题是,纬度和经度总是返回0.0.我已打开手机中的GPS设置并设置所有权限.但我仍然面对这个问题.

locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);

customLocationListener = new CustomLocationListener();

locationManager.requestLocationUpdates(

        LocationManager.GPS_PROVIDER,

        0,

        0,

        customLocationListener);

class CustomLocationListener implements LocationListener{ ............

      public void onLocationChanged(Location argLocation) { 

         if(location != null) {     

        int latitude=(int)(argLocation.getLatitude()*1E6);   

        int longitude=(int)(argLocation.getLongitude()*1E6);


              }
       } ........ }
Run Code Online (Sandbox Code Playgroud)

你们中的任何人都知道为什么吗?

注意:我的活动扩展了MapActivity而不是Location Listener

android google-maps map geolocation userlocation

6
推荐指数
2
解决办法
3万
查看次数

禁用MKmapkit mapView userLocation annotationView

我有一个mapViewannotationViewsuserLocation蓝点.

我使用以下代码获取蓝点:

[self.mapView setShowsUserLocation:YES];
Run Code Online (Sandbox Code Playgroud)

annotationViews可选择,并有标注.

但是,如果一个annotationView接近用户的位置,有时蓝点会窃取触摸.

我可以设置一个annotationView.enabled = NO;,它会显示annotationView但它不会从附近偷一个触摸annotationView.

我想将用户位置蓝点设置annotationView为enabled = NO,因此它不会触及附近的触摸annotationViews.

我可以设置蓝点的标题:

self.mapView.userLocation.title = @"title here..."
Run Code Online (Sandbox Code Playgroud)

但我无法禁用蓝点.

谢谢!

objective-c mapkit userlocation ios

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

如何更改文本"App想要使用您当前的位置?"

我们可以更改此文本吗?

我已经使用属性purposeCLLocationManager类.但是消息没有改变.

[locationManager setPurpose:@"Change text message"];
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

谢谢,

iphone delegates cllocationmanager userlocation ios

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