]> git.openstreetmap.org Git - nominatim.git/blob - website/js/tiles.js
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / website / js / tiles.js
1 /**
2  * Namespace: Util.OSM
3  */
4 OpenLayers.Util.OSM = {};
5
6
7 /**
8  * Class: OpenLayers.Layer.OSM.Mapnik
9  *
10  * Inherits from:
11  *  - <OpenLayers.Layer.OSM>
12  */
13 OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, {
14     /**
15      * Constructor: OpenLayers.Layer.OSM.Mapnik
16      *
17      * Parameters:
18      * name - {String}
19      * options - {Object} Hashtable of extra options to tag onto the layer
20      */
21     initialize: function(name, options) {
22         var url = [
23             "//a.tile.openstreetmap.org/${z}/${x}/${y}.png",
24             "//b.tile.openstreetmap.org/${z}/${x}/${y}.png",
25             "//c.tile.openstreetmap.org/${z}/${x}/${y}.png"
26         ];
27         options = OpenLayers.Util.extend({ numZoomLevels: 19, buffer: 0,
28            attribution : '© <a target="_parent" href="http://www.openstreetmap.org">OpenStreetMap</a> and contributors, under an <a target="_parent" href="http://www.openstreetmap.org/copyright">open license</a>' }, options);
29         var newArguments = [name, url, options];
30         OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
31     },
32
33     CLASS_NAME: "OpenLayers.Layer.OSM.Mapnik"
34 });
35
36 /**
37  * Class: OpenLayers.Layer.OSM.MapQuestOpen
38  *
39  * Inherits from:
40  *  - <OpenLayers.Layer.OSM>
41  */
42 OpenLayers.Layer.OSM.MapQuestOpen = OpenLayers.Class(OpenLayers.Layer.OSM, {
43     /**
44      * Constructor: OpenLayers.Layer.OSM.MapQuestOpen
45      *
46      * Parameters:
47      * name - {String}
48      * options - {Object} Hashtable of extra options to tag onto the layer
49      */
50     initialize: function(name, options) {
51         var url = [
52             "http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
53             "http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
54             "http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
55             "http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png"
56         ];
57         options = OpenLayers.Util.extend({ numZoomLevels: 19, buffer: 0 }, options);
58         var newArguments = [name, url, options];
59         OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
60     },
61
62     CLASS_NAME: "OpenLayers.Layer.OSM.MapQuestOpen"
63 });
64
65 /**
66  * Class: OpenLayers.Layer.OSM.CycleMap
67  *
68  * Inherits from:
69  *  - <OpenLayers.Layer.OSM>
70  */
71 OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
72     /**
73      * Constructor: OpenLayers.Layer.OSM.CycleMap
74      *
75      * Parameters:
76      * name - {String}
77      * options - {Object} Hashtable of extra options to tag onto the layer
78      */
79     initialize: function(name, options) {
80         var url = [
81             "http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
82             "http://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
83             "http://c.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png"
84         ];
85         options = OpenLayers.Util.extend({ numZoomLevels: 19, buffer: 0 }, options);
86         var newArguments = [name, url, options];
87         OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
88     },
89
90     CLASS_NAME: "OpenLayers.Layer.OSM.CycleMap"
91 });