Hi Yogesh,
All the markers in the Maps component can be removed by setting empty array in the “markerSettings” property. Please find the code snippet below.
Code Snippet:
clearMarker() { this.mapInstance.layersCollection[0].markerSettings = []; } <ButtonComponent value="clear" onClick={this.clearMarker.bind(this)} style={'MarginLeft'='30px'}> Clear Marker </ButtonComponent> <MapsComponent id="maps"ref={(m) => (this.mapInstance = m)}></MapsComponent> |
You can find the sample for your reference from the below link.
https://stackblitz.com/edit/react-x5t3ss-yihceq?file=index.js
Please let us know if the above solution meet your requirement and let us know if you need any further assistance.