Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] ActiveMapTracker and Visible Maps

So can you provide me with a hint as to where to get started with this idea (or maybe we should have an irc chat?)

I looked at the PerspectiveAdapter adapter class and tried adding one to the open windows just to see what happened. (I added this adapter in the ActiveMapTracker when a new window was opened). However, it only seems to capture events if the window is already loaded. In my sample app the map view is displayed in the initial perspective so it doesn't get around to adding the listener until after the window and perspective have already been loaded.

I'm not sure how I would add a tracker for each perspective. Can you elaborate a bit?

Thanks for you help!

Emily

Jesse Eichar wrote:
A good point emily.

I think we need to add a persective changed listener and reset all the maps on a perspective change. For example. When a perspective changes the list of active maps should be cleared and re-created from all the active parts. Probably with the editor as the highest priority (IE the last one put on the stack).

Another possiblity it to have a separate tracker per perspective... Yeah that is probably best so that the active maps order is better preserved when there are multiple perspective switches taking place, which does happen on a extension that I am currently working on.

Jesse

On 31-Oct-08, at 9:32 PM, Emily Gouge wrote:

I've come across a problem with the ActiveMapTracker that I'm looking for input on how to fix it.

I have an application where the perspective includes a MapPart. As a result when I start the application the map is shown by default. However when I set the viewport bounds on the map, I see nothing. I tracked this down to the render manager only refreshing the map if the map is the current map:

if (ApplicationGIS.getActiveMap() != null && ApplicationGIS.getVisibleMaps().contains(ApplicationGIS.getActiveMap())){
   //refresh map
}

Somehow at this state the visible maps list is empty and the active map is a non-existent map; so the map is not being drawn.

I tracked this down to the ActiveMapTracker (which is tracking the visible maps and active maps). Normally when I create a new view and it becomes visible the partVisible code is run which updates the visible maps list. However it seems because this view is part of a perspective being opened by default this code is not being run. (The view is added to the perspective using a perspectiveExtension extension point)

A little more hacking and I've found that if I change the partOpened function to not only add the currentPart to the openMaps list, but also the activeParts and visibleMaps list then my program draws the map correctly.

I suspect this hack is bad and has other unknown implications; so I'd like to know how I "properly" fix this issue.

Thanks,
Emily


_______________________________________________
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


Back to the top