<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks Chris. I am on openlayers trunk with revision 3087. <br>
(It may take a while for me to check out the latest 3113 but I don't
see any changes in moveTo function since 3087).<br>
<br>
I have a base google layer set to zoom level 15 and then a WMS layer
from my geoserver. Here is my hypothesis: when we are at such high zoom
level, if we do setCenter() to a far away location, it seems that it is
walking each grid one at a time. <br>
<br>
Here is the code I found under firebug looping for too many times. It
keeps doing shiftRow() or shiftColumn():<br>
<br>
moveTo:function(bounds, zoomChanged, dragging) {<br>
OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,
arguments);<br>
.......<br>
if (bounds != null) {<br>
if (!this.grid.length || zoomChanged <br>
............<br>
} else {<br>
............<br>
while (true) {<br>
var tlLayer = this.grid[0][0].position;<br>
var tlViewPort = <br>
this.map.getViewPortPxFromLayerPx(tlLayer);<br>
if (tlViewPort.x > -this.tileSize.w * (buffer -
1)) {<br>
this.shiftColumn(true);<br>
} else if (tlViewPort.x < -this.tileSize.w *
buffer) {<br>
this.shiftColumn(false);<br>
} else if (tlViewPort.y > -this.tileSize.h *
(buffer - 1)) {<br>
this.shiftRow(true);<br>
} else if (tlViewPort.y < -this.tileSize.h *
buffer) {<br>
this.shiftRow(false);<br>
} else {<br>
break;<br>
}<br>
};<br>
.................<br>
}<br>
}<br>
},<br>
<br>
<br>
Thanks<br>
Louvy<br>
<br>
Christopher Schmidt wrote:
<blockquote cite="mid20070502113848.GB12653@metacarta.com" type="cite">
<pre wrap="">On Wed, May 02, 2007 at 01:20:54AM -0700, Louvy Joseph wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I do not fully understand this function but Grid.js:moveTo() takes long
time in the while loop if we move from one location on the WMS map to a
very far away location.
For example, say my current center is new york city and I move to
california by doing a map.setCenter() call. [I am not dragging the map
but directly making a setCenter() call]. Then the moveTo() function in
Grid.js seems to loop forever while shifting one column or row at a time
moving from new york to california. That takes too long time. Most of
the time firefox thinks that the script is looping and asks whether I
can stop it.
Does anybody know what could be happening here?
</pre>
</blockquote>
<pre wrap=""><!---->
What version of OpenLayers are you using? I know this existed in 1.0,
and may have existed in 2.0, but should have almost definitely been
fixed in 2.2.
Regards,
</pre>
</blockquote>
<br>
</body>
</html>