标签: mapkit

在MKMapView上隐藏Google徽标

有人知道如何隐藏Google徽标MKMapView吗?

我不想隐藏它.我想要相反的.原因是一个应用程序因为被拒绝了

8.6如果原始内容的所有品牌特征保持不变且完全可见,则可以在应用程序中使用通过Google Maps API获取的Google地图和Google地球图像.覆盖或修改Google徽标或版权所有者身份的应用将被拒绝

现在我想撤消这个,但我不知道哪个代码对这个行为负责.

编辑:

我认为原因是这个代码行

self.mapView=[[[MKMapView alloc] initWithFrame:self.view.bounds] autorelease];
Run Code Online (Sandbox Code Playgroud)

self.view.bounds不会占用帐户中的导航栏.我会试试这个:

CGRect mapSize = CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y, self.view.bounds.size.width, self.view.bounds.size.height - 44.0f);
self.mapView = [[[MKMapView alloc] initWithFrame:mapSize] autorelease];
Run Code Online (Sandbox Code Playgroud)

iphone google-maps mapkit mkmapview appstore-approval

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

地理围栏指标与位置服务指标

我有一个应用程序,显示用户位置的地图,并跟踪用户,直到应用程序移动到后台.此时,位置管理器被告知停止更新位置,而是监视一个区域(最后一个已知位置周围100米半径).在iOS模拟器上,它按预期工作并显示Geofencing指标(与常规位置服务指标相同,但仅限于大纲).在iPhone上,它似乎按预期工作,但显示常规位置服务图标而不是单独的轮廓.

是否有任何原因可能发生这种情况,模拟器和手机之间存在这种差异? 我只是想确保手机真的只使用Geofencing而没有其他服务(即确保最少的电池使用).

附加信息:

我已经要求将后台模式设置为接收位置更新 - 这是在特定情况下(当用户启用它时)而不是所有时间.不过,我已尝试禁用此功能,问题仍然存在.

我用来为应用程序添加背景的代码:

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Only monitor significant changes – unless specified
    if(!self.viewController.userSpecifiedToUseLocationServices)
    {
        // Stop using full location services
        [self.viewController.locationManager stopUpdatingLocation];

        // Create a boundary -- a circle around the current location
        self.viewController.currentBoundary = [[CLRegion alloc] initCircularRegionWithCenter:self.viewController.locationManager.location.coordinate radius:kSignificantLocationChange identifier:@"Current Location Boundary"];

        // Monitor the boundary
        [self.viewController.locationManager startMonitoringForRegion:self.viewController.currentBoundary desiredAccuracy:kCLLocationAccuracyBest];
    }
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Stop monitoring the region
    if(self.viewController.currentBoundary != nil)
    {
        [self.viewController.locationManager stopMonitoringForRegion:self.viewController.currentBoundary];
        self.viewController.currentBoundary = nil;
    }

    // Start …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c core-location mapkit ios

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

如何将MKMapView置于罗盘模式?

我在我的.xib上放了一个MKMapView.
它工作正常,但我需要地图根据罗盘标题旋转?

我读过"罗盘模式".
也许我需要将compassMode的MKMapView属性设置为true.但是我在MKMapView的属性中找不到这样一个选项的复选框.

那么如何为我的mapview启用罗盘模式?
是否没有启用此功能的复选框.
顺便说一句,.我甚至在developer.apple.com上观看了46分钟的视频

"使用MapKit在地理上可视化信息".
该视频演示了一个以这种指南针模式工作的应用程序.但我从来没有看到任何解释如何让它像那样工作.任何建议都会很棒.-JD

mapkit mkmapview compass-geolocation

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

iOS6 CLPlacemark显示街道名称

我想显示用户位置的完整街道名称,下面的代码我只能显示城市名称:

-(void) reverseGeocode:(CLLocation *)location{
   CLGeocoder *geocoder = [[CLGeocoder alloc]init];
[geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) {    
    if(error) {
        NSLog(@"Error");
        return;
    }  
    if(placemarks) {
        CLPlacemark *placemark = placemarks [0];
        NSArray *lines = placemark.addressDictionary[ @"FormattedAddressLines"];
        NSString *addressString = [lines componentsJoinedByString:@"\n"];
        NSLog(@"Address: %@", addressString);
    }
}];}
Run Code Online (Sandbox Code Playgroud)

关于如何获得街道名称的任何想法?

mapkit ios ios6

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

MapView检测滚动

我希望的是MKMapView继承UIScrollView就像UITableViewUICollectionView是.这样,您可以覆盖UIScrollView委托方法并执行您需要执行的操作.

我找到了将平移手势附加到MapView类似的方法,所以:

UIPanGestureRecognizer* mapPanGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(mapPanGestureHandler:)];
[mapPanGestureRecognizer setDelegate:self];
[self.mapView addGestureRecognizer:mapPanGestureRecognizer];
Run Code Online (Sandbox Code Playgroud)

除了mapView具有减速元件的事实之外,这相当好.例如,如果您处于中间滚动并抬起手指,地图会继续前进并减速然后最终停止.

我正在做的是UIView使用核心图形在我的地图(另一个)顶部的叠加层中渲染一些屏幕外注释.除减速问题外,它工作得很好.

我需要知道的是地图已经移动了.我需要的参数我可以直接从地图本身查询.

有没有人找到一种技术来减速时获得回调?我的意思是我想我可以在手势结束时重复射击半秒钟左右使用计时器.

uiview mapkit ios

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

从MKTileOverlayPath获取MKMapRect

我搜索了很多答案,我无法想象这种方法不存在!! 我有一个MKTileOverlayPath(x,y和z),也能够得到这个矩形中心的lon/lat.现在我需要得到每个矩形的跨度,这可能吗?

mapkit ios

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

MKAnnotation子类问题

我昨晚升级到Swift 1.2,我得到了一个我真想不通的bug.以下代码在之前版本的Xcode和Swift中运行良好.

//MARK: Annotation Object
class PointAnnotation : NSObject, MKAnnotation {
    var coordinate: CLLocationCoordinate2D
    var title: String
    var subtitle: String
    var point: Point
    var image: UIImage
    var md: String

    init(point: Point) {
        self.coordinate = point.coordinate
        self.title = point.title
        self.subtitle = point.teaser
        self.image = UIImage(named: "annotation.png")!
        self.point = point
        self.md = point.content
    }
}
Run Code Online (Sandbox Code Playgroud)

在第3行,我得到了一些有点难以理解的错误 Objective-C method 'setCoordinate:' provided by the setter for 'coordinate' conflicts with the optional requirement method 'setCoordinate' in protocol 'MKAnnotation'我尝试更改变量名称等,但没有帮助.有谁知道如何解决这个问题?

该课程用于我的mapview上的注释.

xcode mapkit mkannotation ios swift

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

在mapView中识别MKPointAnnotation

我有至少100个不同的点...如何将每个点与我的'listOfPoints'中的位置相关联,在viewForAnnotation中关联的位置分配一个标记.

在这里我添加我的积分,一些事件将具有相同的标题.

var listOfPoints : Array<Events> = [] // List Of all events

//add points to map
    for (index, mPoints) in enumerate(listOfPoints) {

        var point: MKPointAnnotation! = MKPointAnnotation()
        var location = CLLocationCoordinate2D(latitude: mPoints.latitude, longitude: mPoints.longitude)
        point.coordinate = location
        point.title = mPoints.name
        point.subtitle = mPoints.address
        self.mapView.addAnnotation(point)
    }

//Draw custom pin in the map

func mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -> MKAnnotationView! {
    print("ffff");

    var identifier = "CustomAnnotation"


    if annotation.isKindOfClass(MKPointAnnotation) {
        var pin = mapView.dequeueReusableAnnotationViewWithIdentifier(identifier)

        if pin == nil {
            pin = …
Run Code Online (Sandbox Code Playgroud)

mapkit mkpointannotation swift

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

如何使用Mapkit和Swift在设置的位置叠加一个圆

我在尝试弄清楚如何在用户位置唯一的所需位置显示透明圆形或矩形时遇到麻烦。我是mapkit的初学者,在此先感谢。

class FirstViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate
{

@IBOutlet weak var mapView: MKMapView!

let locationManager = CLLocationManager()

override func viewDidLoad()
{
    super.viewDidLoad()

    self.locationManager.delegate = self
    self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
    self.locationManager.requestAlwaysAuthorization()
    self.locationManager.startUpdatingLocation()
    self.mapView.showsUserLocation = true

}

func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
{
    let location = locations.last
    let center = CLLocationCoordinate2D(latitude: location!.coordinate.latitude, longitude: location!.coordinate.longitude)
    let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 1, longitudeDelta: 1))
    self.mapView.setRegion(region, animated: true)
    self.locationManager.stopUpdatingLocation()//
}

func locationManager(manager: CLLocationManager, didFailWithError error: NSError)
{
    print("Errors: " + error.localizedDescription)
}

}
Run Code Online (Sandbox Code Playgroud)

location overlay mapkit ios swift

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

点击MapKit的手势

目前我有一张有几个的地图Annotations.

对于Annotations我有

func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView){
     // Do your annotation click work
}
Run Code Online (Sandbox Code Playgroud)

是否可以执行此操作仅用于点击地图而不是,Annotation我该怎么做?

core-location mapkit ios swift swift3

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