Changes between Version 27 and Version 28 of DeveloperGuidelines/GIS


Ignore:
Timestamp:
08/21/10 16:06:09 (14 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/GIS

    v27 v28  
    3030              zoom = None,
    3131              projection = None,
     32              add_feature = False,
     33              add_feature_active = False,
    3234              feature_queries = [],
    3335              feature_groups = [],
     
    5860    @param zoom: default Zoom level of viewport (if not provided then the default setting from the Map Service Catalogue is used)
    5961    @param projection: EPSG code for the Projection to use (if not provided then the default setting from the Map Service Catalogue is used)
     62    @param add_feature: Whether to include a DrawFeature control to allow adding a marker to the map
     63    @param add_feature_active: Whether the DrawFeature control should be active by default
    6064    @param feature_queries: Feature Queries to overlay onto the map & their options (List of Dicts):
    61                 [{
    62                  name   : "Query",      # A string: the label for the layer
    63                  query  : query,        # A gluon.sql.Rows of gis_locations
    64                  active : False,        # Is the feed displayed upon load or needs ticking to load afterwards?
    65                  popup_url : None,      # The URL which will be used to fill the pop-up. it will be appended by the Location ID.
    66                  marker : None          # The marker_id for the icon used to display the feature (over-riding the normal process).
    67                                         # [Plan: Can be a lambda to vary icon (size/colour) based on attribute levels.]
    68                 }]
    69             @param feature_groups: Feature Groups to overlay onto the map & their options (List of Dicts):
    70                 [{
    71                  feature_group : db.gis_feature_group.name,
    72                  parent : None,         # Only display features with this parent set. ToDo: search recursively to allow all descendants
    73                  filter : None,         # A query to further limit which features from the feature group are loaded
    74                  active : False,        # Is the feed displayed upon load or needs ticking to load afterwards?
    75                  popup_url : None,      # The URL which will be used to fill the pop-up. it will be appended by the Location ID.
    76                  marker : None          # The marker_id for the icon used to display the feature (over-riding the normal process).
    77                                         # [Plan: Can be a lambda to vary icon (size/colour) based on attribute levels.]
    78                 }]
     65        [{
     66         name   : "Query",      # A string: the label for the layer
     67         query  : query,        #A gluon.sql.Rows of gis_locations, which can be from a simple query or a Join. Extra fields can be added for 'marker' or 'shape' (with optional 'color' & 'size')
     68         active : False,        # Is the feed displayed upon load or needs ticking to load afterwards?
     69         popup_url : None,      # The URL which will be used to fill the pop-up. it will be appended by the Location ID.
     70         marker : None          # The marker_id for the icon used to display the feature (over-riding the normal process).
     71         }]
     72    @param feature_groups: Feature Groups to overlay onto the map & their options (List of Dicts):
     73        [{
     74         feature_group : db.gis_feature_group.name,
     75         parent : None,         # Only display features with this parent set. ToDo: search recursively to allow all descendants
     76         filter : None,         # A query to further limit which features from the feature group are loaded
     77         active : False,        # Is the feed displayed upon load or needs ticking to load afterwards?
     78         popup_url : None,      # The URL which will be used to fill the pop-up. it will be appended by the Location ID.
     79         marker : None          # The marker_id for the icon used to display the feature (over-riding the normal process).
     80         }]
    7981    @param wms_browser: WMS Server's GetCapabilities & options (dict)
    8082        {
     
    102104    @param public_url: pass from model (not yet defined when Module instantiated
    103105    """
     106}}}
     107
     108=== Variable Markers ===
     109Example:
     110{{{
     111query = (db.gis_location.deleted == False)
     112query = query & (db.gis_location.id == db["%s_%s" % (module, resource)].location_id)
     113locations = db(query).select(db.gis_location.id, db.gis_location.uuid, db.gis_location.name, db.gis_location.wkt, db.gis_location.lat, db.gis_location.lon)
     114for i in range(0, len(locations)):
     115    locations[i].gis_location.shape = "circle"
     116    locations[i].gis_location.size = locations[i][db["%s_%s" % (module, resource)].MyIntegerField]
    104117}}}
    105118== Guidelines for Developers wishing to extend the functionality of the core GIS ==