如何使用 javascript 根据一组纬度和经度值计算面积?
我有一组从自己的数据库中提取的纬度和经度值。他们看起来像这样:
// Define the LatLng coordinates for the polygon's path.
var fizuliCoords = [
{lng:47.1648244,lat:39.6834661},
{lng:47.1653823,lat:39.6906634},
........there are 400-1200 lines...I only list 2
];
var bakuCoords = [
{lng:47.1648244,lat:39.6834661},
{lng:47.1653823,lat:39.6906634},
........there are 400-1200 lines...I only list 2
];
Run Code Online (Sandbox Code Playgroud)
有69个不同的行政区
我的项目是:
好的,
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>ttttt</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
/* #map is the div …Run Code Online (Sandbox Code Playgroud)