我正在像这样清除 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/