Fix user-selected imagery
authorRichard Fairhurst <richard@systemeD.net>
Tue, 14 Oct 2014 08:23:13 +0000 (09:23 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Tue, 14 Oct 2014 08:23:13 +0000 (09:23 +0100)
P2 is like crystal, it breaks easy

net/systemeD/potlatch2/collections/Imagery.as
net/systemeD/potlatch2/dialogs/BackgroundDialog.mxml

index 533dd08..ed3709c 100644 (file)
@@ -59,6 +59,7 @@ package net.systemeD.potlatch2.collections {
                        if (SharedObject.getLocal("user_state","/").data['background_url']!=undefined) {
                                saved={ url:  SharedObject.getLocal("user_state","/").data['background_url' ],
                                                name: SharedObject.getLocal("user_state","/").data['background_name'],
+                                               userDefined: true,
                                                type: "tms",
                                                extent: { bbox: { min_lon: -180, max_lon: 180, min_lat: -90, max_lat: 90 } }}
                        }
@@ -267,7 +268,7 @@ package net.systemeD.potlatch2.collections {
                                        }
                                } else if (!bg.type || bg.type!='wms') {
                                        // if there's no bbox (i.e. global set) and default is set, include it
-                                       if (bg.name=='None' || bg.default) { available.push(bg); }
+                                       if (bg.name=='None' || bg.default || bg.userDefined) { available.push(bg); }
                                }
                        }
                        available.sort(function(a:Object,b:Object):int {
index 87522d1..6552b8f 100644 (file)
@@ -68,7 +68,7 @@
     }
 
        private function addNewSource():void {
-               dataCollection.addItemAt( {name:'(new name)',url:'(new URL)'} , dataCollection.length);
+               dataCollection.addItemAt( {name:'(new name)',url:'(new URL)',userDefined:true} , dataCollection.length);
                dataGrid.validateNow();
                dataGrid.verticalScrollPosition=dataGrid.maxVerticalScrollPosition;
                dataGrid.editedItemPosition = {rowIndex: dataCollection.length-1, columnIndex: 0};