0

Merge branch 'whitespaces' of https://github.com/r15ch13/Minecraft-Overviewer into r15ch13-fixes

This commit is contained in:
Nicolas F
2018-06-14 13:54:34 +02:00
2 changed files with 23 additions and 23 deletions

View File

@@ -19,7 +19,7 @@ overviewer.current_world = null;
/// Records the current layer by name (if any) of each world /// Records the current layer by name (if any) of each world
overviewer.current_layer = {}; overviewer.current_layer = {};
overviewer.collections = { overviewer.collections = {
/** /**
@@ -80,7 +80,7 @@ overviewer.classes = {
* This is a mapType used only for debugging, to draw a grid on the screen * This is a mapType used only for debugging, to draw a grid on the screen
* showing the tile co-ordinates and tile path. Currently the tile path * showing the tile co-ordinates and tile path. Currently the tile path
* part does not work. * part does not work.
* *
* @param google.maps.Size tileSize * @param google.maps.Size tileSize
*/ */
'CoordMapType': function(tileSize) { 'CoordMapType': function(tileSize) {

View File

@@ -1,5 +1,5 @@
overviewer.util = { overviewer.util = {
// vars for callback // vars for callback
readyQueue: [], readyQueue: [],
isReady: false, isReady: false,
@@ -83,7 +83,7 @@ overviewer.util = {
overviewer.control = L.Control.extend({ overviewer.control = L.Control.extend({
initialize: function(options) { initialize: function(options) {
L.Util.setOptions(this, options); L.Util.setOptions(this, options);
this.container = L.DomUtil.create('div', 'worldcontrol'); this.container = L.DomUtil.create('div', 'worldcontrol');
this.select = L.DomUtil.create('select'); this.select = L.DomUtil.create('select');
this.select.onchange = this.onChange; this.select.onchange = this.onChange;
@@ -99,7 +99,7 @@ overviewer.util = {
console.log(ev.target); console.log(ev.target);
console.log(ev.target.value); console.log(ev.target.value);
var selected_world = ev.target.value; var selected_world = ev.target.value;
// save current view for the current_world // save current view for the current_world
overviewer.collections.centers[overviewer.current_world][0] = overviewer.map.getCenter(); overviewer.collections.centers[overviewer.current_world][0] = overviewer.map.getCenter();
@@ -129,7 +129,7 @@ overviewer.util = {
lyr.tileSetConfig.markerCtrl.remove(); lyr.tileSetConfig.markerCtrl.remove();
} }
} }
for (var tset_name in overviewer.collections.overlays[world_name]) { for (var tset_name in overviewer.collections.overlays[world_name]) {
var lyr = overviewer.collections.overlays[world_name][tset_name]; var lyr = overviewer.collections.overlays[world_name][tset_name];
if (world_name != selected_world) { if (world_name != selected_world) {
@@ -153,13 +153,13 @@ overviewer.util = {
}, },
onAdd: function() { onAdd: function() {
console.log("onAdd mycontrol"); console.log("onAdd mycontrol");
return this.container return this.container
} }
}); });
overviewer.map = L.map('mcmap', { overviewer.map = L.map('mcmap', {
crs: L.CRS.Simple, crs: L.CRS.Simple,
minZoom: 0}); minZoom: 0});
@@ -232,7 +232,7 @@ overviewer.util = {
overviewer.map.on('moveend', function(ev) { overviewer.map.on('moveend', function(ev) {
overviewer.util.updateHash(); overviewer.util.updateHash();
}); });
var tset = overviewerConfig.tilesets[0]; var tset = overviewerConfig.tilesets[0];
overviewer.map.on("click", function(e) { overviewer.map.on("click", function(e) {
@@ -247,7 +247,7 @@ overviewer.util = {
overviewer.compass = new overviewer.compassClass( overviewer.compass = new overviewer.compassClass(
overviewerConfig.CONST.image.compass); overviewerConfig.CONST.image.compass);
overviewer.coord_box = new overviewer.coordBoxClass(); overviewer.coord_box = new overviewer.coordBoxClass();
overviewerConfig.worlds.forEach(function(world_name, idx) { overviewerConfig.worlds.forEach(function(world_name, idx) {
overviewer.collections.mapTypes[world_name] = {} overviewer.collections.mapTypes[world_name] = {}
@@ -321,7 +321,7 @@ overviewer.util = {
myLayer["tileSetConfig"] = obj; myLayer["tileSetConfig"] = obj;
if (typeof(obj.spawn) == "object") { if (typeof(obj.spawn) == "object") {
var latlng = overviewer.util.fromWorldToLatLng(obj.spawn[0], obj.spawn[1], obj.spawn[2], obj); var latlng = overviewer.util.fromWorldToLatLng(obj.spawn[0], obj.spawn[1], obj.spawn[2], obj);
overviewer.collections.centers[obj.world] = [ latlng, 1 ]; overviewer.collections.centers[obj.world] = [ latlng, 1 ];
@@ -433,7 +433,7 @@ overviewer.util = {
} else { } else {
overviewer.util.readyQueue.push(callback); // wait until initialize is finished overviewer.util.readyQueue.push(callback); // wait until initialize is finished
} }
}, },
'runReadyQueue': function(){ 'runReadyQueue': function(){
if(overviewer.util.readyQueue.length === 0) return; if(overviewer.util.readyQueue.length === 0) return;
overviewer.util.readyQueue.forEach(function(callback){ overviewer.util.readyQueue.forEach(function(callback){
@@ -462,7 +462,7 @@ overviewer.util = {
}, },
/** /**
* Gee, I wonder what this does. * Gee, I wonder what this does.
* *
* @param string msg * @param string msg
*/ */
'debug': function(msg) { 'debug': function(msg) {
@@ -473,7 +473,7 @@ overviewer.util = {
/** /**
* Simple helper function to split the query string into key/value * Simple helper function to split the query string into key/value
* pairs. Doesn't do any type conversion but both are lowercase'd. * pairs. Doesn't do any type conversion but both are lowercase'd.
* *
* @return Object * @return Object
*/ */
'parseQueryString': function() { 'parseQueryString': function() {
@@ -497,12 +497,12 @@ overviewer.util = {
* X, Y, Z order (arguments are *out of order*, because within the * X, Y, Z order (arguments are *out of order*, because within the
* function we use the axes like the rest of Minecraft Overviewer -- * function we use the axes like the rest of Minecraft Overviewer --
* with the Z and Y flipped from normal minecraft usage.) * with the Z and Y flipped from normal minecraft usage.)
* *
* @param int x * @param int x
* @param int z * @param int z
* @param int y * @param int y
* @param TileSetModel model * @param TileSetModel model
* *
* @return google.maps.LatLng * @return google.maps.LatLng
*/ */
'fromWorldToLatLng': function(x, y, z, tset) { 'fromWorldToLatLng': function(x, y, z, tset) {
@@ -562,10 +562,10 @@ overviewer.util = {
* The opposite of fromWorldToLatLng * The opposite of fromWorldToLatLng
* NOTE: X, Y and Z in this function are Minecraft world definitions * NOTE: X, Y and Z in this function are Minecraft world definitions
* (that is, X is horizontal, Y is altitude and Z is vertical). * (that is, X is horizontal, Y is altitude and Z is vertical).
* *
* @param float lat * @param float lat
* @param float lng * @param float lng
* *
* @return Array * @return Array
*/ */
'fromLatLngToWorld': function(lat, lng, tset) { 'fromLatLngToWorld': function(lat, lng, tset) {
@@ -629,7 +629,7 @@ overviewer.util = {
* Create the pop-up infobox for when you click on a region, this can't * Create the pop-up infobox for when you click on a region, this can't
* be done in-line because of stupid Javascript scoping problems with * be done in-line because of stupid Javascript scoping problems with
* closures or something. * closures or something.
* *
* @param google.maps.Polygon|google.maps.Polyline shape * @param google.maps.Polygon|google.maps.Polyline shape
*/ */
'createRegionInfoWindow': function(shape) { 'createRegionInfoWindow': function(shape) {
@@ -652,7 +652,7 @@ overviewer.util = {
}, },
/** /**
* Same as createRegionInfoWindow() * Same as createRegionInfoWindow()
* *
* @param google.maps.Marker marker * @param google.maps.Marker marker
*/ */
'createMarkerInfoWindow': function(marker) { 'createMarkerInfoWindow': function(marker) {
@@ -699,7 +699,7 @@ overviewer.util = {
var ovconf = currTileset.tileSetConfig; var ovconf = currTileset.tileSetConfig;
var coordinates = overviewer.util.fromLatLngToWorld(overviewer.map.getCenter().lat, var coordinates = overviewer.util.fromLatLngToWorld(overviewer.map.getCenter().lat,
overviewer.map.getCenter().lng, overviewer.map.getCenter().lng,
ovconf); ovconf);
var zoom = overviewer.map.getZoom(); var zoom = overviewer.map.getZoom();
@@ -734,8 +734,8 @@ overviewer.util = {
var target_layer = overviewer.collections.mapTypes[world_name][tileset_name]; var target_layer = overviewer.collections.mapTypes[world_name][tileset_name];
var ovconf = target_layer.tileSetConfig; var ovconf = target_layer.tileSetConfig;
var latlngcoords = overviewer.util.fromWorldToLatLng(parseInt(coords[1]), var latlngcoords = overviewer.util.fromWorldToLatLng(parseInt(coords[1]),
parseInt(coords[2]), parseInt(coords[2]),
parseInt(coords[3]), parseInt(coords[3]),
ovconf); ovconf);