你的位置:首页 > 操作系统

[操作系统]iOS第三方地图-高德地图(导航sdk路径规划)



会调MAMapViewDelegate中的生成相应的anntation

/*! @brief 根据anntation生成对应的View @param mapView 地图View @param annotation 指定的标注 @return 生成的标注View */- (MAAnnotationView *)mapView:(MAMapView *)mapView viewForAnnotation:(id <MAAnnotation>)annotation;

绘制路径(得到路径信息绘制)

- (void)showRouteWithNaviRoute:(AMapNaviRoute *)naviRoute{  if (naviRoute == nil)  {    return;  }    // 清除旧的overlays  if (_polyline)  {    [self.mapView removeOverlay:_polyline];    self.polyline = nil;  }    NSUInteger coordianteCount = [naviRoute.routeCoordinates count];  CLLocationCoordinate2D coordinates[coordianteCount];  for (int i = 0; i < coordianteCount; i++)  {    AMapNaviPoint *aCoordinate = [naviRoute.routeCoordinates objectAtIndex:i];    coordinates[i] = CLLocationCoordinate2DMake(aCoordinate.latitude, aCoordinate.longitude);  }    _polyline = [MAPolyline polylineWithCoordinates:coordinates count:coordianteCount];  [self.mapView addOverlay:_polyline];}