Thanks for the reply. I wrote a single command which helped me set the temporary point to the center of the viewport and change the display scale simultaneously. All this takes around 1 sec to execute.
I now have another problem. We need to show the zoomed area in another editor i.e. open two map editors one which has the original map and the other(of a smaller dimensions and at the bottom left corner of the screen) which has the area that is being zoomed.
Please help..
Thanks and regards
Kanupriya
From:
jody.garnett@xxxxxxxxxDate: Mon, 19 Apr 2010 21:54:40 +1000
To:
udig-devel@xxxxxxxxxxxxxxxxxxxxxSubject: Re: [udig-devel] Changing the display scale automatically per second
We have had real time tracking before; there is a tutorial which you can follow that uses sea gulls as a standing.
Here is the thing:
- use tiled map renderer (so that rendering into tiles is separate from panning
- use one of the special pan commands that animate to the new location
-- there are three pan tools available; try them out with tiled renderer on
-- one of them is "fixed scale" (so the tiles stay the same); and one is fixed scale and smooth which animates
-- you will need to look into the implementation to see how they do it
Using these techniques we have had "flicker free" pannning in udig; it currently crashes on the mac due to an SWT bug so we have not made it the default.
I also recommend writing your own (single) command that does what you want with a minimum number of redraws.
Jody
On 19/04/2010, at 6:53 PM, Kanupriya Chadha wrote:
Hi,
My application has an option where user can navigate to particular features. For this to work, we are using a thread which gets refreshed every second. While traversing to the feature, we have to change the display scale and shift the current position to the center of the map.
For
zooming we are using the following code:
NavCommand[] commands = new NavCommand[] {
new SetViewportCenterCommand(currentPnt),
new ZoomCommand(1) };
StateVariables.context.sendASyncCommand(
new NavComposite(Arrays.asList(commands)));
and for changing the
display scale : map.executeSyncWithoutUndo(new SetScaleCommand(5));
but these commands take around 5 secs to execute and hence the application fails to run.
Is there any way we can do it faster in about a sec?
Thank You
Kanupriya
Catch the changing security environment
Get it now._______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.nethttp://lists.refractions.net/mailman/listinfo/udig-devel
All the post budget analysis and implications
Sign up now. _______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.nethttp://lists.refractions.net/mailman/listinfo/udig-devel