Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-42522

A geographical map API in core

    XMLWordPrintable

    Details

      Description

      Currently Moodle has a map feature for IP address lookup (under /iplookup), but there are additional places that maps could be useful, so having shared map functions would be a good idea:

      • Contrib plugins already exist for showing online users on a map [0], searching for places specified by a CSV upload [1], but they use their own map code.
      • I'm developing a Database activity enhancement to display LatLong fields on maps [2].
      • I don't know if it's important, but MDLSITE-2478 could use a shared map. I imagine others could think of some interesting ways of using it as well.

      I've a proof of concept up at [3].

      At this point I'm wondering whether MoodleHQ would accepted something like this into core, so it's available for iplookup, my Database patches (or a new field), and any other plugins.

      Key components:

      • Make the Leaflet javascript map library [4] available as a YUI module.†
      • Use OSM maps
      • Ammend core settings (replacing/augmenting googlemapkey3):
        • enable/disable JS maps
      • Helper functions to add maps to pages, and plot markers/vectors/popups on them.
      • Maps for inputting geo data
      • Provide a non-javascript fallback (like iplookup)

      † 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.

      Possible future features:

      • Add/ammend core settings to:
        • Choose map provider (e.g. OSM, Google, Cloudmade, etc.)
      • Geocoding
      • Reverse geocoding

      What's the best way for me to proceed?

      [0] https://moodle.org/plugins/view.php?plugin=block_online_users_map
      [1] https://moodle.org/plugins/view.php?plugin=block_simple_map
      [2] https://moodle.org/mod/forum/discuss.php?d=241006
      [3] http://dbtest.conted.ox.ac.uk/moodlemaps/
      [4] http://leafletjs.com/

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                7 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated: