Changes between Version 53 and Version 54 of DeveloperGuidelines/GIS


Ignore:
Timestamp:
09/13/15 10:30:37 (6 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/GIS

    v53 v54  
    3030* https://github.com/flavour/eden/blob/master/modules/s3/s3gis.py#L6014
    3131=== Variable Markers ===
    32 Example:
    33 {{{
    34 query = (db.gis_location.deleted == False)
    35 query = query & (db.gis_location.id == db["%s_%s" % (module, resource)].location_id)
    36 locations = 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)
    37 for i in range(0, len(locations)):
    38     locations[i].gis_location.shape = "circle"
    39     locations[i].gis_location.size = locations[i][db["%s_%s" % (module, resource)].MyIntegerField]
    40 }}}
     32There are 3 basic approaches:
     331. Use a style JSON:
     34* https://github.com/flavour/eden/blob/master/modules/templates/IFRC/gis_layer_feature.csv#L6
     35NB This only supports styling based on a single attribute & you need to add that to attr_fields
     36
     372. Use a marker_fn:
     38* https://github.com/flavour/eden/blob/master/modules/templates/NYC/config.py#L302
     39* https://github.com/flavour/eden/blob/master/modules/templates/NYC/config.py#L430
     40This supports whatever lookups you want in Python...you don't pass the attr_field to client but this will pass the marker_url/marker_hight/marker_width in every record which will almost certainly be bulkier
     41
     423. feature_queries
     43These are only supported in custom maps & always get loaded with the page...so cannot be refreshed via AJAX
    4144== Guidelines for Developers wishing to extend the functionality of the core GIS ==
    4245=== !OpenLayers ===