/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/map.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/map.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 931 by jonathan, Tue May 20 15:23:18 2003 UTC revision 1388 by jonathan, Thu Jul 10 14:53:15 2003 UTC
# Line 60  class Map(TitledObject, Modifiable): Line 60  class Map(TitledObject, Modifiable):
60          self.label_layer.Destroy()          self.label_layer.Destroy()
61    
62      def AddLayer(self, layer):      def AddLayer(self, layer):
63          """Append layer to the map on top opf all."""          """Append layer to the map on top of all."""
64          self.layers.append(layer)          self.layers.append(layer)
65          self.subscribe_layer_channels(layer)          self.subscribe_layer_channels(layer)
66          self.changed(MAP_LAYERS_CHANGED, self)          self.changed(MAP_LAYERS_CHANGED, self)
# Line 117  class Map(TitledObject, Modifiable): Line 117  class Map(TitledObject, Modifiable):
117          """Return true if the map has at least one shape layer"""          """Return true if the map has at least one shape layer"""
118          return len(self.layers) > 0          return len(self.layers) > 0
119    
120        def MoveLayerToTop(self, layer):
121            """Put the layer on top of the layer stack.
122    
123            If the layer is already at the top do nothing. If the stacking
124            order has been changed, issue a MAP_LAYERS_CHANGED message.
125            """
126            index = self.layers.index(layer)
127            if index < len(self.layers) - 1:
128                del self.layers[index]
129                self.layers.append(layer)
130                self.changed(MAP_LAYERS_CHANGED, self)
131                self.changed(MAP_STACKING_CHANGED, self)
132    
133            
134      def RaiseLayer(self, layer):      def RaiseLayer(self, layer):
135          """Swap the layer with the one above it.          """Swap the layer with the one above it.
136    
# Line 143  class Map(TitledObject, Modifiable): Line 157  class Map(TitledObject, Modifiable):
157              self.changed(MAP_LAYERS_CHANGED, self)              self.changed(MAP_LAYERS_CHANGED, self)
158              self.changed(MAP_STACKING_CHANGED, self)              self.changed(MAP_STACKING_CHANGED, self)
159    
160        def MoveLayerToBottom(self, layer):
161            """Put the layer at the bottom of the stack.
162    
163            If the layer is already at the bottom do nothing. If the
164            stacking order has been changed, issue a MAP_LAYERS_CHANGED message.
165            """
166            index = self.layers.index(layer)
167            if index > 0:
168                del self.layers[index]
169                self.layers.insert(0, layer)
170                self.changed(MAP_LAYERS_CHANGED, self)
171                self.changed(MAP_STACKING_CHANGED, self)
172    
173      def BoundingBox(self):      def BoundingBox(self):
174          """Return the bounding box of the map in Lat/Lon coordinates.          """Return the bounding box of the map in Lat/Lon coordinates.
175    
# Line 191  class Map(TitledObject, Modifiable): Line 218  class Map(TitledObject, Modifiable):
218          """Set the projection of the map.          """Set the projection of the map.
219    
220          Issue a MAP_PROJECTION_CHANGED message."""          Issue a MAP_PROJECTION_CHANGED message."""
221            old_proj = self.projection
222          self.projection = projection          self.projection = projection
223          self.changed(MAP_PROJECTION_CHANGED, self)          self.changed(MAP_PROJECTION_CHANGED, self, old_proj)
224    
225      def forward(self, *args):      def forward(self, *args):
226          """Reissue events"""          """Reissue events"""

Legend:
Removed from v.931  
changed lines
  Added in v.1388

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26