Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Azure maps close htmlMarker popup programmatically

Can’t seem to close the azure maps htmlMarker popup programmatically using popup.close()

I’m using azure maps to display htmlMarkers on the map and using azure maps htmlMarkers to display a popup when a marker is clicked. Azure maps htmlMarker popup provides a close button on the popup but I need the popup to close when a user clicks the Add to Route button on the popup. As per azure maps documentation popup.close should work but I can’t seem to make it work. Any suggestions will be greatly appreciated!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

There are two ways to close the popup attached to an HTML marker programmatically.

The first, if you know it is open, is to use the markers togglePopup function.

 marker.togglePopup();

The second is to get the popup instance from the markers options, then call the close function.

marker.getOptions().popup.close();
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading