summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranco Nogarin2013-07-09 05:53:18 (GMT)
committer Franco Nogarin2013-07-09 05:53:18 (GMT)
commit291c4b3c31e4423bff23ff670dbfe3a1964da36c (patch)
tree01e1133be534a0a3697a25848d1f7979b260c612
parent25e5ee20074c25058d08edcbe631f673a4f7a3e6 (diff)
hello admin inc
-rw-r--r--sparcsmap/admin/sparcsmap.admin.inc36
-rw-r--r--sparcsmap/js/evolution.js.php14
2 files changed, 44 insertions, 6 deletions
diff --git a/sparcsmap/admin/sparcsmap.admin.inc b/sparcsmap/admin/sparcsmap.admin.inc
new file mode 100644
index 0000000..73c06e2
--- /dev/null
+++ b/sparcsmap/admin/sparcsmap.admin.inc
@@ -0,0 +1,36 @@
+<?php
+/**
+ * @file
+ * Administration page callbacks for the SPARCSMap module.
+ */
+
+/**
+ * Form builder. Configure annotations.
+ *
+ * @ingroup forms
+ * @see system_settings_form()
+ */
+function sparcsmap_admin_settings() {
+ $localdebug = TRUE;
+ ($localdebug) ? dpm("Debugging in sparcsmap_admin_settings is on") : 0 ;
+
+
+ $form['geoserver'] = array(
+ '#type' => 'fieldset',
+ '#title' => "SPARCS Geoservers",
+ '#weight' => 50,
+ '#description' => "Geodata server.",
+ '#collapsible' => TRUE,
+ '#collapsed' => FALSE,
+ );
+
+ $form['geoserver']['sparcsmap_geoserver_url'] = array(
+ '#type' => 'textfield',
+ '#title' => t('URL to Geoserver Get Capabilities'),
+ '#default_value' => variable_get('sparcsmap_geoserver_url', ''),
+ '#description' => "full url eg. http://gs.yourdomain.com/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities",
+ );
+
+
+ return system_settings_form($form);
+}
diff --git a/sparcsmap/js/evolution.js.php b/sparcsmap/js/evolution.js.php
index 2947adc..7e71938 100644
--- a/sparcsmap/js/evolution.js.php
+++ b/sparcsmap/js/evolution.js.php
@@ -1,13 +1,15 @@
<?php
+ $geoserver_url = 'http://gs2.vm.sparcsonline.com/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities';
+
$output = '
var tree, mapPanel;
Ext.onReady(function() {
var root = new Ext.tree.AsyncTreeNode({
- text: 'GeoServer Demo WMS',
+ text: "GeoServer Demo WMS",
loader: new GeoExt.tree.WMSCapabilitiesLoader({
- url: 'data/wmscap.xml',
+ url: "' . $geoserver_url . '",
layerOptions: {buffer: 0, singleTile: true, ratio: 1},
- layerParams: {'TRANSPARENT': 'TRUE'},
+ layerParams: {"TRANSPARENT": "TRUE"},
// customize the createNode method to add a checkbox to nodes
createNode: function(attr) {
attr.checked = attr.leaf ? false : undefined;
@@ -17,13 +19,13 @@
});
tree = new Ext.tree.TreePanel({
root: root,
- region: 'west',
+ region: "west",
width: 250,
listeners: {
// Add layers to the map when ckecked, remove when unchecked.
// Note that this does not take care of maintaining the layer
// order on the map.
- 'checkchange': function(node, checked) {
+ "checkchange": function(node, checked) {
if (checked === true) {
mapPanel.map.addLayer(node.attributes.layer);
} else {
@@ -41,7 +43,7 @@
{buffer: 0}
)
],
- region: 'center'
+ region: "center"
});
new Ext.Viewport({
layout: "fit",