39 lines
1 KiB
Text
39 lines
1 KiB
Text
|
# See: http://wiki.flightgear.org/MapStructure
|
||
|
# Class things:
|
||
|
var name = 'OpenAIP';
|
||
|
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: [],
|
||
|
};
|
||
|
|
||
|
# http://1.tile.maps.openaip.net/geowebcache/service/tms/1.0.0/openaip_basemap@EPSG%3A900913@png/6/30/43.png
|
||
|
layer.makeURL = string.compileTemplate('http://1.tile.maps.openaip.net/geowebcache/service/tms/1.0.0/openaip_basemap@EPSG%3A900913@png/{z}/{x}/{tms_y}.png');
|
||
|
layer.makePath = string.compileTemplate(layer.maps_base ~ '/openaip_basemap/{z}/{x}/{tms_y}.png');
|
||
|
|
||
|
m.addVisibilityListener();
|
||
|
m.addRangeListener();
|
||
|
m.addScreenRangeListener();
|
||
|
return m;
|
||
|
};
|
||
|
|
||
|
var updateLayer = func() {
|
||
|
}
|
||
|
|
||
|
var del = func() {
|
||
|
#print(name~".lcontroller.del()");
|
||
|
foreach (var l; me.listeners)
|
||
|
removelistener(l);
|
||
|
};
|