11 |
CHANGED, LAYER_PROJECTION_CHANGED, LAYER_LEGEND_CHANGED, \ |
CHANGED, LAYER_PROJECTION_CHANGED, LAYER_LEGEND_CHANGED, \ |
12 |
LAYER_VISIBILITY_CHANGED |
LAYER_VISIBILITY_CHANGED |
13 |
|
|
14 |
|
from Thuban import _ |
15 |
|
|
16 |
from base import TitledObject, Modifiable |
from base import TitledObject, Modifiable |
17 |
|
|
18 |
from label import LabelLayer |
from label import LabelLayer |
34 |
Parameter: the map |
Parameter: the map |
35 |
""" |
""" |
36 |
|
|
37 |
forwarded_channels = (LAYER_PROJECTION_CHANGED, |
forwarded_channels = (CHANGED, |
38 |
|
LAYER_PROJECTION_CHANGED, |
39 |
LAYER_LEGEND_CHANGED, |
LAYER_LEGEND_CHANGED, |
40 |
LAYER_VISIBILITY_CHANGED) |
LAYER_VISIBILITY_CHANGED) |
41 |
|
|
42 |
def __init__(self, title, projection = None): |
def __init__(self, title, projection = None): |
43 |
"""Initialize the map.""" |
"""Initialize the map.""" |
44 |
TitledObject.__init__(self, title) |
TitledObject.__init__(self, title) |
45 |
|
Modifiable.__init__(self) |
46 |
self.layers = [] |
self.layers = [] |
47 |
self.label_layer = LabelLayer("Labels") |
self.label_layer = LabelLayer(_("Labels")) |
48 |
self.label_layer.Subscribe(CHANGED, self.forward, LAYERS_CHANGED) |
self.label_layer.Subscribe(CHANGED, self.forward, LAYERS_CHANGED) |
49 |
self.projection = projection |
self.projection = projection |
50 |
|
|
211 |
def TreeInfo(self): |
def TreeInfo(self): |
212 |
items = [] |
items = [] |
213 |
if self.BoundingBox() != None: |
if self.BoundingBox() != None: |
214 |
items.append("Extent (lat-lon): (%g, %g, %g, %g)" |
items.append(_("Extent (lat-lon): (%g, %g, %g, %g)") |
215 |
% self.BoundingBox()) |
% self.BoundingBox()) |
216 |
if self.projection and len(self.projection.params) > 0: |
if self.projection and len(self.projection.params) > 0: |
217 |
items.append("Extent (projected): (%g, %g, %g, %g)" |
items.append(_("Extent (projected): (%g, %g, %g, %g)") |
218 |
% self.ProjectedBoundingBox()) |
% self.ProjectedBoundingBox()) |
219 |
items.append(("Projection", |
items.append((_("Projection"), |
220 |
[str(param) |
[str(param) |
221 |
for param in self.projection.params])) |
for param in self.projection.params])) |
222 |
|
|
224 |
layers.reverse() |
layers.reverse() |
225 |
items.extend(layers) |
items.extend(layers) |
226 |
|
|
227 |
return ("Map: %s" % self.title, items) |
return (_("Map: %s") % self.title, items) |
228 |
|
|