Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Rendering problem when opening a map

Hi Mark,

At a glance it appears that 2 renders are somehow taking place at the same time and writing to the same image.  I have got Richard working on some code so this should not happen anymore so if you can hang on hopefully the issue will be fixed.  

If you want a solution now.  Then try:

ApplicationGIS.getActiveProject().sendSync( new OpenProjectElementCommand(map) );
map.getRenderManager().refresh();


The difference is that this command is send synchronously and so shouldn't return until the map is open and there is a RenderManager set for the map.

I made a minor change to make this work (or I hope it will work) so you will have to try out one of the recent Nightly builds.

Cheers,

Jesse
On 25-Jul-06, at 11:11 PM, Mark Presling wrote:

Hi All.

I'll start with a graphic example. What it should look like:
<snapshot33.png>


What it does look like:
<snapshot34.png>


When I start my RCP application up the map always loads correctly. I have the following code that runs as an IStartup:

            String mapUrl = ConfigurationOptions.getConfigOptionValue(ConfigurationOptions.OPTION_MAPURL);
            URL url = "" URL(mapUrl);
            URI uri = URI.createURI(url.toExternalForm());
            Resource mapResource = ProjectRegistryImpl.getProjectRegistry().eResource()
                    .getResourceSet().getResource(uri, true);

            // hopefully this is a map.
            Map map = (Map) mapResource.getContents().get(0);

            ApplicationGIS.openMap(map);

The mapUrl is a http url pointing to a map file on a webserver. This all works really well until I close the Map Editor and reopen it again with the same code (I have a menu item I have added to the Window menu to do so - the users don't have access to the Project view, etc).

The problem appears to be related to projections on map initialisation or something like that. Does anyone have any idea why this would happen, or if there is a way that I can force a repaint after the map has opened (can't do it after the call to ApplicationGIS.openMap() because the RenderManager is not set yet)? The map CRS is EPSG:27200 (New Zealand Map Grid).

The map is a WMS backdrop with a WFS layer on top. The WMS always renders correctly, it's just the duplication of the WFS layer that is the problem. A refresh/pan/zoom fixes it every time.


Thanks,
Mark

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
<snapshot33.png>
<snapshot34.png>
<mark.vcf>
_______________________________________________
User-friendly Desktop Internet GIS (uDig)


Back to the top