- if (map.getMapBaseLayerId() === "mapnik") {
- $("#export-image").show();
- $("#export-warning").hide();
- } else {
- $("#export-image").hide();
- $("#export-warning").show();
- }
+ const canDownloadImage = Boolean(layer && layer.options.canDownloadImage);
+
+ $("#mapnik_image_layer").text(canDownloadImage ? layer.options.name : "");
+ $("#map_format").val(canDownloadImage ? layer.options.layerId : "");
+
+ $("#map_zoom").val(map.getZoom());
+ $("#mapnik_lon").val(map.getCenter().lng);
+ $("#mapnik_lat").val(map.getCenter().lat);
+ $("#map_width").val(mapWidth);
+ $("#map_height").val(mapHeight);
+
+ $("#export-image").toggle(canDownloadImage);
+ $("#export-warning").toggle(!canDownloadImage);
+ $("#mapnik_scale_row").toggle(canDownloadImage && layer.options.layerId === "mapnik");