PageSourceSearch

https://shop.centremapslive.co.uk/js/watermark.js

js centremapslive.co.uk collected 2026-09-26 15:12:53 UTC 2,992 bytes, 118 lines download raw bytes

1/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
2 * licence.  See http://svn.openlayers.org/trunk/openlayers/license.txt for the
3 * full text of the license. */
4
5
6/**
7 * @requires OpenLayers/Layer/Grid.js
8 * @requires OpenLayers/Tile/Image.js
9 */
10
11/**
12 * Class: OpenLayers.Layer.Watermark
13 *
14 * Inherits from:
15 *  - <OpenLayers.Layer.Grid>
16 */
17OpenLayers.Layer.Watermark = OpenLayers.Class(OpenLayers.Layer.Grid, {
18
19    /**
20     * APIProperty: isBaseLayer
21     * {Boolean}
22     */
23    isBaseLayer: false,
24
25    /**
26     * Constructor: OpenLayers.Layer.TMS
27     *
28     * Parameters:
29     * name - {String}
30     * url - {String}
31     * options - {Object} Hashtable of extra options to tag onto the layer
32     */
33    initialize: function (name, url, options) {
34        var newArguments = [];
35        newArguments.push(name, url, {}, options);
36        OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments);
37    },
38
39    /**
40     * APIMethod:destroy
41     */
42    destroy: function () {
43        // for now, nothing special to do here. 
44        OpenLayers.Layer.Grid.prototype.destroy.apply(this, arguments);
45    },
46
47
48    /**
49     * APIMethod: clone
50     *
51     * Parameters:
52     * obj - {Object}
53     *
54     * Returns:
55     * {<OpenLayers.Layer.TMS>} An exact clone of this <OpenLayers.Layer.TMS>
56     */
57    clone: function (obj) {
58
59        if (obj == null) {
60            obj = new OpenLayers.Layer.TMS(this.name,
61                this.url,
62                this.options);
63        }
64
65        //get all additions from superclasses
66        obj = OpenLayers.Layer.Grid.prototype.clone.apply(this, [obj]);
67
68        // copy/set any non-init, non-simple values here
69
70        return obj;
71    },
72
73    /**
74     * Method: getURL
75     *
76     * Returns:
77     * {String} A string with the layer's url and parameters and also the
78     *          passed-in bounds and appropriate tile size specified as
79     *          parameters
80     */
81    getURL: function () {
82        return this.url
83    },
84
85    /**
86     * Method: addTile
87     * addTile creates a tile, initializes it, and adds it to the layer div.
88     *
89     * Parameters:
90     * bounds - {<OpenLayers.Bounds>}
91     * position - {<OpenLayers.Pixel>}
92     *
93     * Returns:
94     * {<OpenLayers.Tile.Image>} The added OpenLayers.Tile.Image
95     */
96    addTile: function (bounds, position) {
97        return new OpenLayers.Tile.Image(this, position, bounds,
98            null, this.tileSize);
99    },
100
101    /**
102     * APIMethod: setMap
103     * When the layer is added to a map, then we can fetch our origin
104     *    (if we don't have one.)
105     *
106     * Parameters:
107     * map - {<OpenLayers.Map>}
108     */
109    setMap: function (map) {
110        OpenLayers.Layer.Grid.prototype.setMap.apply(this, arguments);
111        if (!this.tileOrigin) {
112            this.tileOrigin = new OpenLayers.LonLat(this.map.maxExtent.left,
113                this.map.maxExtent.bottom);
114        }
115    },
116
117    CLASS_NAME: "OpenLayers.Layer.Watermark"
118});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.