Package madrona :: Package staticmap :: Module views
[hide private]

Module views

source code

Functions [hide private]
 
default_style() source code
 
get_features(uids, user)
Returns list of tuples representing mapnik layers Tuple => (model_class, [pks]) Note: currently just a single pk per 'layer' which is incredibly inefficient but the only way to ensure proper layer ordering (??).
source code
 
auto_extent(features, srid=settings.GEOMETRY_CLIENT_SRID)
Given a set of staticmap features, returns the bounding box required to zoom into those features.
source code
 
staticmap_link(request, instances, map_name="default")
Generic link version of the staticmap view
source code
 
show(request, map_name="default") source code
 
draw_map(uids, user, width, height, autozoom=False, bbox=None, show_extent=False, map_name='default')
Display a map with the study region geometry.
source code
Variables [hide private]
  log = get_logger()
  settings_dbname = settings.DATABASE_NAME
Function Details [hide private]

get_features(uids, user)

source code 

Returns list of tuples representing mapnik layers
Tuple => (model_class, [pks])
Note: currently just a single pk per 'layer' which is
incredibly inefficient but the only way to ensure 
proper layer ordering (??).
    features = [ (Mpa, [49, 50]),
                (Pipeline, [32, 31]),
                (Shipwreck, [32, 31])
            ]

auto_extent(features, srid=settings.GEOMETRY_CLIENT_SRID)

source code 

Given a set of staticmap features, returns the bounding box required to zoom into those features. Includes a configurable edge buffer