Online Users Map

Blocks ::: block_online_users_map
Maintained by Alex Little
Similar to the online users block, but this block uses the geographical information from users profiles to display the locations of online users on an OpenStreetMap or Google map. The geocoding of locations are cached in the Moodle database and updated when cron runs.

Online Users Map 2011123000

Moodle 2.0, 2.1, 2.2, 2.3, 2.4
Released: Saturday, April 20, 2013, 10:02 PM
Online Users Map Block

This block is an alternative version of the standard online_users block, but
with users plotted on an OpenStreetMap or Google map - with locations taken
from users Moodle profile.

How to install:
1. Extract the contents of the downloaded zip into the 'blocks' directory
2. Log into your Moodle as an admin
3. Visit the Moodle->Site Administration->Notifications page - you should
see messages about the setting up of the block database tables
4. Go to Moodle->Site Administration->Modules->Blocks->Manage Blocks (this may
vary slightly depending on which version of Moodle you're using) and then
select the block settings for the online_users_map
5. Complete the block settings as necessary. More details about the
block settings below
6. Finally you need to add the block to some courses/homepage - best bet is
probably add it as a sticky block.

This block can either use OpenStreetMap or Google Maps for the map display - this
can be changed in the block admin settings.

The geocoding of users locations is performed as part of the Moodle cron, using free geocoding service. If your server requires a proxy to
access the interent (and so the Geonames service) please check that the proxy
host/port is entered on the Moodle admin pages
(see: http://your-moodle/admin/settings.php?section=http).

The Geonames service should work with the default demo user, but if you are
geocoding a lot of users (so accessing their API often) then you should register
your own account to prevent your Moodle server getting blocked from using the
service. You can sign up for a username (for free) at:

NOTE: the block (with default settings) will only geocode 100 users in any run of
Moodle cron. So if you have a lot of users, cron may need to run multiple times
before all your users are geocoded. Once all users have been geocoded, subsequent
crons should be quicker since only new users and those who have changed their
locations will be geodcoded. Use the 'max locations to update' block admin setting
to configure how many users can be geocoded in one run of cron.

All feedback on this block welcome smile
Alex Little

Version information

Version build number
Version release name
Can be updated from
2011123000 (2012121100)
MD5 Sum
Supported software
Moodle 2.1, Moodle 2.0, PHP 5.3, PHP 5.2, PHP 5.1, PHP 5.4, Moodle 2.2, Moodle 2.3, Moodle 2.4
  • Latest release for Moodle 2.0
  • Latest release for Moodle 2.1
  • Latest release for Moodle 2.2
  • Latest release for Moodle 2.3
  • Latest release for Moodle 2.4

Version control information

Version control system (VCS)
VCS repository URL

Default installation instructions for plugins of the type Blocks

  1. Make sure you have all the required versions.
  2. Download and unpack the block folder.
  3. Place the folder (eg "myblock") in the "blocks" subdirectory.
  4. Visit to complete the installation
  5. Turn editing on in any home or course page.
  6. Add the block to the page
  7. Visit the config link in the block for more options.