[OSM-dev] Painting areas below other ways with Mappaint plugin

Nick Whitelegg nick at hogweed.org
Sat Oct 21 13:58:26 BST 2006


Hello Imi,

(also posted to dev list: maybe we need a josm-plugin-dev list :-) )

I would like to change the MapPaint plugin so that areas are rendered as 
polygons, and are rendered before other types of way - and plain segments - 
so that they do not obscure them.

However it seems to be quite difficult to do this within the plugin framework. 
The OsmDataLayer controls the order in which OSM primitives are painted, so 
to change it I need to subclass OsmDataLayer. This then has a knock-on effect 
of having to change core JOSM code.

It seems to me that a new class DataVisitor (first name I thought of) is 
needed, which "visits" the OSM data in a particular order, and which is 
independent of OsmDataLayer. That way, anyone who wants to change the order 
in which OSM primitives are drawn just needs to override DataVisitor and 
doesn't need to change OsmDataLayer.

Does this sound sensible or can I do what I want to do with the plugin system?

Thanks,
Nick





More information about the dev mailing list