[9139] | 1 | /**
|
---|
| 2 | * Namespace: Util.OSM
|
---|
| 3 | */
|
---|
| 4 | OpenLayers.Util.OSM = {};
|
---|
| 5 |
|
---|
| 6 | /**
|
---|
| 7 | * Constant: MISSING_TILE_URL
|
---|
| 8 | * {String} URL of image to display for missing tiles
|
---|
| 9 | */
|
---|
| 10 | OpenLayers.Util.OSM.MISSING_TILE_URL = "http://openstreetmap.org/openlayers/img/404.png";
|
---|
| 11 |
|
---|
| 12 | /**
|
---|
| 13 | * Property: originalOnImageLoadError
|
---|
| 14 | * {Function} Original onImageLoadError function.
|
---|
| 15 | */
|
---|
| 16 | OpenLayers.Util.OSM.originalOnImageLoadError = OpenLayers.Util.onImageLoadError;
|
---|
| 17 |
|
---|
| 18 | /**
|
---|
| 19 | * Function: onImageLoadError
|
---|
| 20 | */
|
---|
| 21 | OpenLayers.Util.onImageLoadError = function() {
|
---|
| 22 | if (this.src.match(/^http:\/\/[abc]\.[a-z]+\.openstreetmap\.org\//)) {
|
---|
| 23 | this.src = OpenLayers.Util.OSM.MISSING_TILE_URL;
|
---|
| 24 | } else if (this.src.match(/^http:\/\/[def]\.tah\.openstreetmap\.org\//)) {
|
---|
| 25 | // do nothing - this layer is transparent
|
---|
| 26 | } else {
|
---|
| 27 | OpenLayers.Util.OSM.originalOnImageLoadError;
|
---|
| 28 | }
|
---|
| 29 | };
|
---|
| 30 |
|
---|
| 31 | /**
|
---|
| 32 | * Class: OpenLayers.Layer.OSM.Mapnik
|
---|
| 33 | *
|
---|
| 34 | * Inherits from:
|
---|
| 35 | * - <OpenLayers.Layer.OSM>
|
---|
| 36 | */
|
---|
| 37 | OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 38 | /**
|
---|
| 39 | * Constructor: OpenLayers.Layer.OSM.Mapnik
|
---|
| 40 | *
|
---|
| 41 | * Parameters:
|
---|
| 42 | * name - {String}
|
---|
| 43 | * options - {Object} Hashtable of extra options to tag onto the layer
|
---|
| 44 | */
|
---|
| 45 | initialize: function(name, options) {
|
---|
| 46 | var url = [
|
---|
[9189] | 47 | "/website/osm-proxy/${z}/${x},${y}.png",
|
---|
[9139] | 48 | ];
|
---|
| 49 | options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options);
|
---|
| 50 | var newArguments = [name, url, options];
|
---|
| 51 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 52 | },
|
---|
| 53 |
|
---|
| 54 | CLASS_NAME: "OpenLayers.Layer.OSM.Mapnik"
|
---|
| 55 | });
|
---|
| 56 |
|
---|
| 57 | /**
|
---|
| 58 | * Class: OpenLayers.Layer.OSM.Osmarender
|
---|
| 59 | *
|
---|
| 60 | * Inherits from:
|
---|
| 61 | * - <OpenLayers.Layer.OSM>
|
---|
| 62 | */
|
---|
| 63 | OpenLayers.Layer.OSM.Osmarender = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 64 | /**
|
---|
| 65 | * Constructor: OpenLayers.Layer.OSM.Osmarender
|
---|
| 66 | *
|
---|
| 67 | * Parameters:
|
---|
| 68 | * name - {String}
|
---|
| 69 | * options - {Object} Hashtable of extra options to tag onto the layer
|
---|
| 70 | */
|
---|
| 71 | initialize: function(name, options) {
|
---|
| 72 | var url = [
|
---|
| 73 | "http://a.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
|
---|
| 74 | "http://b.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
|
---|
| 75 | "http://c.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png"
|
---|
| 76 | ];
|
---|
| 77 | options = OpenLayers.Util.extend({ numZoomLevels: 18 }, options);
|
---|
| 78 | var newArguments = [name, url, options];
|
---|
| 79 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 80 | },
|
---|
| 81 |
|
---|
| 82 | CLASS_NAME: "OpenLayers.Layer.OSM.Osmarender"
|
---|
| 83 | });
|
---|
| 84 |
|
---|
| 85 | /**
|
---|
| 86 | * Class: OpenLayers.Layer.OSM.CycleMap
|
---|
| 87 | *
|
---|
| 88 | * Inherits from:
|
---|
| 89 | * - <OpenLayers.Layer.OSM>
|
---|
| 90 | */
|
---|
| 91 | OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 92 | /**
|
---|
| 93 | * Constructor: OpenLayers.Layer.OSM.CycleMap
|
---|
| 94 | *
|
---|
| 95 | * Parameters:
|
---|
| 96 | * name - {String}
|
---|
| 97 | * options - {Object} Hashtable of extra options to tag onto the layer
|
---|
| 98 | */
|
---|
| 99 | initialize: function(name, options) {
|
---|
| 100 | var url = [
|
---|
| 101 | "http://a.andy.sandbox.cloudmade.com/tiles/cycle/${z}/${x}/${y}.png",
|
---|
| 102 | "http://b.andy.sandbox.cloudmade.com/tiles/cycle/${z}/${x}/${y}.png",
|
---|
| 103 | "http://c.andy.sandbox.cloudmade.com/tiles/cycle/${z}/${x}/${y}.png"
|
---|
| 104 | ];
|
---|
| 105 | options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options);
|
---|
| 106 | var newArguments = [name, url, options];
|
---|
| 107 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 108 | },
|
---|
| 109 |
|
---|
| 110 | CLASS_NAME: "OpenLayers.Layer.OSM.CycleMap"
|
---|
| 111 | });
|
---|
| 112 |
|
---|
| 113 | /**
|
---|
| 114 | * Class: OpenLayers.Layer.OSM.Maplint
|
---|
| 115 | *
|
---|
| 116 | * Inherits from:
|
---|
| 117 | * - <OpenLayers.Layer.OSM>
|
---|
| 118 | */
|
---|
| 119 | OpenLayers.Layer.OSM.Maplint = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 120 | /**
|
---|
| 121 | * Constructor: OpenLayers.Layer.OSM.Maplint
|
---|
| 122 | *
|
---|
| 123 | * Parameters:
|
---|
| 124 | * name - {String}
|
---|
| 125 | * options - {Object} Hashtable of extra options to tag onto the layer
|
---|
| 126 | */
|
---|
| 127 | initialize: function(name, options) {
|
---|
| 128 | var url = [
|
---|
| 129 | "http://d.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
|
---|
| 130 | "http://e.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
|
---|
| 131 | "http://f.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png"
|
---|
| 132 | ];
|
---|
| 133 | options = OpenLayers.Util.extend({ numZoomLevels: 21, isBaseLayer: false, visibility: false }, options);
|
---|
| 134 | var newArguments = [name, url, options];
|
---|
| 135 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 136 | },
|
---|
| 137 |
|
---|
| 138 | CLASS_NAME: "OpenLayers.Layer.OSM.Maplint"
|
---|
| 139 | });
|
---|
| 140 |
|
---|
| 141 |
|
---|
| 142 | OpenLayers.Layer.OSM.Overlay1 = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 143 | initialize: function(name, options) {
|
---|
| 144 | var url = [
|
---|
| 145 | "/gheat/classic/${z}/${x},${y}.png"
|
---|
| 146 | ];
|
---|
| 147 | options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
|
---|
| 148 | var newArguments = [name, url, options];
|
---|
| 149 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 150 | },
|
---|
[9274] | 151 | colour: "0,0,0",
|
---|
[9271] | 152 | CLASS_NAME: "OpenLayers.Layer.Overlay"
|
---|
[9139] | 153 | });
|
---|
[9147] | 154 |
|
---|
| 155 | OpenLayers.Layer.OSM.Overlay2 = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 156 | initialize: function(name, options) {
|
---|
| 157 | var url = [
|
---|
[9263] | 158 | "/website/tile/${z}/${x},${y}.png?colour=90,90,90"
|
---|
[9147] | 159 | ];
|
---|
| 160 | options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
|
---|
| 161 | var newArguments = [name, url, options];
|
---|
| 162 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 163 | },
|
---|
[9274] | 164 | colour: "90,90,90",
|
---|
[9271] | 165 | CLASS_NAME: "OpenLayers.Layer.Overlay"
|
---|
[9147] | 166 | });
|
---|
[9166] | 167 |
|
---|
| 168 | OpenLayers.Layer.OSM.Overlay3 = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 169 | initialize: function(name, options) {
|
---|
| 170 | var url = [
|
---|
[9263] | 171 | "/website/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden"
|
---|
[9166] | 172 | ];
|
---|
| 173 | options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
|
---|
| 174 | var newArguments = [name, url, options];
|
---|
| 175 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 176 | },
|
---|
[9274] | 177 | colour: "255,0,0",
|
---|
[9271] | 178 | CLASS_NAME: "OpenLayers.Layer.Overlay"
|
---|
[9166] | 179 | });
|
---|
[9275] | 180 |
|
---|
| 181 | OpenLayers.Layer.OSM.Overlay4 = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 182 | initialize: function(name, options) {
|
---|
| 183 | var url = [
|
---|
| 184 | "/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=0&signaal__lte=100"
|
---|
| 185 | ];
|
---|
| 186 | options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
|
---|
| 187 | var newArguments = [name, url, options];
|
---|
| 188 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 189 | },
|
---|
| 190 | colour: "250,250,0",
|
---|
| 191 | CLASS_NAME: "OpenLayers.Layer.Overlay"
|
---|
| 192 | });
|
---|