|
106 | 106 | } |
107 | 107 | }, |
108 | 108 | "ustream": function(source) { |
109 | | - console.log(source); |
110 | 109 | return { |
111 | 110 | style: { |
112 | 111 | url: (source.livethumb ? source.livethumb : "img/ustream.jpg"), |
|
123 | 122 | minZoom: 2, |
124 | 123 | maxZoom: 20 |
125 | 124 | }); |
| 125 | + |
| 126 | +var weather = new L.TileLayer("http://openweathermap.org/t/tile.cgi/1.0.0/GLBETA_PR/{z}/{x}/{y}.png", { |
| 127 | + attribution: "<a href='http://openweathermap.org'>Weather data by OpenWeatherMap.org</a>", |
| 128 | + opacity: 0.2 |
| 129 | +}) |
| 130 | + |
| 131 | +//var WeatherLayer = L.TileLayer.WMS.extend({ |
| 132 | +// getTileUrl: function(tilePoint, zoom) { |
| 133 | +// if (zoom > 5) { |
| 134 | +// return null; |
| 135 | +// } |
| 136 | +// var map = this._map, |
| 137 | +// crs = map.options.crs, |
| 138 | +// tileSize = this.options.tileSize, |
| 139 | +// |
| 140 | +// nwPoint = tilePoint.multiplyBy(tileSize), |
| 141 | +// sePoint = nwPoint.add(new L.Point(tileSize, tileSize)), |
| 142 | +// |
| 143 | +// nw = crs.project(map.unproject(nwPoint, zoom)), |
| 144 | +// se = crs.project(map.unproject(sePoint, zoom)), |
| 145 | +// |
| 146 | +// |
| 147 | +// bbox = [nw.x, se.y, se.x, nw.y].join(','); |
| 148 | +// return "http://openweathermap.org/t/t?url=SERVICE=WMS%26REQUEST=GetMap%26FORMAT=image%2Fpng%26TRANSPARENT=true%26VERSION=1.1.1%26SRS=EPSG%3A900913%26HEIGHT=256%26WIDTH=256%26LAYERS=GLBETA_UV%26BBOX=" + bbox; |
| 149 | +// } |
| 150 | +//}); |
| 151 | +// |
| 152 | +// |
| 153 | +//var weather = new WeatherLayer("http://openweathermap.org/t/t?url=", { |
| 154 | +// LAYERS: "GLBETA_UV", |
| 155 | +// opacity: 0.3, |
| 156 | +// maxZoom: 5, |
| 157 | +// minZoom: 1, |
| 158 | +// noWrap: true |
| 159 | +//}) |
| 160 | + |
| 161 | + |
126 | 162 | var map = new L.Map('map', { |
127 | | - layers: [osm] |
| 163 | + layers: [osm, weather] |
128 | 164 | }); |
129 | 165 | map.attributionControl.setPrefix(""); |
130 | 166 | var overlaps = {}; |
|
0 commit comments