- .append($('<label>')
- .attr('for', 'mapnik_scale')
- .text(I18n.t('javascripts.share.scale')))
- .append('1 : ')
- .append($('<input>')
- .attr('name', 'mapnik_scale')
- .attr('id', 'mapnik_scale')
- .attr('type', 'text')
- .on('change', update));
-
- ['minlon', 'minlat', 'maxlon', 'maxlat'].forEach(function(name) {
- $('<input>')
- .attr('id', 'mapnik_' + name)
- .attr('name', name)
- .attr('type', 'hidden')
+ .append($("<div>")
+ .attr("class", "col-auto")
+ .append($("<div>")
+ .attr("class", "form-check")
+ .append($("<label>")
+ .attr("for", "image_filter")
+ .attr("class", "form-check-label")
+ .text(I18n.t("javascripts.share.custom_dimensions")))
+ .append($("<input>")
+ .attr("id", "image_filter")
+ .attr("type", "checkbox")
+ .attr("class", "form-check-input")
+ .bind("change", toggleFilter))));
+
+ const mapnikNames = ["minlon", "minlat", "maxlon", "maxlat", "lat", "lon"];
+
+ for (const name of mapnikNames) {
+ $("<input>")
+ .attr("id", "mapnik_" + name)
+ .attr("name", name)
+ .attr("type", "hidden")
+ .appendTo($form);
+ }
+
+ const hiddenExportDefaults = {
+ format: "mapnik",
+ zoom: map.getZoom(),
+ width: 0,
+ height: 0
+ };
+
+ for (const name in hiddenExportDefaults) {
+ $("<input>")
+ .attr("id", "map_" + name)
+ .attr("name", name)
+ .attr("value", hiddenExportDefaults[name])
+ .attr("type", "hidden")