]> git.openstreetmap.org Git - rails.git/blob - public/lib/OpenLayers/Tile.js
clearly a fantastic feature, but still...
[rails.git] / public / lib / OpenLayers / Tile.js
1 /* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
2  * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
3  * text of the license. */
4 /*
5  * OpenLayers.Tile 
6  *
7  * @class This is a class designed to designate a single tile, however
8  * it is explicitly designed to do relatively little. Tiles store information
9  * about themselves -- such as the URL that they are related to, and their 
10  * size - but do not add themselves to the layer div automatically, for 
11  * example.
12  */
13 OpenLayers.Tile = Class.create();
14 OpenLayers.Tile.prototype = {
15     
16     /** @type OpenLayers.Layer */
17     layer: null,
18     
19     /** @type String url of the request */
20     url:null,
21
22     /** @type OpenLayers.Bounds */
23     bounds:null,
24     
25     /** @type OpenLayers.Size */
26     size:null,
27     
28     /** Top Left pixel of the tile
29     * @type OpenLayers.Pixel */
30     position:null,
31
32     /**
33     * @constructor
34     *
35     * @param {OpenLayers.Layer} layer
36     * @param {OpenLayers.Pixel} position
37     * @param {OpenLayers.Bounds} bounds
38     * @param {String} url
39     * @param {OpenLayers.Size} size
40     */   
41     initialize: function(layer, position, bounds, url, size) {
42         if (arguments.length > 0) {
43             this.layer = layer;
44             this.position = position;
45             this.bounds = bounds;
46             this.url = url;
47             this.size = size;
48         }
49     },
50     
51     /** nullify references to prevent circular references and memory leaks
52     */
53     destroy:function() {
54         this.layer  = null;
55         this.bounds = null;
56         this.size = null;
57     },
58
59     /**
60     */
61     draw:function() {
62
63     // HACK HACK - should we make it a standard to put this sort of warning
64     //             message in functions that are supposed to be overridden?
65     //
66     //        Log.warn(this.CLASS_NAME + ": draw() not implemented");
67
68     },
69
70     /** remove this tile from the ds
71     */
72     remove:function() {
73     },
74
75     /**
76     * @type OpenLayers.Pixel
77     */
78     getPosition: function() {
79         return this.position;
80     },
81     
82     /** @final @type String */
83     CLASS_NAME: "OpenLayers.Tile"
84 };
85