[Potlatch-dev] Vector background layers - couple of code changes

Richard Fairhurst richard at systemeD.net
Fri Mar 19 17:46:01 GMT 2010


Hi all,

I've committed a big chunk of code to do the vector background layer stuff.

Slight refactoring for those of you who know the internals intimately:

There's a new MapPaint object, which is a Sprite container for WayUIs 
and NodeUIs (i.e. the actual sprites that are drawn on the map, rather 
than the raw geodata). The RuleSet (i.e. stylesheet) is now referenced 
from here, not the Map.

This means that we can have more than one MapPaint object - indeed, one 
for each vector background layer - and assign different stylesheets to them.

The vector background layers themselves are largely simple containers 
for nodes, ways and relations. They don't need all the event handling 
and connection wizardry of the main geodata as there's very limited 
interaction available - after they've been imported, you can pull them 
into the main map and that's about it. I've not yet turned off the event 
listeners for them but that'll be the next thing to do.

One other change is that both NodeUIs and WayUIs (which extend EntityUI) 
have a listenSprite from instantiation, rather than it being created at 
a later date. It is never removed, but rather its hitzone is set to 
null. This avoids a horrid bug whereby objects were being deleted and 
redrawn every single time you moved the mouse on top of them. :)

cheers
Richard




More information about the Potlatch-dev mailing list