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

Jesse Eichar jeichar at refractions.net
Fri Nov 30 09:04:01 PST 2007


The mapInterceptor is an extension point.  If you run at map Open then  
it will be ran everytime the map is opened.  That will provide an easy  
way of adding your listener each time a map is opened.

Jesse
On 30-Nov-07, at 8:57 AM, Andrea Antonello wrote:

> Thanks Jesse,
>
>> 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.
>
> Huh, I guess I would need both :(
> Does 2 do this only on startup or everytime something is added to the
> map?
>
> I will run after them and come back with troubles I could find :)
>
> Thanks,
> Andrea
>
>
>>
>>
>> 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
>>
>> _______________________________________________
>> 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



More information about the udig-devel mailing list