2017-09-28 14:38:03 +00:00
|
|
|
# See: http://wiki.flightgear.org/MapStructure
|
|
|
|
# Class things:
|
|
|
|
var name = 'OSM';
|
|
|
|
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('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png');
|
|
|
|
layer.makePath = string.compileTemplate(layer.maps_base ~ '/osm-intl/{z}/{x}/{y}.png');
|
|
|
|
|
2017-10-02 19:25:11 +00:00
|
|
|
layer.max_zoom = 18;
|
|
|
|
layer.min_zoom = 1;
|
|
|
|
|
2017-09-28 14:38:03 +00:00
|
|
|
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);
|
|
|
|
};
|