mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-01 06:33:38 +01:00
8e59f37995
Included Worldguard support(default) Also residence support(incomplete)
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;
|
|
}
|