mirror of
https://github.com/CIMEngine/map.git
synced 2025-02-22 18:53:11 +03:00
feat: area of country
This commit is contained in:
parent
2ee6f3ab7d
commit
dd3b75fb6d
3 changed files with 35 additions and 0 deletions
10
src/index.js
10
src/index.js
|
@ -5,6 +5,8 @@ import {
|
|||
InspectControl,
|
||||
} from "mapbox-gl-controls";
|
||||
|
||||
import area from "@turf/area";
|
||||
|
||||
function loginfo(...str) {
|
||||
let info = str.shift();
|
||||
console.log(
|
||||
|
@ -253,6 +255,14 @@ window.onload = async () => {
|
|||
: ""
|
||||
}
|
||||
</div>
|
||||
<div class="col-12 text-center glass">
|
||||
Area: ${(area(feature) / 1000000)
|
||||
.toFixed(2)
|
||||
.replace(
|
||||
/(\d)(?=(\d\d\d)+([^\d]|$))/g,
|
||||
"$1 "
|
||||
)} km²
|
||||
</div>
|
||||
<div class="col-12 text-center mt-2">
|
||||
${
|
||||
country.about
|
||||
|
|
Loading…
Add table
Reference in a new issue