[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 = [
|
---|
[9358] | 47 | "http://a.osmproxy.wirelessleiden.nl/heatmap/osm-proxy/${z}/${x},${y}.png",
|
---|
| 48 | "http://b.osmproxy.wirelessleiden.nl/heatmap/osm-proxy/${z}/${x},${y}.png",
|
---|
| 49 | "http://c.osmproxy.wirelessleiden.nl/heatmap/osm-proxy/${z}/${x},${y}.png",
|
---|
[9373] | 50 | "http://d.osmproxy.wirelessleiden.nl/heatmap/osm-proxy/${z}/${x},${y}.png",
|
---|
| 51 | "http://e.osmproxy.wirelessleiden.nl/heatmap/osm-proxy/${z}/${x},${y}.png",
|
---|
| 52 | "http://f.osmproxy.wirelessleiden.nl/heatmap/osm-proxy/${z}/${x},${y}.png",
|
---|
[9139] | 53 | ];
|
---|
| 54 | options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options);
|
---|
| 55 | var newArguments = [name, url, options];
|
---|
| 56 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 57 | },
|
---|
| 58 |
|
---|
| 59 | CLASS_NAME: "OpenLayers.Layer.OSM.Mapnik"
|
---|
| 60 | });
|
---|
| 61 |
|
---|
| 62 | /**
|
---|
| 63 | * Class: OpenLayers.Layer.OSM.Osmarender
|
---|
| 64 | *
|
---|
| 65 | * Inherits from:
|
---|
| 66 | * - <OpenLayers.Layer.OSM>
|
---|
| 67 | */
|
---|
| 68 | OpenLayers.Layer.OSM.Osmarender = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 69 | /**
|
---|
| 70 | * Constructor: OpenLayers.Layer.OSM.Osmarender
|
---|
| 71 | *
|
---|
| 72 | * Parameters:
|
---|
| 73 | * name - {String}
|
---|
| 74 | * options - {Object} Hashtable of extra options to tag onto the layer
|
---|
| 75 | */
|
---|
| 76 | initialize: function(name, options) {
|
---|
| 77 | var url = [
|
---|
| 78 | "http://a.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
|
---|
| 79 | "http://b.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
|
---|
| 80 | "http://c.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png"
|
---|
| 81 | ];
|
---|
| 82 | options = OpenLayers.Util.extend({ numZoomLevels: 18 }, options);
|
---|
| 83 | var newArguments = [name, url, options];
|
---|
| 84 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 85 | },
|
---|
| 86 |
|
---|
| 87 | CLASS_NAME: "OpenLayers.Layer.OSM.Osmarender"
|
---|
| 88 | });
|
---|
| 89 |
|
---|
| 90 | /**
|
---|
| 91 | * Class: OpenLayers.Layer.OSM.CycleMap
|
---|
| 92 | *
|
---|
| 93 | * Inherits from:
|
---|
| 94 | * - <OpenLayers.Layer.OSM>
|
---|
| 95 | */
|
---|
| 96 | OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 97 | /**
|
---|
| 98 | * Constructor: OpenLayers.Layer.OSM.CycleMap
|
---|
| 99 | *
|
---|
| 100 | * Parameters:
|
---|
| 101 | * name - {String}
|
---|
| 102 | * options - {Object} Hashtable of extra options to tag onto the layer
|
---|
| 103 | */
|
---|
| 104 | initialize: function(name, options) {
|
---|
| 105 | var url = [
|
---|
| 106 | "http://a.andy.sandbox.cloudmade.com/tiles/cycle/${z}/${x}/${y}.png",
|
---|
| 107 | "http://b.andy.sandbox.cloudmade.com/tiles/cycle/${z}/${x}/${y}.png",
|
---|
| 108 | "http://c.andy.sandbox.cloudmade.com/tiles/cycle/${z}/${x}/${y}.png"
|
---|
| 109 | ];
|
---|
| 110 | options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options);
|
---|
| 111 | var newArguments = [name, url, options];
|
---|
| 112 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 113 | },
|
---|
| 114 |
|
---|
| 115 | CLASS_NAME: "OpenLayers.Layer.OSM.CycleMap"
|
---|
| 116 | });
|
---|
| 117 |
|
---|
| 118 | /**
|
---|
| 119 | * Class: OpenLayers.Layer.OSM.Maplint
|
---|
| 120 | *
|
---|
| 121 | * Inherits from:
|
---|
| 122 | * - <OpenLayers.Layer.OSM>
|
---|
| 123 | */
|
---|
| 124 | OpenLayers.Layer.OSM.Maplint = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 125 | /**
|
---|
| 126 | * Constructor: OpenLayers.Layer.OSM.Maplint
|
---|
| 127 | *
|
---|
| 128 | * Parameters:
|
---|
| 129 | * name - {String}
|
---|
| 130 | * options - {Object} Hashtable of extra options to tag onto the layer
|
---|
| 131 | */
|
---|
| 132 | initialize: function(name, options) {
|
---|
| 133 | var url = [
|
---|
| 134 | "http://d.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
|
---|
| 135 | "http://e.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
|
---|
| 136 | "http://f.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png"
|
---|
| 137 | ];
|
---|
| 138 | options = OpenLayers.Util.extend({ numZoomLevels: 21, isBaseLayer: false, visibility: false }, options);
|
---|
| 139 | var newArguments = [name, url, options];
|
---|
| 140 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 141 | },
|
---|
| 142 |
|
---|
| 143 | CLASS_NAME: "OpenLayers.Layer.OSM.Maplint"
|
---|
| 144 | });
|
---|
| 145 |
|
---|
[9302] | 146 | /**
|
---|
| 147 | * Gheat layer
|
---|
| 148 | */
|
---|
[9139] | 149 | OpenLayers.Layer.OSM.Overlay1 = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 150 | initialize: function(name, options) {
|
---|
| 151 | var url = [
|
---|
| 152 | "/gheat/classic/${z}/${x},${y}.png"
|
---|
| 153 | ];
|
---|
| 154 | options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
|
---|
| 155 | var newArguments = [name, url, options];
|
---|
| 156 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 157 | },
|
---|
[9274] | 158 | colour: "0,0,0",
|
---|
[9271] | 159 | CLASS_NAME: "OpenLayers.Layer.Overlay"
|
---|
[9139] | 160 | });
|
---|
[9147] | 161 |
|
---|
[9302] | 162 | /**
|
---|
| 163 | * All accespoints
|
---|
| 164 | */
|
---|
[9147] | 165 | OpenLayers.Layer.OSM.Overlay2 = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 166 | initialize: function(name, options) {
|
---|
| 167 | var url = [
|
---|
[9373] | 168 | "http://a.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=90,90,90",
|
---|
| 169 | "http://b.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=90,90,90",
|
---|
| 170 | "http://c.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=90,90,90",
|
---|
| 171 | "http://d.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=90,90,90",
|
---|
| 172 | "http://e.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=90,90,90",
|
---|
| 173 | "http://f.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=90,90,90",
|
---|
[9147] | 174 | ];
|
---|
| 175 | options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
|
---|
| 176 | var newArguments = [name, url, options];
|
---|
| 177 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 178 | },
|
---|
[9274] | 179 | colour: "90,90,90",
|
---|
[9271] | 180 | CLASS_NAME: "OpenLayers.Layer.Overlay"
|
---|
[9147] | 181 | });
|
---|
[9166] | 182 |
|
---|
[9302] | 183 | /**
|
---|
| 184 | * Wireless Leiden nodes
|
---|
| 185 | */
|
---|
[9166] | 186 | OpenLayers.Layer.OSM.Overlay3 = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 187 | initialize: function(name, options) {
|
---|
| 188 | var url = [
|
---|
[9373] | 189 | "http://a.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden",
|
---|
| 190 | "http://b.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden",
|
---|
| 191 | "http://c.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden",
|
---|
| 192 | "http://d.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden",
|
---|
| 193 | "http://e.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden",
|
---|
| 194 | "http://f.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden",
|
---|
[9166] | 195 | ];
|
---|
| 196 | options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
|
---|
| 197 | var newArguments = [name, url, options];
|
---|
| 198 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 199 | },
|
---|
[9274] | 200 | colour: "255,0,0",
|
---|
[9271] | 201 | CLASS_NAME: "OpenLayers.Layer.Overlay"
|
---|
[9166] | 202 | });
|
---|
[9275] | 203 |
|
---|
[9302] | 204 | /**
|
---|
| 205 | * Signal strength
|
---|
| 206 | */
|
---|
[9275] | 207 | OpenLayers.Layer.OSM.Overlay4 = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
---|
| 208 | initialize: function(name, options) {
|
---|
| 209 | var url = [
|
---|
[9373] | 210 | "http://a.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=0&signaal__lte=100",
|
---|
| 211 | "http://b.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=0&signaal__lte=100",
|
---|
| 212 | "http://c.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=0&signaal__lte=100",
|
---|
| 213 | "http://d.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=0&signaal__lte=100",
|
---|
| 214 | "http://e.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=0&signaal__lte=100",
|
---|
| 215 | "http://f.maps.wirelessleiden.nl/heatmap/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=0&signaal__lte=100",
|
---|
[9275] | 216 | ];
|
---|
| 217 | options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
|
---|
| 218 | var newArguments = [name, url, options];
|
---|
| 219 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
|
---|
| 220 | },
|
---|
| 221 | colour: "250,250,0",
|
---|
| 222 | CLASS_NAME: "OpenLayers.Layer.Overlay"
|
---|
| 223 | });
|
---|