Map API
New Map API | |
---|---|
Project state | Proposal/Development in progress |
Tracker issue | MDL-42522 |
Discussion | https://moodle.org/mod/forum/discuss.php?d=245569 |
Assignee | {{{assignee}}} |
Moodle 2.7 This page is for collecting feature requests for a possible new API to enable easy use of geographical maps.
Current status
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.
High-level proposal
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)
- The Leaflet javascript map library as a YUI 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
Plugins
The local and database modules have been formatted into three modules:
- https://moodle.org/plugins/view.php?plugin=local_map - the API.
- https://moodle.org/plugins/view.php?plugin=datafield_latlongmap - a modified latlong field.
- https://moodle.org/plugins/view.php?plugin=datapreset_infomap_latlongmap - a preset using datafield_latlongmap.
Feedback on the plugins (or the Git branch linked in MDL-42522) would be appreciated.
Detailed propsal
TBC