Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
bmaplib
Advanced tools
百度地图API及开源库中抽取的几何对象及其运算
Weekly downloads
Readme
百度地图API及几何运算开源库中“抽取”的对象及计算逻辑。
安装
$ npm install bmaplib
使用
var BMap = require('bmaplib').BMap;
var BMapLib = require('bmaplib').BMapLib;
var pts = [];
var pt1 = new BMap.Point(116.395, 39.910);
var pt2 = new BMap.Point(116.394, 39.914);
var pt3 = new BMap.Point(116.403, 39.920);
var pt4 = new BMap.Point(116.402, 39.914);
var pt5 = new BMap.Point(116.410, 39.913);
pts.push(pt1);
pts.push(pt2);
pts.push(pt3);
pts.push(pt4);
pts.push(pt5);
var ply = new BMap.Polygon(pts);
var pt =new BMap.Point(116.400, 39.914);
var result = BMapLib.GeoUtils.isPointInPolygon(pt, ply); //点在多边形内
var bp1 = new BMap.Point(114.23075520112,28.578514731829);
var bp2 = new BMap.Point(114.24063602435,29.579081890341);
var mid = new BMap.Point((bp1.lng+bp2.lng)/2,(bp1.lat+bp2.lat)/2);
console.log(BMapLib.GeoUtils.getDistance(bp1, bp2)); // 距离
var bounds1 = new BMap.Bounds(bp1, bp2); // Bounds
console.log(bounds1.getSouthWest());
console.log(BMapLib.GeoUtils.isPointInRect(mid, bounds1)); // 点在矩形内
// 另见demo.js
FAQs
百度地图API及开源库中抽取的几何对象及其运算
The npm package bmaplib receives a total of 11 weekly downloads. As such, bmaplib popularity was classified as not popular.
We found that bmaplib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.