没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![text/plain](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
1 /**
2 * @fileoverview GeoUtils类提供若干几何算法,用来帮助用户判断点与矩形、
3 * 圆形、多边形线、多边形面的关系,并提供计算折线长度和多边形的面积的公式。
4 * 主入口类是<a href="symbols/BMapLib.GeoUtils.html">GeoUtils</a>,
5 * 基于Baidu Map API 1.2。
6 *
7 * @author Baidu Map Api Group
8 * @version 1.2
9 */
10
11 /**
12 * @namespace BMap的所有library类均放在BMapLib命名空间下
13 */
14 var BMapLib = window.BMapLib = BMapLib || {};
15 (function() {
16
17 /**
18 * 地球半径
19 */
20 var EARTHRADIUS = 6370996.81;
21
22 /**
23 * @exports GeoUtils as BMapLib.GeoUtils
24 */
25 var GeoUtils =
26 /**
27 * GeoUtils类,静态类,勿需实例化即可使用
28 * @class GeoUtils类的<b>入口</b>。
29 * 该类提供的都是静态方法,勿需实例化即可使用。
30 */
2 * @fileoverview GeoUtils类提供若干几何算法,用来帮助用户判断点与矩形、
3 * 圆形、多边形线、多边形面的关系,并提供计算折线长度和多边形的面积的公式。
4 * 主入口类是<a href="symbols/BMapLib.GeoUtils.html">GeoUtils</a>,
5 * 基于Baidu Map API 1.2。
6 *
7 * @author Baidu Map Api Group
8 * @version 1.2
9 */
10
11 /**
12 * @namespace BMap的所有library类均放在BMapLib命名空间下
13 */
14 var BMapLib = window.BMapLib = BMapLib || {};
15 (function() {
16
17 /**
18 * 地球半径
19 */
20 var EARTHRADIUS = 6370996.81;
21
22 /**
23 * @exports GeoUtils as BMapLib.GeoUtils
24 */
25 var GeoUtils =
26 /**
27 * GeoUtils类,静态类,勿需实例化即可使用
28 * @class GeoUtils类的<b>入口</b>。
29 * 该类提供的都是静态方法,勿需实例化即可使用。
30 */
31 BMapLib.GeoUtils = function(){
32
33 }
34
35 /**
36 * 判断点是否在矩形内
37 * @param {Point} point 点对象
38 * @param {Bounds} bounds 矩形边界对象
39 * @returns {Boolean} 点在矩形内返回true,否则返回false
40 */
41 GeoUtils.isPointInRect = function(point, bounds){
42 //检查类型是否正确
43 if (!(point instanceof BMap.Point) ||
44 !(bounds instanceof BMap.Bounds)) {
45 return false;
46 }
47 var sw = bounds.getSouthWest(); //西南脚点
48 var ne = bounds.getNorthEast(); //东北脚点
49 return (point.lng >= sw.lng && point.lng <= ne.lng && point.lat >= sw.lat && point.lat <= ne.lat);
50 }
51
52 /**
53 * 判断点是否在圆形内
54 * @param {Point} point 点对象
55 * @param {Circle} circle 圆形对象
56 * @returns {Boolean} 点在圆形内返回true,否则返回false
57 */
58 GeoUtils.isPointInCircle = function(point, circle){
59 //检查类型是否正确
60 if (!(point instanceof BMap.Point) ||
32
33 }
34
35 /**
36 * 判断点是否在矩形内
37 * @param {Point} point 点对象
38 * @param {Bounds} bounds 矩形边界对象
39 * @returns {Boolean} 点在矩形内返回true,否则返回false
40 */
41 GeoUtils.isPointInRect = function(point, bounds){
42 //检查类型是否正确
43 if (!(point instanceof BMap.Point) ||
44 !(bounds instanceof BMap.Bounds)) {
45 return false;
46 }
47 var sw = bounds.getSouthWest(); //西南脚点
48 var ne = bounds.getNorthEast(); //东北脚点
49 return (point.lng >= sw.lng && point.lng <= ne.lng && point.lat >= sw.lat && point.lat <= ne.lat);
50 }
51
52 /**
53 * 判断点是否在圆形内
54 * @param {Point} point 点对象
55 * @param {Circle} circle 圆形对象
56 * @returns {Boolean} 点在圆形内返回true,否则返回false
57 */
58 GeoUtils.isPointInCircle = function(point, circle){
59 //检查类型是否正确
60 if (!(point instanceof BMap.Point) ||
剩余15页未读,继续阅读
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
wuqiyong1991
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)