Skip to content

Commit 7d5cc97

Browse files
committed
Add weather data
1 parent a75fa93 commit 7d5cc97

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

index.html

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
}
107107
},
108108
"ustream": function(source) {
109-
console.log(source);
110109
return {
111110
style: {
112111
url: (source.livethumb ? source.livethumb : "img/ustream.jpg"),
@@ -123,8 +122,45 @@
123122
minZoom: 2,
124123
maxZoom: 20
125124
});
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+
126162
var map = new L.Map('map', {
127-
layers: [osm]
163+
layers: [osm, weather]
128164
});
129165
map.attributionControl.setPrefix("");
130166
var overlaps = {};

0 commit comments

Comments
 (0)