mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
36 lines
966 B
JavaScript
36 lines
966 B
JavaScript
|
// Author: nidefawl. contact me at bukkit.org or irc.esper.net #nide
|
||
|
|
||
|
var regionCfg;
|
||
|
var regionPolygons = {} ;
|
||
|
var regionInfoWindow = new google.maps.InfoWindow();
|
||
|
var regionConstructors = {};
|
||
|
function makeRegionPolygonCube(map, name, region)
|
||
|
{
|
||
|
new regionConstructors['polygon'](map, name, region);
|
||
|
}
|
||
|
function regionInfo(event, name, region)
|
||
|
{
|
||
|
new regionConstructors['info'](event, name, region);
|
||
|
}
|
||
|
componentconstructors['regions'] = function(dynmap, configuration)
|
||
|
{
|
||
|
regionCfg = configuration;
|
||
|
|
||
|
loadjs('js/regions_' + regionCfg.name + '.js', function()
|
||
|
{
|
||
|
var world_info = dynmap.map.mapTypeId.split('.');
|
||
|
new regionConstructors['update'](world_info[0]);
|
||
|
|
||
|
$(dynmap).bind('mapchanged', function() {
|
||
|
var world_info = dynmap.map.mapTypeId.split('.');
|
||
|
new regionConstructors['update'](world_info[0]);
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function arrayReplace(replace, by, str)
|
||
|
{
|
||
|
for (var i=0; i<replace.length; i++)
|
||
|
str = str.replace(replace[i], by[i]);
|
||
|
return str;
|
||
|
}
|