Changes between Version 7 and Version 8 of BluePrintGISAPI


Ignore:
Timestamp:
04/26/10 08:01:24 (12 years ago)
Author:
Michael Howden
Comment:

API function extended

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintGISAPI

    v7 v8  
    1111   * A form which get displayed as the pop-up for the markers (along with the location_id as a arg/var, so can customize the display)
    1212  * Be able to define the default size of the map
     13 * It would be good to be able to pass additional layers (or turn current layers off) to the map via JS, so that the map can be controlled dynamically using external controls. Although this probably represents a great deal of complexity and may need to be reconsidered.
    1314
    1415We can pass information in 3 different ways:
    1516 1. Argument
    16  2. Global variable (e.g. request.s3.gis_*)
    17  3. Config in Database
     17 2. Global variable (e.g. request.s3.gis_*) <- Not Advised
     18 3. Config in Database <- Not efficient
    1819  * {{{gis.read_config()}}}
    1920
     
    2324This is the current API used by the FRP application:
    2425{{{
    25 http://127.0.0.1:8000/frp/gis/map_viewing_client?kml_name=Programmes&kml_feed=http://127.0.0.1:8000/frp/or/programme/report.kml?from=2010-04-23&until=2010-04-23&mode=programme
     26http://127.0.0.1:8000/frp/gis/map_viewing_client?
     27    kml_name=Programmes&
     28    kml_feed=http://127.0.0.1:8000/frp/or/programme/report.kml?
     29        from=2010-04-23&
     30        until=2010-04-23&
     31        mode=programme
    2632}}}
    2733
     
    3339==== Embed a map within a Page ====
    3440{{{
    35     gis.show_map(height=default, width=default, overlays=False)
     41    gis.show_map(height=<default>,
     42                 width=<default>,
     43                 base_layer=<default>,
     44                 internal_layers=None,
     45                 internal_layer_menu = True,
     46                 markers=<default>,
     47                 popup_url = <default>,
     48                 external_layers=None,
     49                 external_layer_menu = True,
     50                 map_center_lat = <default>,
     51                 map_center_long = <default>,
     52                 zoom = <default>
     53)
     54    """
     55    height - int - height of map in pixels
     56    width - int - width of map in pixels
     57    base_layer - string - base layer used for map: "OSM", "Google", "Bing"
     58    internal_layers - list of strings - db.gis_feature_group.name to display on the map
     59    internal_layer_menu - bool - whether or not to display the menu to turn on and off the internal_layers
     60    markers - list of URLs - to images to display
     61    popup_url - list of strings - The URL which will be used to fill the pop-up (potentially different for each internal_layer) (???current term). it will be appended by the Location ID.
     62    external_layers - list of strings - List of the WMS(???) to display on the map
     63    external_layer_menu - bool - whether or not to display the menu to turn on and off the internal_layers
     64    map_center_lat -  ??? - Initial map center point
     65    map_center_long - ??? - Initial map center point
     66    zoom - int - the initial zoom level of the map
     67
     68    Will return the HTML to embed a map with the specified options.
     69    it would be cool it the layer  menus could be tabs on the side, which slide out when you click on them...
     70   
     71    Questions:
     72    * I wonder if internal_layers and markers and popup_url should be joined together in a dictionary.
     73    * I wonder if we need another array to differentiate between int/ext layers which are a) initially displayed on the map AND b) shown on the menu (but not selected)
     74    * I am not entirely sure how the gis_feature_group will work. Perhaps it would be good to be able to pass a query to the function (one of the results of the query will be a location_id field). That would be really nice.
     75
     76    Given all of these, I wonder if it would be best to pass a list of:
     77    internal_layer_options = {gis_feature_group_name,
     78                              query, #if query = None, use gis_feature_group_name
     79                              marker,
     80                              default #if the layer defaults on, or just appears on the menu.
     81                              }
     82    """
    3683}}}
    3784==== Display Features on the Map ====