From: Tom Hughes Date: Fri, 13 May 2011 16:27:12 +0000 (+0100) Subject: Handle large bounding box changesets better X-Git-Tag: live~6948^2~4 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/e120e59fc0dc6c4a2a09ea8a068b901a8c6ac256?ds=sidebyside;hp=-c Handle large bounding box changesets better If the bounding box of a changeset is much larger than the map then there seem to be problems with OL not rendering the feature correctly so reduce the highlight to just be the extent of the map plus a small margin in that case. --- e120e59fc0dc6c4a2a09ea8a068b901a8c6ac256 diff --git a/app/views/changeset/_map.html.erb b/app/views/changeset/_map.html.erb index 6d7aa96c0..5f5f4aa5d 100644 --- a/app/views/changeset/_map.html.erb +++ b/app/views/changeset/_map.html.erb @@ -14,7 +14,11 @@ var feature = vectors.getFeatureByFid(id); var bounds = feature.geometry.getBounds(); - if ( highlight ) vectors.removeFeatures(highlight); + if (bounds.containsBounds(map.getExtent())) { + bounds = map.getExtent().scale(1.1); + } + + if (highlight) vectors.removeFeatures(highlight); highlight = new OpenLayers.Feature.Vector(bounds.toGeometry(), {}, { strokeWidth: 2,