[Commits] r1957 - in sandbox/mapgears/geoext.ux/ux/WMSLayerAdder: examples lib/GeoExt.ux lib/GeoExt.ux/widgets resources resources/css resources/lang

commits at geoext.org commits at geoext.org
Fri Mar 12 17:22:39 CET 2010


Author: adube
Date: 2010-03-12 17:22:39 +0100 (Fri, 12 Mar 2010)
New Revision: 1957

Added:
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.html
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.js
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/SingleFile.js
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/resources/css/WMSLayerAdder.css
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/resources/lang/
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/resources/lang/fr.js
Log:
wmslayeradder - singlefile, example

Added: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.html
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.html	                        (rev 0)
+++ sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.html	2010-03-12 16:22:39 UTC (rev 1957)
@@ -0,0 +1,36 @@
+<html>
+    <head>
+        <title>RedLiningPanel Example</title>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+        <!-- ext version 3.1.0 -->
+        <script type="text/javascript" src="../../../../ext/adapter/ext/ext-base.js"></script>
+        <script type="text/javascript" src="../../../../ext/ext-all.js"></script>
+        <link rel="stylesheet" type="text/css" href="../../../../ext/resources/css/ext-all.css" />
+        <link rel="stylesheet" type="text/css" href="../../../../ext/examples/shared/examples.css" />
+
+        <!-- openlayers version trunk -->
+        <script type="text/javascript" src="../../../../openlayers/lib/OpenLayers.js"></script>
+        <script type="text/javascript" src="../../../../openlayers/lib/OpenLayers/Lang/fr.js"></script>
+        <script type="text/javascript" src="../resources/lang/fr.js"></script>
+        <script type="text/javascript" src="../../../../geoext/lib/GeoExt.js"></script>
+        
+        <link rel="stylesheet" type="text/css" href="../resources/css/WMSLayerAdder.css" />
+        <script type="text/javascript" src="../lib/GeoExt.ux/SingleFile.js"></script>
+        
+        <script type="text/javascript" src="WMSLayerAdderExample.js"></script>
+        
+    </head>
+    <body>
+        <h1>WMSLayerAdder example</h1>
+        
+        <p></p>
+        
+        <p></p>
+        
+        <p></p>
+        
+        <p>See <a href="WMSLayerAdderExample.js">WMSLayerAdderExample.js</a> for the source code.</p>
+        
+        <div id="content"></div>
+    </body>
+</html>


Property changes on: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.html
___________________________________________________________________
Name: svn:mime-type
   + text/html
Name: svn:eol-style
   + native

Added: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.js	                        (rev 0)
+++ sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.js	2010-03-12 16:22:39 UTC (rev 1957)
@@ -0,0 +1,30 @@
+var WMSLayerAdder, mapPanel;
+
+Ext.onReady(function() {
+
+    Ext.QuickTips.init();
+
+    mapPanel = new GeoExt.MapPanel({
+        region: "center",
+        layers: [new OpenLayers.Layer.WMS("Global Imagery",
+            "http://labs.metacarta.com/wms/vmap0",
+            {layers: "basic"})] ,
+        center: [-87,50],
+        zoom: 6
+    });
+
+    WMSLayerAdder = new GeoExt.ux.WMSLayerAdder({
+        title: OpenLayers.i18n("WMSLayerAdder"),
+        region: "east",
+        width: 500,
+        map: mapPanel.map
+    });
+
+    new Ext.Panel({
+        renderTo: "content",
+        layout: "border",
+        width: 900,
+        height: 350,
+        items: [mapPanel, WMSLayerAdder]
+    });
+});


Property changes on: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.js
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/SingleFile.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/SingleFile.js	                        (rev 0)
+++ sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/SingleFile.js	2010-03-12 16:22:39 UTC (rev 1957)
@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2008-2010 The Open Source Geospatial Foundation
+ * 
+ * Published under the BSD license.
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
+ * of the license.
+ */
+
+/*
+ * The code in this file is based on code taken from OpenLayers.
+ *
+ * Copyright (c) 2006-2007 MetaCarta, Inc., published under the Clear BSD
+ * license.  See http://svn.openlayers.org/trunk/openlayers/license.txt for the
+ * full text of the license.
+ */
+ 
+(function() {
+
+    /**
+     * The relative path of this script.
+     */
+    var scriptName = "lib/GeoExt.ux/SingleFile.js";
+
+    /**
+     * Function returning the path of this script.
+     */
+    var getScriptLocation = function() {
+        var scriptLocation = "";
+        // If we load other scripts right before GeoExt using the same
+        // mechanism to add script resources dynamically (e.g. OpenLayers), 
+        // document.getElementsByTagName will not find the GeoExt script tag
+        // in FF2. Using document.documentElement.getElementsByTagName instead
+        // works around this issue.
+        var scripts = document.documentElement.getElementsByTagName('script');
+        for(var i=0, len=scripts.length; i<len; i++) {
+            var src = scripts[i].getAttribute('src');
+            if(src) {
+                var index = src.lastIndexOf(scriptName); 
+                // set path length for src up to a query string
+                var pathLength = src.lastIndexOf('?');
+                if(pathLength < 0) {
+                    pathLength = src.length;
+                }
+                // is it found, at the end of the URL?
+                if((index > -1) && (index + scriptName.length == pathLength)) {
+                    scriptLocation = src.slice(0, pathLength - scriptName.length);
+                    break;
+                }
+            }
+        }
+        return scriptLocation;
+    };
+
+    var jsfiles = new Array(
+        "widgets/WMSLayerAdder.js"
+    );
+
+    var agent = navigator.userAgent;
+    var docWrite = (agent.match("MSIE") || agent.match("Safari"));
+    if(docWrite) {
+        var allScriptTags = new Array(jsfiles.length);
+    }
+    var host = getScriptLocation() + "lib/GeoExt.ux/";    
+    for (var i=0, len=jsfiles.length; i<len; i++) {
+        if (docWrite) {
+            allScriptTags[i] = "<script src='" + host + jsfiles[i] +
+                               "'></script>"; 
+        } else {
+            var s = document.createElement("script");
+            s.src = host + jsfiles[i];
+            var h = document.getElementsByTagName("head").length ? 
+                       document.getElementsByTagName("head")[0] : 
+                       document.body;
+            h.appendChild(s);
+        }
+    }
+    if (docWrite) {
+        document.write(allScriptTags.join(""));
+    }
+})();


Property changes on: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/SingleFile.js
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js	                        (rev 0)
+++ sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js	2010-03-12 16:22:39 UTC (rev 1957)
@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2008-2010 The Open Source Geospatial Foundation
+ * 
+ * Published under the BSD license.
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
+ * of the license.
+ */
+
+Ext.namespace("GeoExt.ux")
+
+/*
+ * @requires GeoExt/widgets/Action.js
+ */
+
+/** api: (define)
+ *  module = GeoExt.ux
+ *  class = WMSLayerAdder
+ */
+
+/** api: constructor
+ *  .. class:: WMSLayerAdder
+ */
+GeoExt.ux.WMSLayerAdder = Ext.extend(Ext.Panel, {
+
+    /** private: method[constructor]
+     */
+    constructor: function(config) {
+        arguments.callee.superclass.constructor.call(this, config);
+    }
+});


Property changes on: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/resources/css/WMSLayerAdder.css
===================================================================


Property changes on: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/resources/css/WMSLayerAdder.css
___________________________________________________________________
Name: svn:mime-type
   + text/css
Name: svn:eol-style
   + native

Added: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/resources/lang/fr.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/resources/lang/fr.js	                        (rev 0)
+++ sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/resources/lang/fr.js	2010-03-12 16:22:39 UTC (rev 1957)
@@ -0,0 +1,2 @@
+OpenLayers.Util.extend(OpenLayers.Lang.fr, {
+});


Property changes on: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/resources/lang/fr.js
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native



More information about the Commits mailing list