bmaplib
百度地图API及几何运算开源库中“抽取”的对象及计算逻辑。
- Point
- Bounds
- Circle
- Polyline
- Polygon
Usage
安装
$ npm install bmaplib
使用
var BMap = BMap;var BMapLib = BMapLib; var pts = ;var pt1 = 116395 39910;var pt2 = 116394 39914;var pt3 = 116403 39920;var pt4 = 116402 39914;var pt5 = 116410 39913; pts;pts;pts;pts;pts;var ply = pts; var pt =116400 39914; var result = BMapLibGeoUtils; //点在多边形内 var bp1 = 1142307552011228578514731829;var bp2 = 1142406360243529579081890341; var mid = bp1lng+bp2lng/2bp1lat+bp2lat/2; console; // 距离 var bounds1 = bp1 bp2; // Bounds console;console; // 点在矩形内 // 另见demo.js