chellymehdi / vopenlayers

Automatically exported from code.google.com/p/vopenlayers
0 stars 0 forks source link

Map Extent Changes not sent to server #77

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've been trying to debug a problem with the map's extent. For some reason the 
extent is only updated once in a while. 

It never gets updated on a zoom-event only. This I think happens because of a 
typo VOpenLayersMap, line 184 (trunk):
getMap().registerEventHandler("zoomed", extentChangeListener);
I think this should read "zoomend", because that seems to be the openlayers 
event that is triggered. (see 
http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html)

Panning the map does not always cause the extent on the server to be updated. 
I've not figured out why that is, but it seems to work better the more I zoom 
in. At zoom levels 1-3 or so it doesn't work very well at all. 

Original issue reported on code.google.com by merke...@gmail.com on 15 Jun 2012 at 11:56

GoogleCodeExporter commented 9 years ago
Trying to work around the issue, it tried not to rely on the extent of the map. 
This doesn't work either and the map resets itself always back to (0,0) on a 
full repaint. 

On a full repaint all fields are marked as dirty and sent back to the client. 
If I've never actually invoked setCenter or zoomToExtent, then the center will 
never have been set anyways and always remains. Note that if I don't set zoom 
to extent, then the clat/clon will be sent to the client, even though they've 
never been set.

Basically, at a minimum the clat/clon must be set in updateExtent() to prevent 
a full repaint from resetting the map. Of course since the client and server 
are not always synchronized this won't really work either.

Original comment by merke...@gmail.com on 15 Jun 2012 at 12:34

GoogleCodeExporter commented 9 years ago
I suggest to not send clat/zoom/zoomToExtent to the client unless they have 
been marked as dirty, iff  dirtyFields.contains(fieldName). Of course you'll 
have to update setDirty as well to mark a field as dirty even if a full repaint 
is already requested.

Original comment by merke...@gmail.com on 15 Jun 2012 at 12:45

GoogleCodeExporter commented 9 years ago
Hi,

I think the issue is a Vaadin trick called "immediate" flag. Using it many 
components control how they transfer their variables to the server side. This 
example (with the brand new extent change listener) calls setImmedate(true) and 
at least for me extent change event is called on all zoom events also.

The typo you mention may be real, but I checked that it appears to work also 
without it. Apparently the moveend event is triggered also on zoom. I removed 
that line altogether in r149

cheers,
matti

Original comment by matti.ta...@gmail.com on 27 Jul 2012 at 7:44

GoogleCodeExporter commented 9 years ago
I'm using immediate mode in the map.

Original comment by merke...@gmail.com on 27 Jul 2012 at 9:14

GoogleCodeExporter commented 9 years ago
Hi,

Then I have no idea why it don't work for you. Can you check out the new 
version and if it still don't work, could you provide me a test case so I can 
check this out:
 - code how you set up the extent change listener
 - on which server and version you are running
 - what is the vaadin version
 - what browser are you using
 - description how to reproduce the issue

Without these details it is not very motivating to hunt this bug.

cheers,
matti

Original comment by matti.ta...@gmail.com on 28 Jul 2012 at 1:13