Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to change the features of a MapLayer in real-time but I don't know how I can update/refresh/repaint the layer on the map without having to remove it and add it again (which creates flickering).

SimpleFeatureCollection pointsFC = createFeatureCollection(points);
pathML = new MapLayer(pointsFC, pathStyle);

Do you know a better way to update the Layer rendering?

Thanks in advance. André.

share|improve this question
Any GeoTools nerds out there? – jvangeld May 25 '11 at 22:27
most of the GeoTools' nerds already answered this question on the mailing list :-)… – iant May 26 '11 at 11:52
Thread is gone? Where have all the GeoNerds gone? Why isn't Swing supported? How else does one port GIS visuals to an end-user? – cj5 Jun 18 '15 at 23:51

This actually makes the geotools faq page for gt-swing. The real answer is to use JMapPane as an example (because that is what it is) and build your own widget using a number of layers for a fast response.

You may also find the spatial indexed back feature collections useful in providing a fast experience if you don't mind holding your data in memory.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.