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.
This commit is contained in:
Tom Hughes 2011-05-13 17:27:12 +01:00
parent db9420ba57
commit e120e59fc0

View file

@ -14,7 +14,11 @@
var feature = vectors.getFeatureByFid(id); var feature = vectors.getFeatureByFid(id);
var bounds = feature.geometry.getBounds(); 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(), {}, { highlight = new OpenLayers.Feature.Vector(bounds.toGeometry(), {}, {
strokeWidth: 2, strokeWidth: 2,