diff --git a/web/kzedmaps.js b/web/kzedmaps.js index c4b4440f..d541ef11 100644 --- a/web/kzedmaps.js +++ b/web/kzedmaps.js @@ -113,4 +113,6 @@ KzedMapType.prototype = $.extend(new DynMapType(), { } return tile.get(0); } -}); \ No newline at end of file +}); + +maptypes.KzedMapType = function(configuration) { return new KzedMapType(configuration); }; \ No newline at end of file diff --git a/web/map.js b/web/map.js index 352471f7..6442f9a3 100644 --- a/web/map.js +++ b/web/map.js @@ -1,5 +1,7 @@ //if (!console) console = { log: function() {} }; +var maptypes = {}; + function splitArgs(s) { var r = s.split(' '); delete arguments[0]; @@ -87,8 +89,7 @@ DynMap.prototype = { $.extend(me.options, configuration); if (!me.options.maps) me.options.maps = {}; $.each(me.options.shownmaps, function(index, mapentry) { - var mapconstructor = eval(mapentry.type); - me.options.maps[mapentry.name] = new mapconstructor(mapentry); + me.options.maps[mapentry.name] = maptypes[mapentry.type](mapentry); }); }, initialize: function() {