【问题标题】:How can I change annotation title on Apple Maps Route如何更改 Apple Maps Route 上的注释标题
【发布时间】:2013-07-05 20:55:08
【问题描述】:

我已经使用 MKMapItem 创建了从 A 到 B 的路线,但我无法更改地图上注释的标题。我的代码:

CLLocation *locationRestaurante = [[CLLocation alloc] initWithLatitude:[[[listaRestaurante objectAtIndex:0] objectForKey:@"latitude"] floatValue] longitude:[[[listaRestaurante objectAtIndex:0] objectForKey:@"longitude"] floatValue]];

        MKPlacemark *place = [[MKPlacemark alloc] initWithCoordinate:locationRestaurante.coordinate addressDictionary:nil];

        MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place];

        NSDictionary *options = @{MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving};

        [mapItem openInMapsWithLaunchOptions:options];

它打开一切都很好......但只有一个问题:我无法更改此注释名称:

【问题讨论】:

    标签: ios xcode cocoa-touch maps apple-maps


    【解决方案1】:
    mapItem.name = @"Place name";
    

    MKMapItem Class Reference

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-01
      • 2017-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多