<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
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:<br>
<br>
<tt> getMousePosition: function (evt) {<br>
if (!this.element.offsets) {<br>
this.element.offsets =
OpenLayers.Util.pagePosition(this.element);<br>
this.element.offsets[0] +=
(document.documentElement.scrollLeft<br>
|| document.body.scrollLeft);<br>
this.element.offsets[1] +=
(document.documentElement.scrollTop<br>
|| document.body.scrollTop);<br>
}<br>
return new OpenLayers.Pixel(<br>
(evt.clientX + (document.documentElement.scrollLeft<br>
|| document.body.scrollLeft)) -
this.element.offsets[0]<br>
- (document.documentElement.clientLeft || 0), <br>
(evt.clientY + (document.documentElement.scrollTop<br>
|| document.body.scrollTop)) -
this.element.offsets[1]<br>
- (document.documentElement.clientTop || 0)<br>
); <br>
},<br>
</tt><br>
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<br>
<br>
<br>
Eric Lemoine wrote:
<blockquote
cite="mid:5ec103de0806052329y132922b6hbe904455a6316fdd@mail.gmail.com"
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>
<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>