mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-05 01:51:23 +01:00
refactored, renamed to getGeozone
This commit is contained in:
parent
db9dc9eeed
commit
ea9cb6cf4f
4 changed files with 19 additions and 18 deletions
|
|
@ -5736,6 +5736,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p><b>Latitude:</b> <span id="infoLat"></span></p>
|
<p><b>Latitude:</b> <span id="infoLat"></span></p>
|
||||||
<p><b>Longitude:</b> <span id="infoLon"></span></p>
|
<p><b>Longitude:</b> <span id="infoLon"></span></p>
|
||||||
|
<p><b>Geozone:</b> <span id="infoGeozone"></span></p>
|
||||||
<p><b>Area:</b> <span id="infoArea">0</span></p>
|
<p><b>Area:</b> <span id="infoArea">0</span></p>
|
||||||
<p><b>Type:</b> <span id="infoFeature">n/a</span></p>
|
<p><b>Type:</b> <span id="infoFeature">n/a</span></p>
|
||||||
<p><b>Precipitation:</b> <span id="infoPrec">0</span></p>
|
<p><b>Precipitation:</b> <span id="infoPrec">0</span></p>
|
||||||
|
|
@ -8038,7 +8039,7 @@
|
||||||
<script src="libs/indexedDB.js?v=1.99.00"></script>
|
<script src="libs/indexedDB.js?v=1.99.00"></script>
|
||||||
|
|
||||||
<script src="utils/shorthands.js?v=1.99.00"></script>
|
<script src="utils/shorthands.js?v=1.99.00"></script>
|
||||||
<script src="utils/commonUtils.js?v=1.102.01"></script>
|
<script src="utils/commonUtils.js?v=1.99.0"></script>
|
||||||
<script src="utils/arrayUtils.js?v=1.99.00"></script>
|
<script src="utils/arrayUtils.js?v=1.99.00"></script>
|
||||||
<script src="utils/functionUtils.js?v=1.99.00"></script>
|
<script src="utils/functionUtils.js?v=1.99.00"></script>
|
||||||
<script src="utils/colorUtils.js?v=1.99.00"></script>
|
<script src="utils/colorUtils.js?v=1.99.00"></script>
|
||||||
|
|
@ -8080,7 +8081,7 @@
|
||||||
<script src="modules/ui/measurers.js?v=1.99.00"></script>
|
<script src="modules/ui/measurers.js?v=1.99.00"></script>
|
||||||
<script src="modules/ui/style-presets.js?v=1.100.00"></script>
|
<script src="modules/ui/style-presets.js?v=1.100.00"></script>
|
||||||
|
|
||||||
<script src="modules/ui/general.js?v=1.102.01"></script>
|
<script src="modules/ui/general.js?v=1.103.0"></script>
|
||||||
<script src="modules/ui/options.js?v=1.100.00"></script>
|
<script src="modules/ui/options.js?v=1.100.00"></script>
|
||||||
<script src="main.js?v=1.100.00"></script>
|
<script src="main.js?v=1.100.00"></script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -257,10 +257,9 @@ function updateCellInfo(point, i, g) {
|
||||||
const x = (infoX.innerHTML = rn(point[0]));
|
const x = (infoX.innerHTML = rn(point[0]));
|
||||||
const y = (infoY.innerHTML = rn(point[1]));
|
const y = (infoY.innerHTML = rn(point[1]));
|
||||||
const f = cells.f[i];
|
const f = cells.f[i];
|
||||||
const latitude = getLatitude(y, 4);
|
infoLat.innerHTML = toDMS(getLatitude(y, 4), "lat");
|
||||||
const latitudeDescription = getLatitudeDescription(latitude);
|
|
||||||
infoLat.innerHTML = toDMS(latitude, "lat") + ` (${latitudeDescription})`;
|
|
||||||
infoLon.innerHTML = toDMS(getLongitude(x, 4), "lon");
|
infoLon.innerHTML = toDMS(getLongitude(x, 4), "lon");
|
||||||
|
infoGeozone.innerHTML = getGeozone(getLatitude(y, 4));
|
||||||
|
|
||||||
infoCell.innerHTML = i;
|
infoCell.innerHTML = i;
|
||||||
infoArea.innerHTML = cells.area[i] ? si(getArea(cells.area[i])) + " " + getAreaUnit() : "n/a";
|
infoArea.innerHTML = cells.area[i] ? si(getArea(cells.area[i])) + " " + getAreaUnit() : "n/a";
|
||||||
|
|
@ -288,6 +287,19 @@ function updateCellInfo(point, i, g) {
|
||||||
infoBiome.innerHTML = biomesData.name[cells.biome[i]];
|
infoBiome.innerHTML = biomesData.name[cells.biome[i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getGeozone(latitude) {
|
||||||
|
|
||||||
|
if (latitude > 66.5) return "Arctic";
|
||||||
|
if (latitude > 35) return "Temperate North";
|
||||||
|
if (latitude > 23.5) return "Subtropical North";
|
||||||
|
if (latitude > 1) return "Tropical North";
|
||||||
|
if (latitude > -1) return "Equatorial";
|
||||||
|
if (latitude > -23.5) return "Tropical South";
|
||||||
|
if (latitude > -35) return "Subtropical South";
|
||||||
|
if (latitude > -66.5) return "Temperate South";
|
||||||
|
return "Antarctic";
|
||||||
|
}
|
||||||
|
|
||||||
// convert coordinate to DMS format
|
// convert coordinate to DMS format
|
||||||
function toDMS(coord, c) {
|
function toDMS(coord, c) {
|
||||||
const degrees = Math.floor(Math.abs(coord));
|
const degrees = Math.floor(Math.abs(coord));
|
||||||
|
|
|
||||||
|
|
@ -138,18 +138,6 @@ function getCoordinates(x, y, decimals = 2) {
|
||||||
return [getLongitude(x, decimals), getLatitude(y, decimals)];
|
return [getLongitude(x, decimals), getLatitude(y, decimals)];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLatitudeDescription(latitude) {
|
|
||||||
const equatorMargin = 1; // 1 degree margin around the equator
|
|
||||||
|
|
||||||
if (Math.abs(latitude) <= equatorMargin) return "Equator";
|
|
||||||
if (latitude > equatorMargin && latitude <= 23.5) return "Tropical North";
|
|
||||||
if (latitude > 23.5 && latitude <= 66.5) return "Temperate North";
|
|
||||||
if (latitude > 66.5) return "Arctic";
|
|
||||||
if (latitude < -equatorMargin && latitude >= -23.5) return "Tropical South";
|
|
||||||
if (latitude < -23.5 && latitude >= -66.5) return "Temperate South";
|
|
||||||
if (latitude < -66.5) return "Antarctic";
|
|
||||||
}
|
|
||||||
|
|
||||||
// prompt replacer (prompt does not work in Electron)
|
// prompt replacer (prompt does not work in Electron)
|
||||||
void (function () {
|
void (function () {
|
||||||
const prompt = document.getElementById("prompt");
|
const prompt = document.getElementById("prompt");
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
*
|
*
|
||||||
* Example: 1.102.0 -> Major version 1, Minor version 102, Patch version 0
|
* Example: 1.102.0 -> Major version 1, Minor version 102, Patch version 0
|
||||||
*/
|
*/
|
||||||
const VERSION = "1.102.01";
|
const VERSION = "1.103.0";
|
||||||
|
|
||||||
{
|
{
|
||||||
document.title += " v" + VERSION;
|
document.title += " v" + VERSION;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue