BoldDesk®Customer service software offering ticketing, live chat, and omnichannel support, starting at $49/mo. for 10 agents. Try it for free.
Hello Team,
Based on API response, want to change markers on map. If, I received empty response then marker should be removed on map.
Thanks,
Yogesh Patil
Hi Yogesh,
We can render markers in the Maps component based on the data for markers from remote server. You can follow the below steps to achieve your scenario.
https://stackblitz.com/edit/react-x5t3ss-reuj5y?file=index.js
Please let us know if the above solution meets your requirement and let us know if you need any further assistance.
Regards,
Sabari Anand
Hello Syncfusion,
Thanks for reply.
You have provided me to Add Marker on map. I have already implemented it. I need a solution on how to remove marker from map.
Thanks,
Yogesh Patil
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.