Categories

MSG Map Widget

The MSG Map Widget allows you to display an MSG presence map on your own webpage, as demonstrated below (no longer available)

All you need to embed this on your own page is to paste the following code in where you’d like the map to appear:

<script src="http://msg.open.ac.uk/msg/widget/msgmapwidget.jsp?
host=msg-openlearn.open.ac.uk&height=350&width=500&zoom=2&lat=40&lng=0
&filter=&refresh=300&view=all&filterControl=true">
</script>

By changing the parameters passed you can change:

  • MSG server to connect to
  • height and width of the map
  • initial zoom level and map centre coordinates
  • filter - and whether or not the map should be filtered at all
  • show either all users, or just online users
  • how often the data should be refreshed (if at all)
  • visibility of the filter control box

Here is on overview of the parameters and their defaults:

  • host: the MSG server to connect to, valid values are: ‘msg.open.ac.uk’ or ‘msg-openlearn.open.ac.uk’, default: ‘msg.open.ac.uk’.
  • height: height of the window to be displayed (in pixels), default: 100.
  • width: width of the window to be displayed (in pixels), default: 100.
  • zoom: initial zoom level, default: 0.
  • lat: initial latitude coordinate, default: 0.
  • lng: initial longitude coordinate, default: 0.
  • filter: initial filter text, default: null. If no filter is specified, only online users will be shown. This filters based on the group name and description (for the OpenLearn site - this is equivalent to the course code and title).
  • refresh: refresh rate (in seconds) of the map markers, default: 0. The minimum refresh rate is 60 seconds, if you specify less, it will be set to 60. If the refresh rate is set to 0, then the markers are not refreshed.
  • view: whether to view all or just online users, valid values are ‘online’ or ‘all’, default: ‘online’.
  • filterControl: whether to display the filter control in the top right of the map, valid values are ‘true’ or ‘false’, default: ‘false’.

Finally, here are a few notes & FAQs about the widget:

  • You can’t select to highlight the text in the filter box, you need to delete each character - which we know is a right pain. We’ve not figured out why this is - a feeling it’s something to do with the fact that text box is within a Google map, so ’selection’ doesn’t work in the same way - since holding the mouse button down whilst dragging means something different in the map context.
  • Similary, the tab to ‘go’ button on the filter form doesn’t work - you need to use the mouse 🙁
  • When the maps says it’s showing ‘all’ users this isn’t quite true! It actually shows all the online users, plus up to a maximum of 100 offline users. This is help prevent potential performance problems when displaying 100’s or 1000’s of markers.

2 replies on “MSG Map Widget”