【问题标题】:GPS and draw MapRout in iphoneGPS和在iphone中绘制MapRout
【发布时间】:2012-03-16 05:04:09
【问题描述】:

我有一个固定的纬度和经度,所以我使用它并用 pin 在 mapview 中得到了点。现在我想要当前位置并绘制路线,所以我认为使用 gps 可以获得纬度和经度。使用这个位置(纬度和经度)我必须用我的固定值(纬度和经度)绘制一条路线。这怎么可能..?这是正确的方法吗? ?如何用两点绘制路线..?

我使用了委托方法,但它没有调用,

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation
           fromLocation:(CLLocation *)oldLocation
{
    [manager stopUpdatingHeading];

    NSLog(@"latitude=%f",newLocation.coordinate.latitude);

     NSLog(@"longitude=%f",newLocation.coordinate.longitude);
}

【问题讨论】:

    标签: iphone gps mkmapview core-location


    【解决方案1】:

    我认为最好的方法是使用谷歌的网络服务并将点作为折线绘制到地图视图。我正在使用http://maps.google.com/maps?f=d&hl=en&saddr=%lf,%lf&daddr=%lf,%lf&ie=UTF8&0&om=0&output=kml Web 服务,并在 mapView 上将路线绘制为折线。您将找到一个示例 here 在某些坐标上绘制折线。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-16
      • 1970-01-01
      • 1970-01-01
      • 2023-04-02
      相关资源
      最近更新 更多