X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e414d10aa10815b07e0ab334db4d96c4b3ac9b6b..670d15e4c9738f4c4844d93bfe45d89a3351d25b:/app/views/browse/_map.rhtml?ds=inline diff --git a/app/views/browse/_map.rhtml b/app/views/browse/_map.rhtml index 466c9b6cc..a0fcc06aa 100644 --- a/app/views/browse/_map.rhtml +++ b/app/views/browse/_map.rhtml @@ -21,8 +21,12 @@ for (var i = 1; i < this.features.length; i++) { extent.extend(this.features[i].geometry.getBounds()); } - this.map.zoomToExtent(extent); - var center = getMapCenter(); + if (extent) { + this.map.zoomToExtent(extent); + } else { + this.map.zoomToMaxExtent(); + } + var center = getMapCenter(); $("larger_map").href = '/?lat='+center.lat+'&lon='+center.lon+'&zoom='+this.map.getZoom(); $("larger_map").innerHTML = "View Larger Map"; } else {