Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] notify if layer was added/removed

Not sure; try going further down that page where the EMF notification event system allows you access to everything.

If you can step through the code where the IMapCompositionListener is called; perhaps you can tell us where it is being missed?

Jody

On 14/12/2010, at 2:39 AM, konfri@xxxxxx wrote:

> Hey,
> 
> I need to perform some task if a layer was added/removed. For that, I found this code snipped on http://www.refractions.net:8080/confluence/display/DEV/How+to+tell+when+something+changes:
> 
> ApplicationGIS.getActiveMap().addMapCompositionListener(new IMapCompositionListener(){
>    public void changed( MapCompositionEvent event ) {
>        System.out.println("changed");
> 
>        if (event.getType() == EventType.ADDED) {
>            System.out.println("Layer added");
>        } else if (event.getType() == EventType.REMOVED) {
>            System.out.println("Layer removed");
>        }
>        //..
>    }
> });
> 
> Unfortunately, it is never trigged. Is there something wrong or outdated? Thank you!
> 
> Kon
> -- 
> Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
> Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel



Back to the top