ios - 在 ios 中从此处 map 清除多条路线

标签 ios objective-c here-api

我正在像这样清除 HERE MAP,但它对我不起作用:

for (int i=0; i<self.NewMapRoute.count; i++)
{
     self.route = self.NewMapRoute[i];

     self.mapRoute = [NMAMapRoute mapRouteWithRoute:self.route];
     [self.mapView removeMapObject:self.mapRoute];
}

之前我添加了这样的 map 路线。

for (int i=0; i<self.NewMapRoute.count; i++)
{
      self.route = self.NewMapRoute[i];

      self.mapRoute = [NMAMapRoute mapRouteWithRoute:self.route];
      [self.mapRoute setColor:[arrycolor objectAtIndex:i]];
      [self.mapView addMapObject:self.mapRoute];
}

最佳答案

您不能删除刚刚创建的 map 对象。对象是否使用相同的 route 创建并不重要。您需要引用之前添加的 NMAMapRoute。我在 NMAMapView 上没有看到用于获取已添加 map 对象的当前列表的 API,因此您可能必须自己管理此列表。

关于ios - 在 ios 中从此处 map 清除多条路线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39849856/

相关文章:

ios - 使用适用于 iOS 的 FBSDK 4.x 在 facebook 上发布图像

objective-c - objective-c中private和public成员应该如何实现?

objective-c - 将 0 作为枚举选项传递到 Swift 中的 Objective C 函数中

javascript - 如何设置 map 的缩放比例,以便可以完全看到我的路线? (这里.com api)

ios - 这里映射iOS SDK : Change the colour of sublegs in a route

ios - 如何只向 UIImageView 添加右边框

ios - 读取将数组数据写入 plist 不起作用

objective-c - 在 React Native 自定义 UI 组件中使用 CocoaPods 模块

objective-c - SLComposeViewController 完成处理程序

javascript - 如何在 InfoBubble 内调用外部点击事件 - 此处 API Javascript 3