- $("export_maxlat").value = Math.round(tr.lat * decimals) / decimals;
- $("export_minlon").value = Math.round(bl.lon * decimals) / decimals;
- $("export_maxlon").value = Math.round(tr.lon * decimals) / decimals;
- $("export_minlat").value = Math.round(bl.lat * decimals) / decimals;
+ bounds.transform(map.getProjectionObject(), epsg4326);
+
+ $("export_maxlat").value = Math.round(bounds.top * decimals) / decimals;
+ $("export_minlon").value = Math.round(bounds.left * decimals) / decimals;
+ $("export_maxlon").value = Math.round(bounds.right * decimals) / decimals;
+ $("export_minlat").value = Math.round(bounds.bottom * decimals) / decimals;
+
+ if (bounds.getWidth() * bounds.getHeight() > 0.25) {
+ $("export_format_osm").disabled = true;
+ $("export_format_osm").checked = false;
+
+ formatChanged();
+ } else {
+ $("export_format_osm").disabled = false;
+ }