~ubuntu-branches/ubuntu/saucy/phpmyadmin/saucy-proposed

« back to all changes in this revision

Viewing changes to js/OpenStreetMap.js

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2013-08-04 13:24:37 UTC
  • mfrom: (1.2.44)
  • Revision ID: package-import@ubuntu.com-20130804132437-jznw8efwy4hr1nms
Tags: 4:4.0.5-1
* New upstream release.
  - Fixes security issue PMASA-2013-10.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
OpenLayers.Util.OSM={};OpenLayers.Util.OSM.MISSING_TILE_URL="http://www.openstreetmap.org/openlayers/img/404.png";OpenLayers.Util.OSM.originalOnImageLoadError=OpenLayers.Util.onImageLoadError;OpenLayers.Util.onImageLoadError=function(){if(this.src.match(/^http:\/\/[abc]\.[a-z]+\.openstreetmap\.org\//)){this.src=OpenLayers.Util.OSM.MISSING_TILE_URL}else{if(this.src.match(/^http:\/\/[def]\.tah\.openstreetmap\.org\//)){}else{OpenLayers.Util.OSM.originalOnImageLoadError}}};OpenLayers.Layer.OSM.Mapnik=OpenLayers.Class(OpenLayers.Layer.OSM,{initialize:function(d,c){var b=["http://a.tile.openstreetmap.org/${z}/${x}/${y}.png","http://b.tile.openstreetmap.org/${z}/${x}/${y}.png","http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"];c=OpenLayers.Util.extend({numZoomLevels:19,buffer:0,transitionEffect:"resize"},c);var a=[d,b,c];OpenLayers.Layer.OSM.prototype.initialize.apply(this,a)},CLASS_NAME:"OpenLayers.Layer.OSM.Mapnik"});OpenLayers.Layer.OSM.Osmarender=OpenLayers.Class(OpenLayers.Layer.OSM,{initialize:function(d,c){var b=["http://a.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png","http://b.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png","http://c.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png"];c=OpenLayers.Util.extend({numZoomLevels:18,buffer:0,transitionEffect:"resize"},c);var a=[d,b,c];OpenLayers.Layer.OSM.prototype.initialize.apply(this,a)},CLASS_NAME:"OpenLayers.Layer.OSM.Osmarender"});OpenLayers.Layer.OSM.CycleMap=OpenLayers.Class(OpenLayers.Layer.OSM,{initialize:function(d,c){var b=["http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png","http://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png","http://c.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png"];c=OpenLayers.Util.extend({numZoomLevels:19,buffer:0,transitionEffect:"resize"},c);var a=[d,b,c];OpenLayers.Layer.OSM.prototype.initialize.apply(this,a)},CLASS_NAME:"OpenLayers.Layer.OSM.CycleMap"});
 
 
b'\\ No newline at end of file'
 
1
/* vim: set expandtab sw=4 ts=4 sts=4: */
 
2
/**
 
3
 * Namespace: Util.OSM
 
4
 */
 
5
OpenLayers.Util.OSM = {};
 
6
 
 
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";
 
12
 
 
13
/**
 
14
 * Property: originalOnImageLoadError
 
15
 * {Function} Original onImageLoadError function.
 
16
 */
 
17
OpenLayers.Util.OSM.originalOnImageLoadError = OpenLayers.Util.onImageLoadError;
 
18
 
 
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
    }
 
30
};
 
31
 
 
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
    },
 
60
 
 
61
    CLASS_NAME: "OpenLayers.Layer.OSM.Mapnik"
 
62
});
 
63
 
 
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
    },
 
92
 
 
93
    CLASS_NAME: "OpenLayers.Layer.OSM.Osmarender"
 
94
});
 
95
 
 
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
    },
 
124
 
 
125
    CLASS_NAME: "OpenLayers.Layer.OSM.CycleMap"
 
126
});