-1

I have used both the lite sdk and the explore sdk available for the swift ios, for integration with here maps. I haven't passed by any of the ways to clear map markers already set on a screen on the mapview. Kindly let me if any workaround is available.

1 Answers1

0

You can remove MapMarker items with the HERE SDK for iOS (Explore Edition) by calling:

mapView.mapScene.removeMapMarker(mapMarker)

Make sure that the mapMarker is the same instance you have added before, otherwise, the code will do nothing.

In case of doubt, try the MapItems example app on GitHub. In this line it shows how to remove all added markers.

Nusatad
  • 3,231
  • 3
  • 11
  • 17
  • My use case was to clear all the map markers that had been added to the map scene. However, your mapView.mapScene.removeMapMarker(mapMarker) only removes a given particular marker. The work around i used was to store the instance of each marker in a an array or some datastore object and then call the removeMapMarker on each instance. It did my work. – Saad Rafique Jul 15 '21 at 10:10