$("marker_lon").value = "";
$("marker_lat").value = "";
$("marker_inputs").style.display = "none";
$("marker_lon").value = "";
$("marker_lat").value = "";
$("marker_inputs").style.display = "none";
function validateControls() {
var bounds = new OpenLayers.Bounds($("minlon").value, $("minlat").value, $("maxlon").value, $("maxlat").value);
function validateControls() {
var bounds = new OpenLayers.Bounds($("minlon").value, $("minlat").value, $("maxlon").value, $("maxlat").value);
- if (bounds.getWidth() * bounds.getHeight() > 0.25) {
- $("format_osm").disabled = true;
- $("format_osm").checked = false;
- $("export_osm").style.display = "none";
+ if (bounds.getWidth() * bounds.getHeight() > #{APP_CONFIG['max_request_area']}) {
+ $("export_osm_too_large").style.display = "block";
- if ($("format_mapnik").checked && $("mapnik_scale").value < max_scale) {
+ if ($("format_osm").checked && bounds.getWidth() * bounds.getHeight() > #{APP_CONFIG['max_request_area']}) {
+ $("export_commit").disabled = true;
+ } else if ($("format_mapnik").checked && $("mapnik_scale").value < max_scale) {
var bounds = new OpenLayers.Bounds($("minlon").value, $("minlat").value, $("maxlon").value, $("maxlat").value);
var layerName = map.baseLayer.name.toLowerCase();
var url = "http://#{SERVER_URL}/export/embed.html?bbox=" + bounds.toBBOX() + "&layer=" + layerName;
var bounds = new OpenLayers.Bounds($("minlon").value, $("minlat").value, $("maxlon").value, $("maxlat").value);
var layerName = map.baseLayer.name.toLowerCase();
var url = "http://#{SERVER_URL}/export/embed.html?bbox=" + bounds.toBBOX() + "&layer=" + layerName;
bounds.transform(epsg4326, epsg900913);
var zoom = map.getZoomForExtent(bounds);
bounds.transform(epsg4326, epsg900913);
var zoom = map.getZoomForExtent(bounds);
var ymax = bounds.top * Math.PI / 180;
var yzoom = Math.LOG2E * (Math.log(2000 * 2 * Math.PI) - Math.log(Math.log((Math.tan(ymax) + 1 / Math.cos(ymax)) / (Math.tan(ymin) + 1 / Math.cos(ymin)))))
var ymax = bounds.top * Math.PI / 180;
var yzoom = Math.LOG2E * (Math.log(2000 * 2 * Math.PI) - Math.log(Math.log((Math.tan(ymax) + 1 / Math.cos(ymax)) / (Math.tan(ymin) + 1 / Math.cos(ymin)))))