code: function (options) {
  
              // Extend default options with user options
              options = $.extend(true, {}, Mapael.prototype.defaultOptions, options);
  
              // Extend legend default options
              $.each(['area', 'plot'], function (key, type) {
                  if ($.isArray(options.legend[type])) {
                      for (var i = 0; i < options.legend[type].length; ++i)
                          options.legend[type][i] = $.extend(true, {}, Mapael.prototype.legendDefaultOptions[type], options.legend[type][i]);
                  } else {
                      options.legend[type] = $.extend(true, {}, Mapael.prototype.legendDefaultOptions[type], options.legend[type]);
                  }
              });
  
              return options;
          }
docs: /*
  Extend the user option with the default one
  @param options the user options
  @return new options object