1 - I have a table with geometries
2 - I'd like to show a map (olwidget) with some of these geometries
3 - User should be able to select one of these geometries, textarea
fills with geom info
4 - And also have the option for user to draw a new geometry
I can't get #3 to work. Have tried various form configs. Displaying is
not a problem, but when user clicks ona defined geometry, nothing
happens to the textarea. Adding a new geometry is not a problem. Best
effort so far:
class TestForm(forms.Form):
def __init__(self, *args, **kwargs):
super(TestForm, self).__init__(*args, **kwargs)
fields = [
EditableLayerField({'geometry': [ 'point', 'linestring',
'polygon' ], 'name': 'Create new'}),
]
for location in Location.objects.all():
fields.append(InfoLayerField([[location.geom,
location.name]], {'name': location.key}))
self.fields['test'] = MapField(fields, { 'hide_textarea': False })
I don't mind spending a few more hours, but it seems someone must have
done this before. Anyone?
Dylan Verheul
http://dyve.net
-charlie