1 from views import draw_map
2
3 '''
4 Create map image from a parameter dict
5 '''
7 opts = ['uids', 'width', 'height', 'autozoom', 'bbox', 'show_extent']
8
9 class X:
10 pass
11 x = X()
12
13 for opt in opts:
14 try:
15 setattr(x,opt,params[opt])
16 except:
17 setattr(x,opt,False)
18
19 try:
20 x.map_name = params[map_name]
21 except:
22 x.map_name = 'default'
23
24
25
26
27 img = draw_map(x.uids.split(','), user, int(x.width), int(x.height), x.autozoom, x.bbox, x.show_extent, x.map_name)
28 return img
29