Skip to main content

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

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




Back to the top