Mmm... while it's ok to call the layerChanged method manually, it
should not be unnecessary. That method gets called behind the scenes
as part of the event chain when the layer is removed from the
MapContent.

In your gist, you should really put the code that sets up and displays
the JMapFrame inside a SwingUtilities.invokeLayer( ... ) block. This
is done for you when you use the static JMapFrame.showMap as you can
see in the sources...

https://github.com/geotools/geotools/blob/master/modules/unsupported/swing/src/main/java/org/geotools/swing/JMapFrame.java#L140

Swing apps typically misbehave if any widget operations (creation,
display, changing properties) are done off the EDT. I don't know if
that is causing the repaint problems in Sunish's case, but it's
possible.

Michael


On 17 July 2013 04:40, Oleksandr Huziy <[email protected]> wrote:
> Sunish:
>
> If you want to repaint the whole layer you can use
> mapFrame.getMapPane().layerChanged(mplle);
> see the example here:
> https://github.com/guziy/GeotoolsDemo/blob/master/src/RoughCreatingPoint.java
> method createFeatures.
>
> Cheers
>
>
>
> 2013/7/16 sunish <[email protected]>
>>
>> Hello,
>>
>> Some times after removing some layers and adding other set of layers
>> JMapPane is not repainting properly.
>> Some times it paints properly, some times partially and some times there
>> is  no repainting.
>> Is there any way to force repaint of layers?
>>
>> I tried
>>
>> mapPane.setIgnoreRepaint(true);
>> ...............................
>>  Remove & Add Layers
>> ............................
>> mapPane.setIgnoreRepaint(false);
>> mapPane.repaint();
>>
>> But the repaint was not happening.
>>
>>
>> Can the paintDelay help in this?
>>
>> Thanks for support,
>>
>> Sunish.
>>
>>
>> ------------------------------------------------------------------------------
>> See everything from the browser to the database with AppDynamics
>> Get end-to-end visibility with application monitoring from AppDynamics
>> Isolate bottlenecks and diagnose root cause in seconds.
>> Start your free trial of AppDynamics Pro today!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
>> _______________________________________________
>> GeoTools-GT2-Users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> GeoTools-GT2-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to