From 9f560df39d21a82b7c34e203c555da7fab01a3ae Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 16 Oct 2012 13:09:52 +0100 Subject: [PATCH] Recover properly from a failed notes load Patch OpenLayers so that it doesn't consider an area as loaded if the HTTP request fails, so that it will try and load the area when you zoom back in again. --- vendor/assets/openlayers/OpenLayers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/assets/openlayers/OpenLayers.js b/vendor/assets/openlayers/OpenLayers.js index ebd372e38..ad5df5a32 100644 --- a/vendor/assets/openlayers/OpenLayers.js +++ b/vendor/assets/openlayers/OpenLayers.js @@ -944,8 +944,8 @@ var invalid=!this.bounds||!this.bounds.containsBounds(mapBounds);if(!invalid&&th return invalid;},calculateBounds:function(mapBounds){if(!mapBounds){mapBounds=this.getMapBounds();} var center=mapBounds.getCenterLonLat();var dataWidth=mapBounds.getWidth()*this.ratio;var dataHeight=mapBounds.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(center.lon-(dataWidth/2),center.lat-(dataHeight/2),center.lon+(dataWidth/2),center.lat+(dataHeight/2));},triggerRead:function(options){if(this.response&&!(options&&options.noAbort===true)){this.layer.protocol.abort(this.response);this.layer.events.triggerEvent("loadend");} this.layer.events.triggerEvent("loadstart");this.response=this.layer.protocol.read(OpenLayers.Util.applyDefaults({filter:this.createFilter(),callback:this.merge,scope:this},options));},createFilter:function(){var filter=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});if(this.layer.filter){filter=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,filter]});} -return filter;},merge:function(resp){this.layer.destroyFeatures();var features=resp.features;if(features&&features.length>0){var remote=this.layer.projection;var local=this.layer.map.getProjectionObject();if(!local.equals(remote)){var geom;for(var i=0,len=features.length;i0){var remote=this.layer.projection;var local=this.layer.map.getProjectionObject();if(!local.equals(remote)){var geom;for(var i=0,len=features.length;i