Translated using Weblate (Hungarian)
[phpmyadmin.git] / js / OpenStreetMap.js
blob51694bc86ca922a4f50f99edb1dc1c953e64263e
1 /* vim: set expandtab sw=4 ts=4 sts=4: */
2 /**
3  * Namespace: Util.OSM
4  */
5 OpenLayers.Util.OSM = {};
7 /**
8  * Constant: MISSING_TILE_URL
9  * {String} URL of image to display for missing tiles
10  */
11 OpenLayers.Util.OSM.MISSING_TILE_URL = "http://www.openstreetmap.org/openlayers/img/404.png";
13 /**
14  * Property: originalOnImageLoadError
15  * {Function} Original onImageLoadError function.
16  */
17 OpenLayers.Util.OSM.originalOnImageLoadError = OpenLayers.Util.onImageLoadError;
19 /**
20  * Function: onImageLoadError
21  */
22 OpenLayers.Util.onImageLoadError = function () {
23     if (this.src.match(/^http:\/\/[abc]\.[a-z]+\.openstreetmap\.org\//)) {
24         this.src = OpenLayers.Util.OSM.MISSING_TILE_URL;
25     } else if (this.src.match(/^http:\/\/[def]\.tah\.openstreetmap\.org\//)) {
26         // do nothing - this layer is transparent
27     } else {
28         OpenLayers.Util.OSM.originalOnImageLoadError;
29     }
32 /**
33  * Class: OpenLayers.Layer.OSM.Mapnik
34  *
35  * Inherits from:
36  *  - <OpenLayers.Layer.OSM>
37  */
38 OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, {
39     /**
40      * Constructor: OpenLayers.Layer.OSM.Mapnik
41      *
42      * Parameters:
43      * name - {String}
44      * options - {Object} Hashtable of extra options to tag onto the layer
45      */
46     initialize: function (name, options) {
47         var url = [
48             "http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
49             "http://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
50             "http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
51         ];
52         options = OpenLayers.Util.extend({
53             numZoomLevels: 19,
54             buffer: 0,
55             transitionEffect: "resize"
56         }, options);
57         var newArguments = [name, url, options];
58         OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
59     },
61     CLASS_NAME: "OpenLayers.Layer.OSM.Mapnik"
62 });
64 /**
65  * Class: OpenLayers.Layer.OSM.Osmarender
66  *
67  * Inherits from:
68  *  - <OpenLayers.Layer.OSM>
69  */
70 OpenLayers.Layer.OSM.Osmarender = OpenLayers.Class(OpenLayers.Layer.OSM, {
71     /**
72      * Constructor: OpenLayers.Layer.OSM.Osmarender
73      *
74      * Parameters:
75      * name - {String}
76      * options - {Object} Hashtable of extra options to tag onto the layer
77      */
78     initialize: function (name, options) {
79         var url = [
80             "http://a.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
81             "http://b.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
82             "http://c.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png"
83         ];
84         options = OpenLayers.Util.extend({
85             numZoomLevels: 18,
86             buffer: 0,
87             transitionEffect: "resize"
88         }, options);
89         var newArguments = [name, url, options];
90         OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
91     },
93     CLASS_NAME: "OpenLayers.Layer.OSM.Osmarender"
94 });
96 /**
97  * Class: OpenLayers.Layer.OSM.CycleMap
98  *
99  * Inherits from:
100  *  - <OpenLayers.Layer.OSM>
101  */
102 OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
103     /**
104      * Constructor: OpenLayers.Layer.OSM.CycleMap
105      *
106      * Parameters:
107      * name - {String}
108      * options - {Object} Hashtable of extra options to tag onto the layer
109      */
110     initialize: function (name, options) {
111         var url = [
112             "http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
113             "http://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
114             "http://c.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png"
115         ];
116         options = OpenLayers.Util.extend({
117             numZoomLevels: 19,
118             buffer: 0,
119             transitionEffect: "resize"
120         }, options);
121         var newArguments = [name, url, options];
122         OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
123     },
125     CLASS_NAME: "OpenLayers.Layer.OSM.CycleMap"