openseadragon: Navigator in Custom Location - Exception Thrown on destroy()

When the Navigator is used in a custom location, e.g.

    OpenSeadragon({
        ...
        showNavigator:  true,
        navigatorId:   "navigatorDiv",
        ...
    });

If destroy() is called on the navigator’s Viewer, an exception is thrown. This occurs when Control.destroy() calls Node.removeChild() to remove the Navigator, which isn’t a child of any control container.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (13 by maintainers)

Commits related to this issue

Most upvoted comments

This works for me:

    destroy: function() {
        this.wrapper.removeChild( this.element );
        if ( this.anchor !== $.ControlAnchor.NONE ) {
            this.container.removeChild( this.wrapper );
        }
    },

@zero41120 Thank you for that. I don’t think we should even be calling removeChild if the navigator is placed in an external element, Hopefully just a check for the anchor being $.ControlAnchor.NONE should be done

@JoFrMueller would you be up for fixing this as a follow-up to your #1832?

If not, I’ll take this one…