<!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">
For now, I have just removed the "if" condition and calculate the
offset every time. I'll look to see if performance suffers. David<br>
<br>
Christopher Schmidt wrote:
<blockquote cite="mid:20080610143659.GA19762@metacarta.com" type="cite">
<pre wrap="">On Tue, Jun 10, 2008 at 10:31:49AM -0400, David R Robison wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I found the problem... On my page I have a fixed header and footer and a
client region with the style "overflow: scroll". The problem is in
getMousePosition:
getMousePosition: function (evt) {
if (!this.element.offsets) {
this.element.offsets =
OpenLayers.Util.pagePosition(this.element);
this.element.offsets[0] += (document.documentElement.scrollLeft
|| document.body.scrollLeft);
this.element.offsets[1] += (document.documentElement.scrollTop
|| document.body.scrollTop);
}
return new OpenLayers.Pixel(
(evt.clientX + (document.documentElement.scrollLeft
|| document.body.scrollLeft)) -
this.element.offsets[0]
- (document.documentElement.clientLeft || 0),
(evt.clientY + (document.documentElement.scrollTop
|| document.body.scrollTop)) -
this.element.offsets[1]
- (document.documentElement.clientTop || 0)
);
},
The first conditional "caches" the offsets. However, if the client area
is scrolled, the new positions are not recalculated. If I comment out
the conditional, then everything works great. I'm not sure this is
clear... Any thoughts? David
</pre>
</blockquote>
<pre wrap=""><!---->
If the position of the map within the page changes, call
'map.updateSize()' (which clears out the offsets).
The offsets are cached for performance reasons -- though I'll admit that
that was originally done in the FF 1.0 series, and may no longer be
particularly important. If you could figure out a way to have the map
figure out when it has changed positions, and update the cache
accordingly, a patch would be great.
</pre>
<blockquote type="cite">
<pre wrap="">Eric Lemoine wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Thu, Jun 5, 2008 at 6:18 PM, David R Robison
<a class="moz-txt-link-rfc2396E" href="mailto:drrobison@openroadsconsulting.com"><drrobison@openroadsconsulting.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">We are having a pecular problem when clicking on a map. The map is on a
large web page. If the page is scrolled partway down (not positioned at
the top of the map), clicking on the map will return an XY position that
is above the actual click. If we scroll the page back to the top, then
the clicking works. We are using OL-2.5. Has anyone else experienced
this?
</pre>
</blockquote>
<pre wrap="">No. Do you a public page where we can see that, or some code for
someone to reproduce?
</pre>
<blockquote type="cite">
<pre wrap="">Was it fixed in 2.6?
</pre>
</blockquote>
<pre wrap="">Dunno.
</pre>
<blockquote type="cite">
<pre wrap="">Thanks, David Robison
</pre>
</blockquote>
<pre wrap="">--
Eric
</pre>
</blockquote>
<pre wrap="">--
David R Robison
Open Roads Consulting, Inc.
708 S. Battlefield Blvd., Chesapeake, VA 23322
phone: (757) 546-3401
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:drrobison@openroadsconsulting.com">drrobison@openroadsconsulting.com</a>
web: <a class="moz-txt-link-freetext" href="http://openroadsconsulting.com">http://openroadsconsulting.com</a>
blog: <a class="moz-txt-link-freetext" href="http://therobe.blogspot.com">http://therobe.blogspot.com</a>
book: <a class="moz-txt-link-freetext" href="http://www.xulonpress.com/book_detail.php?id=2579">http://www.xulonpress.com/book_detail.php?id=2579</a>
This e-mail communication (including any attachments) may contain
confidential and/or privileged material intended solely for the individual
or entity to which it is addressed. If you are not the intended recipient,
you should immediately stop reading this message and delete it from all
computers that it resides on. Any unauthorized reading, distribution,
copying or other use of this communication (or its attachments) is strictly
prohibited. If you have received this communication in error, please
notify us immediately.
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@openlayers.org">Users@openlayers.org</a>
<a class="moz-txt-link-freetext" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
David R Robison
Open Roads Consulting, Inc.
708 S. Battlefield Blvd., Chesapeake, VA 23322
phone: (757) 546-3401
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:drrobison@openroadsconsulting.com">drrobison@openroadsconsulting.com</a>
web: <a class="moz-txt-link-freetext" href="http://openroadsconsulting.com">http://openroadsconsulting.com</a>
blog: <a class="moz-txt-link-freetext" href="http://therobe.blogspot.com">http://therobe.blogspot.com</a>
book: <a class="moz-txt-link-freetext" href="http://www.xulonpress.com/book_detail.php?id=2579">http://www.xulonpress.com/book_detail.php?id=2579</a>
This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited. If you have received this communication in error, please notify us immediately.
</pre>
</body>
</html>