Vivek
Vivek

Reputation: 5223

How can I remove all map object from HereMap?

How can I remove all map objects from HereMap ?

HereMap SDK only provide

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

Upvotes: 0

Views: 610

Answers (1)

Ladislav
Ladislav

Reputation: 7283

You are most likely adding NMAMapObject's to the map, I would suggest creating a mutable array of all objects added to the map, so when you do

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

Then when you want to remove them all you will be able to do:

[self.mapView removeMapObject:mapObjects]; 

Let me know if that would work for you...

Upvotes: 1

Related Questions