From 3b9257e41bc97fd54d6c7667461b53187b9885e6 Mon Sep 17 00:00:00 2001 From: Dave Stubbs Date: Thu, 24 Dec 2009 12:29:32 +0000 Subject: [PATCH] move bg and style selection to top bar, and give a choice of styles --- net/systemeD/halcyon/Map.as | 7 +++ net/systemeD/halcyon/styleparser/RuleSet.as | 7 ++- .../potlatch2/BackgroundSelector.mxml | 44 +++++++++++++ net/systemeD/potlatch2/CategorySelector.mxml | 2 +- net/systemeD/potlatch2/StyleSelector.mxml | 28 +++++++++ potlatch2.mxml | 61 +++---------------- resources/wireframe.css | 15 +++++ 7 files changed, 109 insertions(+), 55 deletions(-) create mode 100644 net/systemeD/potlatch2/BackgroundSelector.mxml create mode 100644 net/systemeD/potlatch2/StyleSelector.mxml create mode 100644 resources/wireframe.css diff --git a/net/systemeD/halcyon/Map.as b/net/systemeD/halcyon/Map.as index d8267825..58e93bef 100755 --- a/net/systemeD/halcyon/Map.as +++ b/net/systemeD/halcyon/Map.as @@ -344,6 +344,13 @@ package net.systemeD.halcyon { private function reportPosition():void { addDebug("lon "+coord2lon(mouseX)+", lat "+coord2lat(mouseY)); } + + public function setStyle(style:String):void { + if (style) { + ruleset=new RuleSet(this,redrawPOIs); + ruleset.loadFromCSS(style); + } + } // ------------------------------------------------------------------------------------------ // Export (experimental) diff --git a/net/systemeD/halcyon/styleparser/RuleSet.as b/net/systemeD/halcyon/styleparser/RuleSet.as index d21706db..68fbc004 100644 --- a/net/systemeD/halcyon/styleparser/RuleSet.as +++ b/net/systemeD/halcyon/styleparser/RuleSet.as @@ -20,9 +20,9 @@ package net.systemeD.halcyon.styleparser { // variables for name, author etc. - public function RuleSet(m:Map,f:Function=null):void { - map=m; - iconCallback=f; + public function RuleSet(m:Map,iconLoadedCallback:Function=null):void { + map = m; + iconCallback = iconLoadedCallback; } // Get styles for an object @@ -63,6 +63,7 @@ package net.systemeD.halcyon.styleparser { // Inspector.getInstance().show(); // Inspector.getInstance().shelf('Choosers', choosers); loadImages(); + map.redraw(); } diff --git a/net/systemeD/potlatch2/BackgroundSelector.mxml b/net/systemeD/potlatch2/BackgroundSelector.mxml new file mode 100644 index 00000000..e85737e4 --- /dev/null +++ b/net/systemeD/potlatch2/BackgroundSelector.mxml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + diff --git a/net/systemeD/potlatch2/CategorySelector.mxml b/net/systemeD/potlatch2/CategorySelector.mxml index 9a334c97..52fa42c7 100644 --- a/net/systemeD/potlatch2/CategorySelector.mxml +++ b/net/systemeD/potlatch2/CategorySelector.mxml @@ -28,7 +28,7 @@ - + + + + + + + + + + + + + + diff --git a/potlatch2.mxml b/potlatch2.mxml index 668388a9..9357df09 100755 --- a/potlatch2.mxml +++ b/potlatch2.mxml @@ -23,6 +23,10 @@ + + @@ -31,40 +35,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/resources/wireframe.css b/resources/wireframe.css new file mode 100644 index 00000000..e2ac8835 --- /dev/null +++ b/resources/wireframe.css @@ -0,0 +1,15 @@ +/* + + Stylesheet that does simple wireframe display + +*/ + +way :hover { z-index: 2; width: 1; color: blue; } +way :selected { z-index: 2; width: 1; color: red; } +way !:drawn { z-index:10; width: 1; color: black; } + +node :selectedway { z-index: 8; icon-image: square; icon-width: 6; color: green; } +node :hoverway { z-index: 9; icon-image: square; icon-width: 6; color: blue; } +node :selected { z-index: 9; icon-image: square; icon-width: 6; color: red; casing-color: black; casing-width: 1; } +node !:drawn :poi { z-index: 2; icon-image: square; icon-width: 4; color: green; casing-color: black; casing-width: 1; } + -- 2.30.0