Hi,

Currently, MapView is a collection of global flags, variables and lots
of stuff that has nothing to do with simply viewing the map. Some fields
are not even accessed by MapView itself and only used as global flag.

I want to improve this, mostly to make the OpenGL plugin more reliable
and fix some issues I encountered there the right way (and not just work
around them).

This includes
- Moving the layer code to a new class. There is one global instance of
it holding the JOSM layers. Even if there are no layers (and there is no
MapView), this instance stays there and thus we do not need any public
static addListener() methods. This also makes plugin registration easier.
- The new classes have around 300 lines each, including documentation.
This imprives readability.
- Change event listeners to only get an event object. This allows us to
extend the events in the future without breaking everything.
- Get rid of all if(... instanceof ...) code.

Changing this requires changing a lot of things and rewriting some
management code from scratch. I added a compatibility layer for all
methods, so old code should work as it did before.

Current status:
#11637 Moves navigation code - I'll clean up this one.
#11838 Moves the layer management (new and ready to be discussed).

My Roadmap:
After #11838 is merged, I would like do the minor but unrelated
improvements:
* Move the refreshTitle()-Code out of MapView
* remove the AudioPlayer.reset()-calls
* Clean getLayerInformationForSourceTags()

For the navigation component code, I would like to modify #11637 to get
all coordinate conversion code to the ZoomData class. This would allow
us to change the map rendering code to work on a ZoomData instance
instead on the NavigationComponent and thus allow background rendering
(again, OpenGL-Plugin related).

Feel free to post any thoughts you have on this and any problems you see
;-).

Michael Zangl

_______________________________________________
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to