I have been using Ammap Library and created Map.
https://www.amcharts.com/demos/custom-html-elements-map-markers/
I want to delete Map images object by using method(), Details are in below link. Could any one let me know how to use this method()
https://docs.amcharts.com/3/javascriptmaps/MapImage#deleteObject
Method Name:"deleteObject()"
Thanks in Advance
deleteObject
is a member method of the image/object itself, so you just call it from the object you want to delete, e.g.image.deleteObject();
If your map is using custom HTML elements like in the demo, you also need to remove the div generated in your
createCustomMarker
method by callingremoveChild
in the DOM. You need to be able to access that div somehow, so I recommend modifying it to set the div'sid
to something you can look up later like the image's id:This modification assumes you set an id in your images, which is also recommended since you can use the
getObjectById
method to get the image object and call itsdeleteObject
method.Here's a sample function that deletes both the image and custom marker when an image ID is provided:
Demo - Click on the buttons to delete the corresponding marker.