1
0
Fork 0
fgdata/Nasal/canvas/map/STAMEN_terrain.lcontroller

41 lines
1 KiB
Text
Raw Normal View History

2017-11-24 23:04:46 +00:00
# See: http://wiki.flightgear.org/MapStructure
# Class things:
var name = 'STAMEN_terrain';
var parents = [OverlayLayer.Controller];
var __self__ = caller(0)[0];
OverlayLayer.Controller.add(name, __self__);
TileLayer.add(name, {
parents: [TileLayer],
type: name, # Layer type
df_controller: __self__, # controller to use by default -- this one
});
var new = func(layer) {
var m = {
parents: [__self__],
layer: layer,
map: layer.map,
listeners: [],
};
layer.makeURL = string.compileTemplate('http://b.tile.stamen.com/terrain-background/{z}/{x}/{y}.png');
layer.makePath = string.compileTemplate(layer.maps_base ~ '/stamen-terrain-background/{z}/{x}/{y}.png');
#layer.makeURL = string.compileTemplate('http://b.tile.stamen.com/toner/{z}/{x}/{y}.png');
#layer.makePath = string.compileTemplate(layer.maps_base ~ '/stamen-toner/{z}/{x}/{y}.png');
m.addVisibilityListener();
m.addRangeListener();
m.addScreenRangeListener();
return m;
};
var updateLayer = func() {
}
var del = func() {
foreach (var l; me.listeners)
removelistener(l);
};