[OpenLayers-Users] Mouse coordinates in movable map

Christopher Schmidt crschmidt at metacarta.com
Sun Oct 12 16:44:54 EDT 2008


On Sun, Oct 12, 2008 at 01:26:12PM -0700, Greg Ederer wrote:
> Hi,
> 
> This is an interesting problem (at least, I think so).
> 
> I have placed a map inside a movable element (using dojo.dnd.Moveable) 
> so that users can drag it around the browser window by grabbing a 
> titlebar.  (My goal is to let the user create multiple map panes, and 
> drag them around the window.)
> 
> The trouble is that when the user moves the map, and then clicks on it, 
> the mouse coordinates get processed as though the map were still in its 
> initial location (where it was when the page first loaded.)
> 
> For example, if the user moves the map twenty pixels to the right, and 
> then clicks on it, the click is interpreted as if the the user clicked 
> on whatever is twenty pixels to the right of where she clicked.
> 
> Is there some way to update the offsets of the map mouse origin when the 
> user drags the map?

map.updateSize().

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list