File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,12 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
138
138
*/
139
139
tileQueue : null ,
140
140
141
+ /**
142
+ * Property: loading
143
+ * {Boolean} Indicates if tiles are being loaded.
144
+ */
145
+ loading : false ,
146
+
141
147
/**
142
148
* Property: backBuffer
143
149
* {DOMElement} The back buffer.
@@ -1050,7 +1056,8 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
1050
1056
1051
1057
tile . onLoadStart = function ( ) {
1052
1058
//if that was first tile then trigger a 'loadstart' on the layer
1053
- if ( this . numLoadingTiles == 0 ) {
1059
+ if ( this . loading === false ) {
1060
+ this . loading = true ;
1054
1061
this . events . triggerEvent ( "loadstart" ) ;
1055
1062
}
1056
1063
this . events . triggerEvent ( "tileloadstart" , { tile : tile } ) ;
@@ -1061,7 +1068,8 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
1061
1068
this . numLoadingTiles -- ;
1062
1069
this . events . triggerEvent ( "tileloaded" , { tile : tile } ) ;
1063
1070
//if that was the last tile, then trigger a 'loadend' on the layer
1064
- if ( this . numLoadingTiles === 0 ) {
1071
+ if ( this . tileQueue . length === 0 && this . numLoadingTiles === 0 ) {
1072
+ this . loading = false ;
1065
1073
this . events . triggerEvent ( "loadend" ) ;
1066
1074
if ( this . backBuffer ) {
1067
1075
// the removal of the back buffer is delayed to prevent flash
You can’t perform that action at this time.
0 commit comments