Hey,

Thanks for the patch. I implemented it this morning.  I've had one problem that I wanted to make you aware of. Perhaps it is only on my system, as I am working from a checked out SVN from 2 weeks ago. It works great when panning, but the image doesn't shift properly when zooming in or out. It waits until the new requested image is returned before it updates its position. Thus, if you have multiple layers on from different servers and some respond quicker than others they don't overlay properly until the new image is returned.

Could you please let me know if I am the only one that is experiencing this?

Thanks,
Dejung

XinGang Li wrote:
This is a simple patch to avoid the flash problem when using singleTile layer.

--- E:/OpenLayers-svn/lib/OpenLayers/Tile/Image.js    Wed Nov 28 14:13:24 2007
+++ E:/OpenLayers-2.5/lib/OpenLayers/Tile/Image.js    Thu Dec 06 09:52:54 2007
@@ -120,8 +120,13 @@
        
         this.url = "">          // position the frame
-        OpenLayers.Util.modifyDOMElement(this.frame,
+        if (this.layer.singleTile ) {
+            OpenLayers.Util.modifyDOMElement(this.frame,
+                                         null, null, this.size);
+        } else {
+            OpenLayers.Util.modifyDOMElement(this.frame,
                                          null, this.position, this.size);  
+        }
 
         var imageSize = this.layer.getImageSize();
         if (this.layerAlphaHack) {
@@ -141,7 +146,7 @@
      *   be reused in a new location.
      */
     clear: function() {
-        if(this.imgDiv) {
+        if(this.imgDiv && !this.layer.singleTile) {
             this.imgDiv.style.display = "none";
         }
     },
@@ -203,6 +208,9 @@
         // can register when a tile has finished loading.
         var {
            
+            if (this.layer.singleTile) {
+                OpenLayers.Util.modifyDOMElement (this.frame, null, this.position);
+            }
             //normally isLoading should always be true here but there are some
             // right funky conditions where loading and then reloading a tile
             // with the same url *really*fast*. this check prevents sending

BTW: The edit toolbar also have the flash problem when zoom and pan the map. I found if we add the controls into the div [not viewPortDiv]  of the map, we can avoid this problem.

--
Li XinGang
EMail: [EMAIL PROTECTED]
Blog:   avlee.cnblogs.com

_______________________________________________ Dev mailing list [email protected] http://openlayers.org/mailman/listinfo/dev

--
Dejung Gewissler
New Jersey Office of Information Technology
Office of Geographic Information Systems
200 Riverview Plaza
PO Box 212, Trenton, NJ 08625-0212

609.777.3754


_______________________________________________
Dev mailing list
[email protected]
http://openlayers.org/mailman/listinfo/dev

Reply via email to