1 |
# Copyright (c) 2001 by Intevation GmbH |
# Copyright (c) 2001, 2002 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
4 |
# |
# |
102 |
""" |
""" |
103 |
|
|
104 |
def __init__(self, title, filename, projection = None, |
def __init__(self, title, filename, projection = None, |
105 |
fill = None, stroke = _black, visible = 1): |
fill = None, stroke = _black, stroke_width = 1, visible = 1): |
106 |
"""Initialize the layer. |
"""Initialize the layer. |
107 |
|
|
108 |
title -- the title |
title -- the title |
121 |
self.projection = projection |
self.projection = projection |
122 |
self.fill = fill |
self.fill = fill |
123 |
self.stroke = stroke |
self.stroke = stroke |
124 |
|
self.stroke_width = stroke_width |
125 |
self.shapefile = None |
self.shapefile = None |
126 |
self.open_shapefile() |
self.open_shapefile() |
127 |
# shapetable is the table associated with the shapefile, while |
# shapetable is the table associated with the shapefile, while |
175 |
poly = shape.vertices()[0] |
poly = shape.vertices()[0] |
176 |
points = [] |
points = [] |
177 |
for x, y in poly: |
for x, y in poly: |
178 |
points.append(x, y) |
points.append((x, y)) |
179 |
return Shape(points) |
return Shape(points) |
180 |
|
|
181 |
def SetProjection(self, projection): |
def SetProjection(self, projection): |
193 |
stroked.""" |
stroked.""" |
194 |
self.stroke = stroke |
self.stroke = stroke |
195 |
self.changed(LAYER_LEGEND_CHANGED, self) |
self.changed(LAYER_LEGEND_CHANGED, self) |
196 |
|
|
197 |
|
def SetStrokeWidth(self, width): |
198 |
|
"""Set the layer's stroke width.""" |
199 |
|
self.stroke_width = width |
200 |
|
self.changed(LAYER_LEGEND_CHANGED, self) |