Note that this patch has been applied to both trunk/openlayers<br>
and branches/openlayers/2.2, so if you are working from trunk<br>
an svn update should do the trick, and it will be part of the next <br>
release candidate as well.<br>
<br>
Ticket #372 closed (<a href="http://trac.openlayers.org/ticket/372#preview">http://trac.openlayers.org/ticket/372#preview</a>)<br>
<br>
Great work everyone!<br>
--Erik<br><br><div><span class="gmail_quote">On 10/24/06, <b class="gmail_sendername">Jeff Dege</b> <<a href="mailto:jdege@korterra.com">jdege@korterra.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Don't kick yourself too hard - the description in the doc file dates<br>from when the granularity setting worked the way you had thought it had<br>worked. I updated the code, and forgot to update the docs.<br><br>I've submitted a patch to the docs so that the description for the
<br>granularity setting matches what the granularity setting does do,<br>instead of what it used to do back when the control wasn't working.<br><br>And I've bumped the default value from 1 to 10 - which should make even<br>
folks with fast mouses update the display.<br><br>You can, if you like, set granularity to > window size, and have it<br>update the display all the time. Personally, I really hate jerky mouse<br>movement, but others might not be as sensitive.
<br><br>> -----Original Message-----<br>> From: <a href="mailto:users-bounces@openlayers.org">users-bounces@openlayers.org</a><br>> [mailto:<a href="mailto:users-bounces@openlayers.org">users-bounces@openlayers.org
</a>] On Behalf Of Alan U<br>> Sent: Tuesday, October 24, 2006 10:22 AM<br>> To: <a href="mailto:users@openlayers.org">users@openlayers.org</a><br>> Subject: Re: [OpenLayers-Users] Mouse position control<br>><br>
><br>> I take it all back (almost!)<br>> There isn't necessarily a problem with the code, but I always<br>> have my mouse<br>> on fast pointer movement. This was never giving me a<br>> mouse-movement < 2
<br>> pixels.<br>><br>> DOH!!<br>><br>> Turning down the sensitivity of my mouse and the code works<br>> (of course). It<br>> only updates the control display if the mouse-movement is<br>> small enough and
<br>> mine wasn't.<br>> Therefore, the default granularity should be raised or anyone<br>> running the<br>> examples/default code will see no feed back from the<br>> mousePosition control!<br>> My final points about not being able to get latlong values
<br>> when moving the<br>> mouse slowly are rubbish too.<br>><br>> Alan (gently kicking myself)<br>><br>><br>><br>><br>> Alan U wrote:<br>> ><br>> > Taking the code from the trunk, the mouse position control
<br>> seems a bit<br>> > wrong. I was getting no feedback in FF and only feedback in<br>> IE when making<br>> > a click on the map.<br>> ><br>> > In the redraw function I changed:<br>> >
<br>> > if (this.lastXy == null ||<br>>
>
Math.abs(evt.xy.x - this.lastXy.x) ><br>> this.granularity ||<br>>
>
Math.abs(evt.xy.y - this.lastXy.y) ><br>> this.granularity)<br>> > { //don't update<br>> ><br>> > to:<br>> > if (this.lastXy == null ||<br>>
>
Math.abs(evt.xy.x - this.lastXy.x) <<br>> this.granularity ||<br>>
>
Math.abs(evt.xy.y - this.lastXy.y) <<br>> this.granularity)<br>> > {//don't update<br>> ><br>> > Note the greater/less than signs.<br>> ><br>> > Also, with the granularity value even set to 1, moving
<br>> slowly across the<br>> > map causes no update of the xy coords in the control. Though this is<br>> > designed for, it is not intuitive imo. If you are trying to get a<br>> > coordinate precisely, then it is highly likely you will be
<br>> moving the<br>> > mouse below the granularity level: thus I think the default<br>> should be 0.<br>> ><br>> > Alan<br>> ><br>><br>> --<br>> View this message in context:<br>>
<a href="http://www.nabble.com/Mouse-position-control-tf2501061.html#a6974998">http://www.nabble.com/Mouse-position-control-tf2501061.html#a6974998</a><br>> Sent from the OpenLayers Users mailing list archive at <a href="http://Nabble.com">
Nabble.com</a>.<br>><br>> _______________________________________________<br>> Users mailing list<br>> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>> <a href="http://openlayers.org/mailman/listinfo/users">
http://openlayers.org/mailman/listinfo/users</a><br>><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users">
http://openlayers.org/mailman/listinfo/users</a><br></blockquote></div><br>