2009-07-19 13:54:11 +00:00
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle 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 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
/**
|
2009-07-19 13:55:03 +00:00
|
|
|
* Iplookup utility functions
|
2009-07-19 13:54:11 +00:00
|
|
|
*
|
2010-09-17 19:31:10 +00:00
|
|
|
* @package core
|
2009-07-19 13:54:11 +00:00
|
|
|
* @subpackage iplookup
|
|
|
|
* @copyright 2008 Petr Skoda (http://skodak.org)
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
|
|
|
|
2010-02-06 12:12:23 +00:00
|
|
|
M.core_iplookup = {};
|
|
|
|
|
|
|
|
M.core_iplookup.init = function(Y, latitude, longitude) {
|
2009-07-21 08:19:02 +00:00
|
|
|
if (GBrowserIsCompatible()) {
|
|
|
|
var map = new GMap2(document.getElementById("map"));
|
|
|
|
map.addControl(new GSmallMapControl());
|
|
|
|
map.addControl(new GMapTypeControl());
|
|
|
|
var point = new GLatLng(latitude, longitude);
|
|
|
|
map.setCenter(point, 4);
|
|
|
|
map.addOverlay(new GMarker(point));
|
|
|
|
map.setMapType(G_HYBRID_MAP);
|
|
|
|
|
2010-02-06 12:12:23 +00:00
|
|
|
Y.on('unload', function() {
|
|
|
|
if (GBrowserIsCompatible()) {
|
|
|
|
GUnload();
|
|
|
|
}
|
|
|
|
}, document.body);
|
2010-09-17 19:30:26 +00:00
|
|
|
}
|
|
|
|
};
|