]> git.openstreetmap.org Git - rails.git/blob - vendor/assets/openlayers/OpenStreetMap.js
Merge remote-tracking branch 'upstream/pull/1727'
[rails.git] / vendor / assets / openlayers / OpenStreetMap.js
1 /**
2  * Class: OpenLayers.Layer.OSM.Mapnik
3  *
4  * Inherits from:
5  *  - <OpenLayers.Layer.OSM>
6  */
7 OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, {
8     /**
9      * Constructor: OpenLayers.Layer.OSM.Mapnik
10      *
11      * Parameters:
12      * name - {String}
13      * options - {Object} Hashtable of extra options to tag onto the layer
14      */
15     initialize: function(name, options) {
16         var url = [
17             "https://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
18             "https://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
19             "https://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
20         ];
21         options = OpenLayers.Util.extend({
22             numZoomLevels: 20,
23             attribution: "&copy; <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",
24             buffer: 0,
25             transitionEffect: "resize"
26         }, options);
27         var newArguments = [name, url, options];
28         OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
29     },
30
31     CLASS_NAME: "OpenLayers.Layer.OSM.Mapnik"
32 });
33
34 /**
35  * Class: OpenLayers.Layer.OSM.CycleMap
36  *
37  * Inherits from:
38  *  - <OpenLayers.Layer.OSM>
39  */
40 OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
41     /**
42      * Constructor: OpenLayers.Layer.OSM.CycleMap
43      *
44      * Parameters:
45      * name - {String}
46      * options - {Object} Hashtable of extra options to tag onto the layer
47      */
48     initialize: function(name, options) {
49         var url = [
50             "http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
51             "http://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
52             "http://c.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png"
53         ];
54         options = OpenLayers.Util.extend({
55             numZoomLevels: 19,
56             attribution: "&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors, Tiles courtesy of <a href='http://www.opencyclemap.org'>Andy Allan</a>",
57             buffer: 0,
58             transitionEffect: "resize"
59         }, options);
60         var newArguments = [name, url, options];
61         OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
62     },
63
64     CLASS_NAME: "OpenLayers.Layer.OSM.CycleMap"
65 });
66
67 /**
68  * Class: OpenLayers.Layer.OSM.TransportMap
69  *
70  * Inherits from:
71  *  - <OpenLayers.Layer.OSM>
72  */
73 OpenLayers.Layer.OSM.TransportMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
74     /**
75      * Constructor: OpenLayers.Layer.OSM.TransportMap
76      *
77      * Parameters:
78      * name - {String}
79      * options - {Object} Hashtable of extra options to tag onto the layer
80      */
81     initialize: function(name, options) {
82         var url = [
83             "http://a.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png",
84             "http://b.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png",
85             "http://c.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png"
86         ];
87         options = OpenLayers.Util.extend({
88             numZoomLevels: 19,
89             attribution: "&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors, Tiles courtesy of <a href='http://www.opencyclemap.org'>Andy Allan</a>",
90             buffer: 0,
91             transitionEffect: "resize"
92         }, options);
93         var newArguments = [name, url, options];
94         OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
95     },
96
97     CLASS_NAME: "OpenLayers.Layer.OSM.TransportMap"
98 });