OpenLayers OpenLayers

Ticket #1076: tileOrigin.patch

File tileOrigin.patch, 1.2 kB (added by euzuro, 11 months ago)
  • lib/OpenLayers/Layer/TileCache.js

    old new  
    2222     */ 
    2323    isBaseLayer: true, 
    2424     
    25     /** 
    26      * APIProperty: tileOrigin 
    27      * {<OpenLayers.LonLat>} Location of the tile lattice origin.  Default is 
    28      *     bottom left of the maxExtent. 
    29      */ 
    30     tileOrigin: null, 
    31      
    3225    /**  
    3326     * APIProperty: format 
    3427     * {String} Mime type of the images returned.  Default is image/png. 
     
    147140                                             url, this.tileSize); 
    148141    }, 
    149142 
    150     /**  
    151      * Method: setMap 
    152      * When the layer is added to a map, then we can fetch our origin  
    153      *     (if we don't have one.)  
    154      *  
    155      * Parameters: 
    156      * map - {<OpenLayers.Map>}  
    157      */ 
    158     setMap: function(map) { 
    159         OpenLayers.Layer.Grid.prototype.setMap.apply(this, arguments); 
    160         if (!this.tileOrigin) {  
    161             this.tileOrigin = new OpenLayers.LonLat(this.map.maxExtent.left, 
    162                                                     this.map.maxExtent.bottom); 
    163         } 
    164     }, 
    165  
    166143    CLASS_NAME: "OpenLayers.Layer.TileCache" 
    167144});