code: function downloadImage(map) {
      map.exportAsImage(function (url) {
          let a = document.createElement("a");
          a.download = "example";
          a.href = url;
          a.click();
      }, "jpeg");
  }
docs: Save the image of the map