fix issue with ways in relations not displaying if you panned about; make the stylesh...
authorRichard Fairhurst <richard@systemed.net>
Fri, 4 Sep 2009 17:26:36 +0000 (17:26 +0000)
committerRichard Fairhurst <richard@systemed.net>
Fri, 4 Sep 2009 17:26:36 +0000 (17:26 +0000)
net/systemeD/halcyon/Map.as
net/systemeD/halcyon/connection/AMFConnection.as
net/systemeD/halcyon/connection/Connection.as
resources/halcyon.html

index 3cb31aa..09b0bc5 100755 (executable)
@@ -136,7 +136,7 @@ package net.systemeD.halcyon {
 
                        } else {
                                // somewhere innocuous
-                               init(53.09465,-2.56495,17,"test.yaml?d="+Math.random());
+                               init(53.09465,-2.56495,17,"test.css?d="+Math.random());
                        }
                }
 
@@ -145,7 +145,7 @@ package net.systemeD.halcyon {
 
         public function init(startlat:Number,startlon:Number,startscale:uint,style:String):void {
                        ruleset=new RuleSet(this,redrawPOIs);
-                       ruleset.loadFromCSS("test.css?"+Math.random());         // ** test for MapCSS
+                       ruleset.loadFromCSS(style);
                        //updateSize();
 
                        scale=startscale;
index da4c4e8..99d8525 100755 (executable)
@@ -145,19 +145,19 @@ package net.systemeD.halcyon.connection {
                     var lat:Number = Number(p[1]);
                     var nodeTags:Object = p[3];
                     node = new Node(nodeID, nodeVersion, nodeTags, true, lat, lon);
-                    setNode(node);
                 } else if (!node.loaded) {
                                        node.update(nodeVersion, nodeTags, true, lat, lon);
                                }
+                setNode(node);
                 nodes.push(node);
                        }
 
                        if (way==null) {
                way = new Way(id, version, tags, true, nodes);
-               setWay(way);
                        } else {
                                way.update(version, tags, true, nodes);
                        }
+               setWay(way);
                        gotRequest(id+"way");
                }
 
@@ -206,10 +206,10 @@ package net.systemeD.halcyon.connection {
                        }
                        if (relation==null) {
                    relation = new Relation(id, version, tags, true, members);
-                   setRelation(relation);
                        } else {
                                relation.update(version,tags,true,members);
                        }
+            setRelation(relation);
                        gotRequest(id+"rel");
                }
                
index 34c6943..965d12f 100755 (executable)
@@ -76,17 +76,17 @@ package net.systemeD.halcyon.connection {
 
         protected function setNode(node:Node):void {
             nodes[node.id] = node;
-            sendEvent(new EntityEvent(NEW_NODE, node));
+            if (node.loaded) { sendEvent(new EntityEvent(NEW_NODE, node)); }
         }
 
         protected function setWay(way:Way):void {
             ways[way.id] = way;
-            sendEvent(new EntityEvent(NEW_WAY, way));
+            if (way.loaded) { sendEvent(new EntityEvent(NEW_WAY, way)); }
         }
 
         protected function setRelation(relation:Relation):void {
             relations[relation.id] = relation;
-            sendEvent(new EntityEvent(NEW_RELATION, relation));
+            if (relation.loaded) { sendEvent(new EntityEvent(NEW_RELATION, relation)); }
         }
 
                public function sendEvent(e:*):void {
index 5f16650..b7cff97 100644 (file)
@@ -26,7 +26,8 @@
        fo.addVariable("policy","http://www.openstreetmap.org/api/crossdomain.xml");
        fo.addVariable("connection","AMF");
        fo.addVariable("responder","respond");
-       fo.addVariable("style","test.yaml");
+       fo.addVariable("style","test.css");
+       fo.addVariable("show_debug","false");
        fo.write("map");
 
 </script>