0

Merge pull request #1066 from wilg/master

display region file name in map coordinates view
This commit is contained in:
Aaron Griffith
2014-02-16 21:39:39 -05:00

View File

@@ -133,7 +133,14 @@ overviewer.views.CoordboxView = Backbone.View.extend({
var worldcoords = overviewer.util.fromLatLngToWorld(latLng.lat(),
latLng.lng(),
overviewer.mapView.options.currentTileSet);
this.el.innerHTML = "Coords: X " + Math.round(worldcoords.x) + ", Z " + Math.round(worldcoords.z);
var regionfileX = Math.floor(Math.floor(worldcoords.x / 16.0) / 32.0);
var regionfileZ = Math.floor(Math.floor(worldcoords.z / 16.0) / 32.0);
var regionfilename = "r." + regionfileX + "." + regionfileZ + ".mca";
this.el.innerHTML = "<strong>X</strong> " + Math.round(worldcoords.x) +
" <strong>Z</strong> " + Math.round(worldcoords.z) +
" (" + regionfilename + ")";
}
});