249 |
filename = dlg.GetPath() |
filename = dlg.GetPath() |
250 |
title = os.path.splitext(os.path.basename(filename))[0] |
title = os.path.splitext(os.path.basename(filename))[0] |
251 |
layer = Layer(title, filename) |
layer = Layer(title, filename) |
252 |
self.canvas.Map().AddLayer(layer) |
map = self.canvas.Map() |
253 |
|
has_layers = map.HasLayers() |
254 |
|
map.AddLayer(layer) |
255 |
|
if not has_layers: |
256 |
|
# if we're adding a layer to an empty map, for the new |
257 |
|
# map to the window |
258 |
|
self.canvas.FitMapToWindow() |
259 |
dlg.Destroy() |
dlg.Destroy() |
260 |
|
|
261 |
def RemoveLayer(self): |
def RemoveLayer(self): |