Save the base layer on model

6 views
Skip to first unread message

Mario8k

unread,
Jun 8, 2012, 12:05:02 PM6/8/12
to olwidget
Hi,
if i use in the admin, GeoModelAdmin class. There is a way to obtain
the base layer and store it in a baselayer field of the model?

Supose in admin class i put:

class MyAdmin(GeoModelAdmin):

options = {
'layers': ['osm.mapnik','google.streets'],
}

Then, i want to store the value of the layer choosed (with the layer
switcher control), in my model class. This is for use later, when I'm
editing, to remember the previous selection.

class MyModel(models.Model):
circuit = models.LineStringField()
baselayer = models.CharField()

How can i achieve this? any idea? Thanks.
Reply all
Reply to author
Forward
0 new messages