Changes between Version 2 and Version 3 of DeveloperGuidelines/GIS


Ignore:
Timestamp:
12/29/08 02:35:58 (13 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/GIS

    v2 v3  
    44
    55== How to add a new Layer type ==
     6
     7=== Model ===
    68Add to {{{models/_gis.py}}}
    79{{{
     
    1618}}}
    1719
     20=== Controller ===
     21{{{controllers/gis.py}}}
     22{{{
     23def map_service_catalogue():
     24    form=FORM(
     25        INPUT(_name="field"), # Could also be a SELECT
     26    )
     27    if form.accepts(request.vars,session,keepvalues=True):
     28        elif type_new=="newlayertype":
     29            db['gis_layer_%s' % type_new].insert(
     30                layer=id,
     31                field=form.vars.field
     32            )
     33}}}
     34If loading custom JS files when a certain Layer type is active:
     35{{{
     36def map_viewing_client():
     37}}}
     38=== View ===
     39{{{views/map_service_catalogue.html}}}
     40{{{
     41<tr><td><label>{{=T("field_label")}}</label></td>
     42<td><input name="field" type="text" value="" />
     43{{if form.errors.field:}}<div class="error">{{=form.errors.field}}</div>{{pass}}</td></tr>
     44}}}
     45{{{views/map_viewing_client.html}}}
     46
     47
    1848----
    1949DeveloperGuidelines