Changing the display scale automatically per second

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing the display scale automatically per second

Kanupriya Chadha
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.net
http://lists.refractions.net/mailman/listinfo/udig-devel
Reply | Threaded
Open this post in threaded view
|

Re: Changing the display scale automatically per second

Jody Garnett-2
<base href="x-msg://6/">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.net
http://lists.refractions.net/mailman/listinfo/udig-devel


_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
Reply | Threaded
Open this post in threaded view
|

Re: Changing the display scale automatically per second

Kanupriya Chadha
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: [hidden email]
Date: Mon, 19 Apr 2010 21:54:40 +1000
To: [hidden email]
Subject: 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.net
http://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.net
http://lists.refractions.net/mailman/listinfo/udig-devel
Reply | Threaded
Open this post in threaded view
|

Re: Changing the display scale automatically per second

Jody Garnett-2
<base href="x-msg://155/">That is why the MapViewer was implemented :-) It has been used in the pass to produce "Overview" style views that show the same Map but zoomed out a bit. If you are wanting to do more of a control room style with two maps that pan and zoom together you will need to make a bridge of some sort that listens to one viewport model and applys any changes to the other.

The data model could also be modified so two maps can share the same viewport model; but it is a bit tricky in that the viewport model is I think also recording the width and height in visible pixels.

This topic has be discussed a couple of times; I believe Emily is the most recent person to implement.

Jody

On 27/04/2010, at 4:55 PM, Kanupriya Chadha wrote:

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: [hidden email]
Date: Mon, 19 Apr 2010 21:54:40 +1000
To: [hidden email]
Subject: 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.net
http://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.net
http://lists.refractions.net/mailman/listinfo/udig-devel


_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
Reply | Threaded
Open this post in threaded view
|

Re: Changing the display scale automatically per second

Kanupriya Chadha
Thank you for such an immediate reply. Will try implementing the same.
 
Kanupriya
 

From: [hidden email]
Date: Tue, 27 Apr 2010 19:04:47 +1000
To: [hidden email]
Subject: Re: [udig-devel] Changing the display scale automatically per second

That is why the MapViewer was implemented :-) It has been used in the pass to produce "Overview" style views that show the same Map but zoomed out a bit. If you are wanting to do more of a control room style with two maps that pan and zoom together you will need to make a bridge of some sort that listens to one viewport model and applys any changes to the other.

The data model could also be modified so two maps can share the same viewport model; but it is a bit tricky in that the viewport model is I think also recording the width and height in visible pixels.

This topic has be discussed a couple of times; I believe Emily is the most recent person to implement.

Jody

On 27/04/2010, at 4:55 PM, Kanupriya Chadha wrote:

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: [hidden email]
Date: Mon, 19 Apr 2010 21:54:40 +1000
To: [hidden email]
Subject: 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.net
http://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.net
http://lists.refractions.net/mailman/listinfo/udig-devel



Catch the changing security environment Get it now.
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel