Make map definitions non-reactive to improve projection performance
This commit is contained in:
parent
42f8cbd74b
commit
c69aeb8f5f
@ -73,11 +73,11 @@ export default class LiveAtlasMapDefinition {
|
||||
this.scale = (1 / Math.pow(2, this.nativeZoomLevels));
|
||||
|
||||
if(options.mapToWorld || options.worldToMap) {
|
||||
this.projection = Object.freeze(new LiveAtlasProjection({
|
||||
this.projection = new LiveAtlasProjection({
|
||||
mapToWorld: options.mapToWorld || [0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
worldToMap: options.worldToMap || [0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
nativeZoomLevels: this.nativeZoomLevels,
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ export default class DynmapMapProvider extends MapProvider {
|
||||
return;
|
||||
}
|
||||
|
||||
w.maps.set(map.name, new LiveAtlasMapDefinition({
|
||||
w.maps.set(map.name, Object.freeze(new LiveAtlasMapDefinition({
|
||||
world: w, //Ignore append_to_world here otherwise things break
|
||||
background: map.background || '#000000',
|
||||
backgroundDay: map.backgroundday || '#000000',
|
||||
@ -135,7 +135,7 @@ export default class DynmapMapProvider extends MapProvider {
|
||||
worldToMap: map.worldtomap || undefined,
|
||||
nativeZoomLevels: map.mapzoomout || 1,
|
||||
extraZoomLevels: map.mapzoomin || 0
|
||||
}));
|
||||
})));
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user