|New Map API|
|Project state||Proposal/Development in progress|
Moodle 2.7 This page is for collecting feature requests for a possible new API to enable easy use of geographical maps.
Moodle + contrib has three separate map implementations:
- The built-in map in the IP address lookup (under /iplookup)
- block_online_users_map is a contrib module that shows recent users plotted on a world map.
- block_simple_map is a contrib module that allows users to search for places specified by a CSV upload
- Additionally, the Database activity has a latlong field, which outputs as links to external mapping services.
A core module to provide an easy way to add maps and mapping features:
- Display a map with specified size, location, zoom, and tileset.
- Display one or more markers on the map.
- Display popups (or other display methods) with additional information when a user clicks on markers.
- Geocoding (i.e. find lat/long from location name - should adopt existing iplookup solution).
- Input of locations by clicking on the map.
- Reverse geocoding (i.e. find location name from lat/long).
Existing work (2013-12-10)
An alpha level implementation is done, including all proposed features except integration of the existing geocoding system.
Map API (local module)
- A PHP class to easily: Add maps, display markers and popups, input locations, perform reverse geocoding.
Demonstration at: http://dbtest.conted.ox.ac.uk/moodlemaps/local/map
† There are other map libs, e.g.:
- OpenLayers - older, larger, with more features than I think we need here.
- Modest Maps - fairly minimal, with fewer
- Polymap - looks interesting for data mapping, but not sure how useful that would be in Moodle.
...however, I'm most familiar with Leaflet and feel it hits the right features/weight balance (e.g. includes geoJSON, but avoids complications with projections), so think it's the right place to start.
Database activity submodules
- A modification/fork of the latlong field to enable maps for display and input
- A new preset (named "Infomap") to utilise the modified latlong field.
Demonstration at: http://dbtest.conted.ox.ac.uk/moodlemaps/course/view.php?id=2
The local and database modules have been formatted into three modules, awaiting approval:
- local_map - the API.
- datafield_latlongmap - a modified latlong field.
- datapreset_infomap_latlongmap - a preset using datafield_latlongmap.