[OpenLayers-Commits] r3586 - sandbox/euzuro/untiled3/lib/OpenLayers/Layer/MapServer

commits at openlayers.org commits at openlayers.org
Thu Jul 5 13:24:01 EDT 2007


Author: euzuro
Date: 2007-07-05 13:24:00 -0400 (Thu, 05 Jul 2007)
New Revision: 3586

Modified:
   sandbox/euzuro/untiled3/lib/OpenLayers/Layer/MapServer/Untiled.js
Log:
chopping out some unnecessary functions from untiled mapserver layer. still needs more work

Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Layer/MapServer/Untiled.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Layer/MapServer/Untiled.js	2007-07-05 17:11:23 UTC (rev 3585)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Layer/MapServer/Untiled.js	2007-07-05 17:24:00 UTC (rev 3586)
@@ -3,138 +3,37 @@
  * for the full text of the license. */
  
 /**
- * @requires OpenLayers/Layer/HTTPRequest.js
  * @requires OpenLayers/Layer/MapServer.js
  *
  * Class: OpenLayers.Layer.MapServer.Untiled
  *
  * Inherits from:
- *  - <OpenLayers.Layer.HTTPRequest> 
+ *  - <OpenLayers.Layer.MapServer> 
  */
 OpenLayers.Layer.MapServer.Untiled = OpenLayers.Class.create();
 OpenLayers.Layer.MapServer.Untiled.prototype = 
-  OpenLayers.Class.inherit( OpenLayers.Layer.HTTPRequest, {
+  OpenLayers.Class.inherit( OpenLayers.Layer.Mapserver, {
 
     /**
-     * Constant: default_params
-     * Hashtable of default parameter key/value pairs
+     * APIProperty: singleTile
+     * {Boolean} Always true for untiled layer.
      */
-    default_params: {
-                      mode: "map",
-                      map_imagetype: "png"
-                     },
-    
-    /**
-     * APIProperty: reproject
-     * {Boolean} 'stretch' tiles according to base layer.
-     */
-    reproject: true,
+    singleTile: true,
 
     /**
-     * APIProperty: ratio
-     * {Float} the ratio of image/tile size to map size (this is the untiled
-     * buffer)
+     * Constructor: OpenLayers.Layer.MapServer.Untiled
+     *
+     * Parameters:
+     * name - {String} 
+     * url - {String} 
+     * params - {Object} 
      */
-    ratio: 1,
-
-    /** 
-     * Property: tile
-     * {<OpenLayers.Tile.Image>}
-     */
-    tile: null,
-
-    /**
-     * Propety: doneLoading
-     * {Boolean} did the image finish loading before a new draw was initiated?
-     */
-    doneLoading: false,
-
-    /**
-    * Constructor: OpenLayers.Layer.MapServer.Untiled
-    *
-    * Parameters:
-    * name - {String} 
-    * url - {String} 
-    * params - {Object} 
-    */
     initialize: function(name, url, params, options) {
-        var newArguments = [];
-        newArguments.push(name, url, params, options);
-        OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this, 
-                                                                newArguments);
-        OpenLayers.Util.applyDefaults(
-                       this.params, 
-                       this.default_params
-                       );
-
-        // unless explicitly set in options, if the layer is transparent, 
-        // it will be an overlay        
-        if ((options == null) || (options.isBaseLayer == null)) {
-            this.isBaseLayer = ((this.params.transparent != "true") && 
-                                (this.params.transparent != true));
-        }
+        OpenLayers.Layer.MapServer.prototype.initialize.apply(this, arguments);
     },    
 
-    /**
-     * APIMethod: destroy 
-     */
-    destroy: function() {
-        if (this.tile) {
-          this.tile.destroy();
-          this.tile = null;    
-        }
-        OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this, arguments);
-    },
-    
-    /**
-     * APIMethod: clone
-     * obj - {Object} 
-     * 
-     * Returns:
-     * {<OpenLayers.Layer.MapServer.Untiled>} An exact clone of this
-     * OpenLayers.Layer.MapServer.Untiled
-     */
-    clone: function (obj) {
-        
-        if (obj == null) {
-            obj = new OpenLayers.Layer.MapServer.Untiled(this.name,
-                                                         this.url,
-                                                         this.params,
-                                                         this.options);
-        }
 
-        //get all additions from superclasses
-        obj = OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this, [obj]);
-
-        // copy/set any non-init, non-simple values here
-
-        return obj;
-    },    
-    
-    
     /**
-     * Method: setMap
-     * Once HTTPRequest has set the map, we can load the image div
-     * 
-     * Parameters:
-     * map - {<OpenLayers.Map>} 
-     */
-    setMap: function(map) {
-        OpenLayers.Layer.HTTPRequest.prototype.setMap.apply(this, arguments);
-    },
-    
-    /**
-     * Method: setTileSize
-     * Set the tile size based on the map size.
-     */
-    setTileSize: function() {
-        var tileSize = this.map.getSize();
-        tileSize.w = tileSize.w * this.ratio;
-        tileSize.h = tileSize.h * this.ratio;
-        this.tileSize = tileSize;
-    },
-
-    /**
      * Method: moveTo
      * When it is not a dragging move (ie when done dragging)
      *   reload and recenter the div.



More information about the Commits mailing list