code: function downloadMap(map) {
      let data = map.exportAsJSON(),
          json = JSON.stringify(data),
          blob = new Blob([json], {type: "application/json"}),
          a = document.createElement("a");
  
      a.download = "example.json";
      a.href = URL.createObjectURL(blob);
      a.click();
  }
docs: Download the json of the map