如何从HereMap中删除所有地图对象?

时间:2018-04-20 09:30:40

标签: ios objective-c here-api

如何从HereMap中删除所有地图对象?

HereMap SDK仅提供

- (BOOL)removeMapObject:(nonnull NMAMapObject *)object
- (BOOL)removeMapObjects:(nonnull NSArray<NMAMapObject *> *)objects

1 个答案:

答案 0 :(得分:1)

你最有可能将NMAMapObject添加到地图中,我建议创建一个添加到地图中的所有对象的可变数组,所以当你这样做时

//in viewDidLoad for instance create an empty NSMutableArray called mapObjects
[self.mapView addMapObject:self.mapRoute];
[mapObjects addObject:mapObject];

然后当你想删除它们时,你将能够做到:

[self.mapView removeMapObject:mapObjects]; 

如果这对您有用,请告诉我......