Changes between Version 50 and Version 51 of DeveloperGuidelines/GIS


Ignore:
Timestamp:
06/06/14 00:10:30 (7 years ago)
Author:
somayjain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/GIS

    v50 v51  
    2929{{{
    3030def show_map( self,
     31              id = "default_map",
    3132              height = None,
    3233              width = None,
     
    3839              add_feature = False,
    3940              add_feature_active = False,
     41              add_line = False,
     42              add_line_active = False,
    4043              add_polygon = False,
    4144              add_polygon_active = False,
    42               features = [],
    43               feature_queries = [],
     45              features = None,
     46              feature_queries = None,
     47              feature_resources = None,
    4448              wms_browser = {},
    4549              catalogue_layers = False,
    46               catalogue_toolbar = False,
    4750              legend = False,
    4851              toolbar = False,
     52              area = False,
     53              nav = None,
     54              save = False,
    4955              search = False,
    50               googleEarth = False,
    51               googleStreetview = False,
    52               mouse_position = "normal",
    53               print_tool = {},
     56              mouse_position = None,
     57              overview = None,
     58              permalink = None,
     59              scaleline = None,
     60              zoomcontrol = None,
     61              zoomWheelEnabled = True,
    5462              mgrs = {},
    5563              window = False,
    5664              window_hide = False,
    5765              closable = True,
     66              maximizable = True,
    5867              collapsed = False,
    59               plugins = None
    60             ):
     68              callback = "DEFAULT",
     69              plugins = None,
     70              ):
    6171    """
    6272        Returns the HTML to display a map
     
    6575        In the view, put: {{=XML(map)}}
    6676
    67         @param height: Height of viewport (if not provided then the default setting from the Map Service Catalogue is used)
    68         @param width: Width of viewport (if not provided then the default setting from the Map Service Catalogue is used)
     77        @param id: ID to uniquely identify this map if there are several on a page
     78        @param height: Height of viewport (if not provided then the default deployment setting is used)
     79        @param width: Width of viewport (if not provided then the default deployment setting is used)
    6980        @param bbox: default Bounding Box of viewport (if not provided then the Lat/Lon/Zoom are used) (Dict):
    70             {
    71             "max_lat" : float,
    72             "max_lon" : float,
    73             "min_lat" : float,
    74             "min_lon" : float
    75             }
     81            {"lon_min" : float,
     82             "lat_min" : float,
     83             "lon_max" : float,
     84             "lat_max" : float,
     85             }
    7686        @param lat: default Latitude of viewport (if not provided then the default setting from the Map Service Catalogue is used)
    7787        @param lon: default Longitude of viewport (if not provided then the default setting from the Map Service Catalogue is used)
     
    8393        @param add_polygon_active: Whether the DrawFeature control should be active by default
    8494        @param features: Simple Features to overlay on Map (no control over appearance & not interactive)
    85             [{
    86                 lat: lat,
    87                 lon: lon
     95            [wkt]
     96        @param feature_queries: Feature Queries to overlay onto the map & their options (List of Dicts):
     97            [{"name"   : T("MyLabel"), # A string: the label for the layer
     98              "query"  : query,        # A gluon.sql.Rows of gis_locations, which can be from a simple query or a Join.
     99                                       # Extra fields can be added for 'popup_url', 'popup_label' & either
     100                                       # 'marker' (url/height/width) or 'shape' (with optional 'colour' & 'size')
     101              "active" : True,         # Is the feed displayed upon load or needs ticking to load afterwards?
     102              "marker" : None,         # Optional: A per-Layer marker query or marker_id for the icon used to display the feature
     103              "opacity" : 1,           # Optional
     104              "cluster_attribute",     # Optional
     105              "cluster_distance",      # Optional
     106              "cluster_threshold"      # Optional
    88107            }]
    89         @param feature_queries: Feature Queries to overlay onto the map & their options (List of Dicts):
    90             [{
    91              name   : "MyLabel",    # A string: the label for the layer
    92              query  : query,        # A gluon.sql.Rows of gis_locations, which can be from a simple query or a Join.
    93                                     # Extra fields can be added for 'popup_url', 'popup_label' & either
    94                                     # 'marker' (url/height/width) or 'shape' (with optional 'colour' & 'size')
    95              active : True,         # Is the feed displayed upon load or needs ticking to load afterwards?
    96              marker : None          # Optional: A per-Layer marker query or marker_id for the icon used to display the feature
    97              opacity : 1            # Optional
    98              cluster_distance       # Optional
    99              cluster_threshold      # Optional
     108        @param feature_resources: REST URLs for (filtered) resources to overlay onto the map & their options (List of Dicts):
     109            [{"name"      : T("MyLabel"), # A string: the label for the layer
     110              "id"        : "search",     # A string: the id for the layer (for manipulation by JavaScript)
     111              "active"    : True,         # Is the feed displayed upon load or needs ticking to load afterwards?
     112              EITHER:
     113              "layer_id"  : 1,            # An integer: the layer_id to load (optional alternative to specifying URL/tablename/marker)
     114              "filter"    : "filter",     # A string: an optional URL filter which *replaces* any in the layer
     115              OR:
     116              "tablename" : "module_resource", # A string: the tablename (used to determine whether to locate via location_id or site_id)
     117              "url"       : "/eden/module/resource.geojson?filter", # A URL to load the resource
     118
     119              "marker"    : None,         # Optional: A per-Layer marker dict for the icon used to display the feature (overrides layer_id if-set)
     120              "opacity"   : 1,            # Optional (overrides layer_id if-set)
     121              "cluster_attribute",        # Optional (overrides layer_id if-set)
     122              "cluster_distance",         # Optional (overrides layer_id if-set)
     123              "cluster_threshold",        # Optional (overrides layer_id if-set)
     124              "dir",                      # Optional (overrides layer_id if-set)
     125              "style",                    # Optional (overrides layer_id if-set)
    100126            }]
    101127        @param wms_browser: WMS Server's GetCapabilities & options (dict)
    102             {
    103             name: string,           # Name for the Folder in LayerTree
    104             url: string             # URL of GetCapabilities
     128            {"name": T("MyLabel"),     # Name for the Folder in LayerTree
     129             "url": string             # URL of GetCapabilities
    105130            }
    106         @param catalogue_overlays: Show the Overlays from the GIS Catalogue (@ToDo: make this a dict of which external overlays to allow)
    107         @param catalogue_toolbar: Show the Catalogue Toolbar
    108         @param legend: Show the Legend panel
     131        @param catalogue_layers: Show all the enabled Layers from the GIS Catalogue
     132                                 Defaults to False: Just show the default Base layer
     133        @param legend: True: Show the GeoExt Legend panel, False: No Panel, "floating": New floating Legend Panel
    109134        @param toolbar: Show the Icon Toolbar of Controls
    110         @param search: Show the Geonames search box
    111         @param mouse_position: Show the current coordinates in the bottom-right of the map. 3 Options: 'normal' (default), 'mgrs' (MGRS), False (off)
    112         @param print_tool: Show a print utility (NB This requires server-side support: http://eden.sahanafoundation.org/wiki/BluePrintGISPrinting)
    113             {
    114             url: string,            # URL of print service (e.g. http://localhost:8080/geoserver/pdf/)
    115             mapTitle: string        # Title for the Printed Map (optional)
    116             subTitle: string        # subTitle for the Printed Map (optional)
     135        @param area: Show the Area tool on the Toolbar
     136        @param nav: Show the Navigation controls on the Toolbar
     137        @param save: Show the Save tool on the Toolbar
     138        @param search: Show the Geonames search box (requires a username to be configured)
     139        @param mouse_position: Show the current coordinates in the bottom-right of the map. 3 Options: 'normal', 'mgrs', False (defaults to checking deployment_settings, which defaults to 'normal')
     140        @param overview: Show the Overview Map (defaults to checking deployment_settings, which defaults to True)
     141        @param permalink: Show the Permalink control (defaults to checking deployment_settings, which defaults to True)
     142        @param scaleline: Show the ScaleLine control (defaults to checking deployment_settings, which defaults to True)
     143        @param zoomcontrol: Show the Zoom control (defaults to checking deployment_settings, which defaults to True)
     144        @param mgrs: Use the MGRS Control to select PDFs
     145            {"name": string,           # Name for the Control
     146             "url": string             # URL of PDF server
    117147            }
    118         @param mgrs: Use the MGRS Control to select PDFs
    119             {
    120             name: string,           # Name for the Control
    121             url: string             # URL of PDF server
    122             }
     148            @ToDo: Also add MGRS Search support: http://gxp.opengeo.org/master/examples/mgrs.html
    123149        @param window: Have viewport pop out of page into a resizable window
    124150        @param window_hide: Have the window hidden by default, ready to appear (e.g. on clicking a button)
    125151        @param closable: In Window mode, whether the window is closable or not
    126152        @param collapsed: Start the Tools panel (West region) collapsed
    127         @param public_url: pass from model (not yet defined when Module instantiated
     153        @param callback: Code to run once the Map JavaScript has loaded
     154        @param plugins: an iterable of objects which support the following methods:
     155                            .extend_gis_map(map)
     156                        Client-side portion suppoprts the following methods:
     157                            .addToMapWindow(items)
     158                            .setup(map)
    128159    """
    129160}}}