Version 7 (modified by 15 years ago) ( diff ) | ,
---|
GIS API
Developers need to be able to embed maps within their Modules & display Features.
They don't want to have to become GIS experts for this - they just want to be able to call a documented mapping API:
- A function which returns all the HTML needed to insert a map on the page, with the following customizations:
- Be able to define which locations get placed on this map. This might include a number of different types (groups?) of locations. For each type/group we can specify:
- The Marker (default from gis module).
- A function to call to return the size/colour of the marker, based on the location id. (advanced)
- 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)
- Be able to define the default size of the map
- Be able to define which locations get placed on this map. This might include a number of different types (groups?) of locations. For each type/group we can specify:
We can pass information in 3 different ways:
- Argument
- Global variable (e.g. request.s3.gis_*)
- Config in Database
gis.read_config()
Here is the API from the original PHP version:
This is the current API used by the FRP application:
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
The pr/person/presence includes a link to embedding a map within a page:
tbc
Proposed API
Early draft!
Embed a map within a Page
gis.show_map(height=default, width=default, overlays=False)
Display Features on the Map
request.s3.gis_features = [] gis.show_map(height=default, width=default, overlays=False)
Customise Feature Markers based on Thresholds
request.s3.gis_features = [] gis.show_map(height=default, width=default, overlays=False)
Note:
See TracWiki
for help on using the wiki.