[udig-devel] checking crs when dragging service into map

Jesse Eichar jeichar at refractions.net
Fri Nov 30 08:40:00 PST 2007


Ok, so there are a few things you can try:

1.  Add a listener to the viewport model and when the CRS of the map  
changes warn the user and undo the last command (you'll have to hack a  
bit to undo the command it goes something like:
Map map = (Map)event.getViewportModel().getMap();
map.backwardHistory(); (for RC13)
map.undo(); (for RC12 and earlier)

2.  Create a MapCompositionListener that checks each layer added and  
removes it (and warns the user) if the layer added is not legal.  This  
listener can be added automatically by creating a MapInterceptor that  
activates when a map is opened.

Some ideas.

Jesse


On 30-Nov-07, at 7:35 AM, Andrea Antonello wrote:

> Hi, since JGrass layers are not reprojectable on the fly, I need to
> check the crs when they are dragged or imported to a map and in case
> warn the user and discard the action. Where should I do that best?
>
>
> Andrea
>
>
> PS: btw Jesse, the advice on putting the same check for the case of  
> the
> catalog into the ServiceExtention works perfect, thanks.
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel



More information about the udig-devel mailing list