Add mapzoomin attribute, to adjust zoom in levels beyond native tile resolution

This commit is contained in:
Mike Primm 2011-07-21 23:25:59 -05:00
parent 8c134edce3
commit 559f251d50
7 changed files with 29 additions and 3 deletions

View File

@ -518,6 +518,7 @@ public class FlatMap extends MapType {
s(o, "backgroundday", c.getString("backgroundday")); s(o, "backgroundday", c.getString("backgroundday"));
s(o, "backgroundnight", c.getString("backgroundnight")); s(o, "backgroundnight", c.getString("backgroundnight"));
s(o, "bigmap", this.isBigWorldMap(world)); s(o, "bigmap", this.isBigWorldMap(world));
s(o, "mapzoomin", c.getInteger("mapzoomin", 3));
s(o, "compassview", "S"); /* Always from south */ s(o, "compassview", "S"); /* Always from south */
a(worldObject, "maps", o); a(worldObject, "maps", o);
} }

View File

@ -144,6 +144,7 @@ public class HDMap extends MapType {
s(o, "backgroundnight", c.getString("backgroundnight")); s(o, "backgroundnight", c.getString("backgroundnight"));
s(o, "bigmap", true); s(o, "bigmap", true);
s(o, "mapzoomout", (world.getExtraZoomOutLevels()+mapzoomout)); s(o, "mapzoomout", (world.getExtraZoomOutLevels()+mapzoomout));
s(o, "mapzoomin", c.getInteger("mapzoomin", 2));
perspective.addClientConfiguration(o); perspective.addClientConfiguration(o);
shader.addClientConfiguration(o); shader.addClientConfiguration(o);
lighting.addClientConfiguration(o); lighting.addClientConfiguration(o);

View File

@ -579,6 +579,7 @@ public class DefaultTileRenderer implements MapTileRenderer {
s(o, "backgroundday", c.getString("backgroundday")); s(o, "backgroundday", c.getString("backgroundday"));
s(o, "backgroundnight", c.getString("backgroundnight")); s(o, "backgroundnight", c.getString("backgroundnight"));
s(o, "bigmap", map.isBigWorldMap(world)); s(o, "bigmap", map.isBigWorldMap(world));
s(o, "mapzoomin", c.getInteger("mapzoomin", 3));
s(o, "compassview", "SE"); /* Always from southeast */ s(o, "compassview", "SE"); /* Always from southeast */
a(worldObject, "maps", o); a(worldObject, "maps", o);
} }

View File

@ -40,6 +40,8 @@ templates:
# backgroundnight: "#000000" # backgroundnight: "#000000"
# # Background color for map (independent of night/day) # # Background color for map (independent of night/day)
# background: "#000000" # background: "#000000"
# # Adjust extra zoom in levels - default is 3
# mapzoomin: 3
- class: org.dynmap.kzedmap.KzedMap - class: org.dynmap.kzedmap.KzedMap
renderers: renderers:
- class: org.dynmap.kzedmap.DefaultTileRenderer - class: org.dynmap.kzedmap.DefaultTileRenderer
@ -64,6 +66,8 @@ templates:
# background: "#000000" # background: "#000000"
# # Sets the icon to 'images/block_custom.png' # # Sets the icon to 'images/block_custom.png'
# icon: custom # icon: custom
# # Adjust extra zoom in levels - default is 3
# mapzoomin: 3
# # Biome-based mapping # # Biome-based mapping
# - class: org.dynmap.kzedmap.DefaultTileRenderer # - class: org.dynmap.kzedmap.DefaultTileRenderer
# name: biome # name: biome
@ -185,6 +189,8 @@ templates:
# backgroundnight: "#000000" # backgroundnight: "#000000"
# # Background color for map (independent of night/day) # # Background color for map (independent of night/day)
# background: "#000000" # background: "#000000"
# Adjust extra zoom in levels - default is 2
mapzoomin: 2
- class: org.dynmap.hdmap.HDMap - class: org.dynmap.hdmap.HDMap
name: surface name: surface
title: "Surface" title: "Surface"
@ -206,6 +212,8 @@ templates:
# background: "#000000" # background: "#000000"
# # Sets the icon to 'images/block_custom.png' # # Sets the icon to 'images/block_custom.png'
# icon: custom # icon: custom
# Adjust extra zoom in levels - default is 2
mapzoomin: 2
# # Biome-based mapping # # Biome-based mapping
# - class: org.dynmap.hdmap.HDMap # - class: org.dynmap.hdmap.HDMap
# name: biome # name: biome
@ -215,6 +223,8 @@ templates:
# lighting: default # lighting: default
# # Biome-based shading : biome=biome type, temperature=biome-temperature, rainfall=biome-rainfall # # Biome-based shading : biome=biome type, temperature=biome-temperature, rainfall=biome-rainfall
# shader: biome # shader: biome
# # Adjust extra zoom in levels - default is 2
# mapzoomin: 2
- class: org.dynmap.hdmap.HDMap - class: org.dynmap.hdmap.HDMap
name: cave name: cave
title: "Cave" title: "Cave"
@ -222,6 +232,8 @@ templates:
perspective: iso_SE_60_lowres perspective: iso_SE_60_lowres
shader: cave shader: cave
lighting: default lighting: default
# Adjust extra zoom in levels - default is 2
mapzoomin: 2
# Nether world template (HDMap) # Nether world template (HDMap)
nether-HDMap: nether-HDMap:
@ -244,6 +256,8 @@ templates:
lighting: default lighting: default
# Map background color (day or night) # Map background color (day or night)
background: "#300806" background: "#300806"
# Adjust extra zoom in levels - default is 2
mapzoomin: 2
- class: org.dynmap.hdmap.HDMap - class: org.dynmap.hdmap.HDMap
name: nether name: nether
title: "Surface" title: "Surface"
@ -253,6 +267,8 @@ templates:
lighting: default lighting: default
# Map background color (day or night) # Map background color (day or night)
background: "#300806" background: "#300806"
# Adjust extra zoom in levels - default is 2
mapzoomin: 2
# Skylands world template (HDMap) # Skylands world template (HDMap)
skylands-HDMap: skylands-HDMap:
enabled: true enabled: true
@ -276,6 +292,8 @@ templates:
backgroundday: "#153E7E" backgroundday: "#153E7E"
# Background color for map during the night # Background color for map during the night
backgroundnight: "#000000" backgroundnight: "#000000"
# Adjust extra zoom in levels - default is 2
mapzoomin: 2
- class: org.dynmap.hdmap.HDMap - class: org.dynmap.hdmap.HDMap
name: skylands name: skylands
title: "Surface" title: "Surface"
@ -287,4 +305,6 @@ templates:
backgroundday: "#153E7E" backgroundday: "#153E7E"
# Background color for map during the night # Background color for map during the night
backgroundnight: "#000000" backgroundnight: "#000000"
# Adjust extra zoom in levels - default is 2
mapzoomin: 2

View File

@ -72,8 +72,9 @@ FlatMapType.prototype = $.extend(new DynMapType(), {
updateTileSize: function(zoom) { updateTileSize: function(zoom) {
var size; var size;
var extrazoom = this.dynmap.world.extrazoomout; var extrazoom = this.dynmap.world.extrazoomout;
var mapzoomin = this.dynmap.world.mapzoomin;
this.projection.extrazoom = extrazoom; this.projection.extrazoom = extrazoom;
this.maxZoom = 3 + extrazoom; this.maxZoom = mapzoomin + extrazoom;
if (zoom <= extrazoom) { if (zoom <= extrazoom) {
size = 128; size = 128;
} }

View File

@ -73,9 +73,10 @@ HDMapType.prototype = $.extend(new DynMapType(), {
updateTileSize: function(zoom) { updateTileSize: function(zoom) {
var size; var size;
var extrazoom = this.mapzoomout; var extrazoom = this.mapzoomout;
var mapzoomin = this.mapzoomin;
this.projection.extrazoom = extrazoom; this.projection.extrazoom = extrazoom;
this.projection.worldtomap = this.worldtomap; this.projection.worldtomap = this.worldtomap;
this.maxZoom = 2 + extrazoom; this.maxZoom = mapzoomin + extrazoom;
if (zoom <= extrazoom) { if (zoom <= extrazoom) {
size = 128; size = 128;
} }

View File

@ -115,8 +115,9 @@ KzedMapType.prototype = $.extend(new DynMapType(), {
updateTileSize: function(zoom) { updateTileSize: function(zoom) {
var size; var size;
var extrazoom = this.dynmap.world.extrazoomout; var extrazoom = this.dynmap.world.extrazoomout;
var mapzoomin = this.dynmap.world.mapzoomin;
this.projection.extrazoom = extrazoom; this.projection.extrazoom = extrazoom;
this.maxZoom = 3 + extrazoom; this.maxZoom = mapzoomin + extrazoom;
if (zoom <= extrazoom) { if (zoom <= extrazoom) {
size = 128; size = 128;
} else { } else {