OpenLayers OpenLayers

Ticket #480: Tic480_and_grid_initTile

File Tic480_and_grid_initTile, 3.1 kB (added by bwoodall, 2 years ago)
Line 
1 Index: lib/OpenLayers/Layer.js
2 ===================================================================
3 --- lib/OpenLayers/Layer.js (.../trunk/openlayers)  (revision 2222)
4 +++ lib/OpenLayers/Layer.js (.../sandbox/bwoodall/openlayers)   (revision 2222)
5 @@ -263,7 +251,7 @@
6              this.display(visibility);
7              if (this.map != null) {
8                  var extent = this.map.getExtent();
9 -                if (extent != null) {
10 +                if ((extent != null) && visibility) {
11                      this.moveTo(extent, true);
12                  }
13              }
14 Index: lib/OpenLayers/Map.js
15 ===================================================================
16 --- lib/OpenLayers/Map.js   (.../trunk/openlayers)  (revision 2222)
17 +++ lib/OpenLayers/Map.js   (.../sandbox/bwoodall/openlayers)   (revision 2222)
18 @@ -448,6 +448,8 @@
19  
20                  // set new baselayer and make it visible
21                  this.baseLayer = newBaseLayer;
22 +                this.baseLayer.state =
23 +                        OpenLayers.Util.createUniqueID("OUcreateImage_");
24                  this.baseLayer.setVisibility(true, noEvent);
25  
26                  //redraw all layers
27 @@ -736,6 +738,11 @@
28                  this.layerContainerDiv.style.top  = "0px";
29              }
30  
31 +            if (zoomChanged || !this.baseLayer.state) {
32 +                this.baseLayer.state =
33 +                    OpenLayers.Util.createUniqueID("OUcreateImage_");
34 +            }
35 +
36              if (zoomChanged) {
37                  this.zoom = zoom;
38                      
39 Index: lib/OpenLayers/Util.js
40 ===================================================================
41 --- lib/OpenLayers/Util.js  (.../trunk/openlayers)  (revision 2222)
42 +++ lib/OpenLayers/Util.js  (.../sandbox/bwoodall/openlayers)   (revision 2222)
43 @@ -216,9 +216,16 @@
44                                       null, null, null, opacity);
45  }
46  
47 +/**
48 + *
49 + *
50 + */
51  OpenLayers.Util.onImageLoad = function() {
52 -    this.style.backgroundColor = null;
53 -    this.style.display = ""; 
54 +    if (this.state && this.state == this.layer.map.baseLayer.state) {
55 +        this.style.backgroundColor = null;
56 +        this.style.display = ""; 
57 +    }
58 +
59  };
60  
61  OpenLayers.Util.onImageLoadErrorColor = "pink";
62 @@ -321,7 +328,7 @@
63      
64      var div = OpenLayers.Util.createDiv();
65      var img = OpenLayers.Util.createImage(null, null, null, null, null, null,
66 -                                          false);
67 +                                          null, false);
68      div.appendChild(img);
69  
70      if (delayDisplay) {
71 @@ -922,4 +929,4 @@
72                                    : url.substr(0, qMark);
73      }
74      return head;
75 -};
76 \ No newline at end of file
77 +};
78 Index: lib/OpenLayers/Tile/Image.js
79 ===================================================================
80 --- lib/OpenLayers/Tile/Image.js    (.../trunk/openlayers)  (revision 2222)
81 +++ lib/OpenLayers/Tile/Image.js    (.../sandbox/bwoodall/openlayers)   (revision 2222)
82 @@ -52,6 +52,9 @@
83          if (this.imgDiv == null) {
84              this.initImgDiv();
85          }
86 +
87 +        this.imgDiv.state = this.layer.map.baseLayer.state;
88 +        this.imgDiv.layer = this.layer;
89          
90          this.url = this.layer.getURL(this.bounds);
91