35 |
|
|
36 |
from Thuban.Model.classification import Classification |
from Thuban.Model.classification import Classification |
37 |
from Thuban.Model.color import Color |
from Thuban.Model.color import Color |
38 |
|
import Thuban.Model.resource |
39 |
|
|
40 |
class MapRenderer: |
class MapRenderer: |
41 |
|
|
79 |
# |
# |
80 |
# This is only a good optimization if there is only one |
# This is only a good optimization if there is only one |
81 |
# raster layer and the image covers the entire window (as |
# raster layer and the image covers the entire window (as |
82 |
# it currently does). |
# it currently does). We note if there is a raster layer |
83 |
|
# and only begin drawing layers once we have drawn it. |
84 |
|
# That way we avoid drawing layers that won't be seen. |
85 |
# |
# |
86 |
for layer in map.Layers(): |
for layer in map.Layers(): |
87 |
if isinstance(layer, RasterLayer): |
if isinstance(layer, RasterLayer) and layer.Visible(): |
88 |
seenRaster = False |
seenRaster = False |
89 |
break |
break |
90 |
|
|
94 |
if not self.honor_visibility or layer.Visible(): |
if not self.honor_visibility or layer.Visible(): |
95 |
if isinstance(layer, Layer) and seenRaster: |
if isinstance(layer, Layer) and seenRaster: |
96 |
self.draw_shape_layer(layer) |
self.draw_shape_layer(layer) |
97 |
elif isinstance(layer, RasterLayer): |
elif isinstance(layer, RasterLayer) \ |
98 |
|
and Thuban.Model.resource.has_gdal_support(): |
99 |
self.draw_raster_layer(layer) |
self.draw_raster_layer(layer) |
100 |
seenRaster = True |
seenRaster = True |
101 |
|
|