Jump directly to lat/lon pair
authorRichard Fairhurst <richard@systemeD.net>
Thu, 20 Sep 2012 15:29:58 +0000 (16:29 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Thu, 20 Sep 2012 15:29:58 +0000 (16:29 +0100)
net/systemeD/potlatch2/find/FindDialog.mxml

index f42776c..926fd2c 100644 (file)
 
                private function goFetch(q:String):void {
 
+                       var matches:Array=q.match(/^([\-\.\d]+)[\s,]+([\-\.\d]+)$/i);
+                       if (matches) {
+                               // lat/lon pair
+                               FlexGlobals.topLevelApplication.theMap.moveMapFromLatLon(Number(matches[1]), Number(matches[2]));
+                               PopUpManager.removePopUp(this);
+                               return;
+                       }
+
                        var searchCall:String = nominatimURL;
                        for (var item:String in nomOptions) {
                                searchCall += item + "=";