[Commits] r318 - apps/opengeo/geoexplorer/trunk/lib
commits at geoext.org
commits at geoext.org
Wed Apr 1 21:29:17 CEST 2009
Author: sbenthall
Date: 2009-04-01 21:29:17 +0200 (Wed, 01 Apr 2009)
New Revision: 318
Modified:
apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
Log:
bookmark method and debugged/cleaned up extractConfiguration method
Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js 2009-04-01 19:10:42 UTC (rev 317)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js 2009-04-01 19:29:17 UTC (rev 318)
@@ -302,6 +302,20 @@
},
+ bookmark: function(){
+
+ var config = this.extractConfiguration();
+
+ var query = Ext.urlEncode({q: Ext.util.JSON.encode(config)});
+
+ var url =
+ document.location.protocol + "//" +
+ document.location.hostname +
+ document.location.pathname + "?" + query;
+
+ return url;
+
+ },
/**
* Method: extractConfiguration
@@ -332,16 +346,20 @@
var layerConfig = [];
this.layers.each(function(layerRecord){
- var c = {};
-
//if it's the dummy layer, do nothing.
if(layerRecord.get("layer").isBaseLayer){
return;
}
+
+
+ var c = {
+ title: layerRecord.get("title"),
+ name: (layerRecord.get("layer").params
+ && layerRecord.get("layer").params.LAYERS)
+ || layerRecord.get("name")
+ };
- c.name = layerRecord.get("name") || layerRecord.get("layer").params.LAYERS;
- c.title = layerRecord.get("title");
- if (c.queryable) {
+ if (layerRecord.get("queryable")) {
c.queryable = layerRecord.get("queryable");
}
More information about the Commits
mailing list