code: function () {
              var self = this;
  
              // Detach all event listeners attached to the container
              self.$container.off("." + pluginName);
              self.$map.off("." + pluginName);
  
              // Detach the global resize event handler
              if (self.onResizeEvent) $(window).off("resize." + pluginName, self.onResizeEvent);
  
              // Empty the container (this will also detach all event listeners)
              self.$map.empty();
  
              // Replace initial HTML content
              self.$map.html(self.initialMapHTMLContent);
  
              // Empty legend containers and replace initial HTML content
              $.each(self.legends, function(legendType) {
                  $.each(self.legends[legendType], function(legendIndex) {
                      var legend = self.legends[legendType][legendIndex];
                      legend.container.empty();
                      legend.container.html(legend.initialHTMLContent);
                  });
              });
  
              // Remove mapael class
              self.$container.removeClass(pluginName);
  
              // Remove the data
              self.$container.removeData(pluginName);
  
              // Remove all internal reference
              self.container = undefined;
              self.$container = undefined;
              self.options = undefined;
              self.paper = undefined;
              self.$map = undefined;
              self.$tooltip = undefined;
              self.mapConf = undefined;
              self.areas = undefined;
              self.plots = undefined;
              self.links = undefined;
              self.customEventHandlers = undefined;
          }
docs: /*
  Destroy mapael
  This function effectively detach mapael from the container
  - Set the container back to the way it was before mapael instanciation
  - Remove all data associated to it (memory can then be free'ed by browser)
  
  This method can be call directly by user:
  $(".mapcontainer").data("mapael").destroy();
  
  This method is also automatically called if the user try to call mapael
  on a container already containing a mapael instance