    /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

    /**
     * OpenSpace extension for MediaWiki
     * 
     * To use you must define $wgOSKey as your Developer Key from
     * registering with Ordnance Survey
     *
     * Available attributes :
     *  width : width of the window (default 320)
     *  height : height of the window (default 200)
     *  lat / lon : location to centre on (default is 53 / 0)
     *  zoom : zoom size (default 15 )
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program; if not, write to the Free Software Foundation, Inc.,
     * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     * http://www.gnu.org/copyleft/gpl.html
     *
     * @package MediaWiki
     * @subpackage OpenSpace
     * @author Ritchie Swann
     * @copyright 2009 Ritchie Swann
     * @license http://www.gnu.org/copyleft/gpl.html
     * @link http://ritchieswann.com
     * @version $Revision: 0.0.3
     *
     */

    var osMap;

    function showMap( div, lon, lat, zoom ) 
    {
      var proj = new OpenSpace.GridProjection();
      var lonlat = new OpenLayers.LonLat( lon, lat );
      var gridRef = proj.getMapPointFromLonLat( lonlat );
      var controls = [ new OpenLayers.Control.Navigation(),
                       new OpenLayers.Control.KeyboardDefaults(),
                       new OpenSpace.Control.CopyrightCollection(),
                       new OpenLayers.Control.ArgParser() ]
      osMap = new OpenSpace.Map( div, { controls: controls } );
      osMap.addControl( new OpenSpace.Control.SmallMapControl() );
      osMap.setCenter( gridRef, zoom );
    }

