Methods
-
staticfengmap.FMCalculator.area(polygon){number}
-
面积
Name Type Description polygonArray 多边形顶点数组
Name Type Description pointArray 多边形顶点
Name Type Description xObject 多边形顶点x坐标
yObject 多边形顶点y坐标
Returns:
Type Description number 面积 Example
fengmap.FMCalculator.area([{x:12619620,y:2621864},{x:12619623,y:2621866},{x:12619633,y:2621868}]) -
staticfengmap.FMCalculator.bound(polygon){Object}
-
计算界限
Name Type Description polygonArray Name Type Description pointObject 多边形顶点
Name Type Description xObject 多边形顶点x坐标
yObject 多边形顶点y坐标
Returns:
Name Type Description boundObject 界限 Name Type Description maxObject 最大坐标 Name Type Description xObject 最大x坐标 yObject 最大y坐标 minObject 最小坐标 Name Type Description xObject 最小x坐标 yObject 最小y坐标 centerObject 中心坐标 Name Type Description xObject 中心x坐标 yObject 中心y坐标 sizeObject 尺寸 Name Type Description xObject x方向尺寸 yObject y方向尺寸 -
staticfengmap.FMCalculator.circleBuilder(radius, center, segments){Array}
-
生成圆形
Name Type Description radiusnumber 圆形半径
centerObject 圆形中心点坐标
Name Type Description xnumber 圆形中心点x坐标
ynumber 圆形中心点y坐标
segmentsint 圆形边的段数
Returns:
Type Description Array 圆形 -
staticfengmap.FMCalculator.distance(start, end){number}
-
计算两点间距离
Name Type Description startObject 起点
Name Type Description xnumber ynumber endObject 终点
Name Type Description xnumber ynumber Returns:
Type Description number 两点间距离 -
staticfengmap.FMCalculator.fanBuilder(radius, center, segments, angles){Array}
-
生成扇形
Name Type Description radiusnumber 扇形半径
centerObject 扇形中心点坐标
Name Type Description xnumber 扇形中心点x坐标
ynumber 扇形中心点y坐标
segmentsint 扇形边的段数
anglesArray 扇形角度范围 [0]-最小值 [1]-最大值
Returns:
Type Description Array 扇形 -
staticfengmap.FMCalculator.isContain(polygon, point){boolean}
-
计算多边形是否包含点
Name Type Description polygonArray 多边形顶点数组
Name Type Description pointObject 多边形顶点
Name Type Description xObject 多边形顶点x坐标
yObject 多边形顶点y坐标
pointObject 点
Name Type Description xObject 点x坐标
yObject 点y坐标
Returns:
Type Description boolean true:包含;false:不包含 Example
fengmap.FMCalculator.isContain([{x:12619620,y:2621865},{x:12619622,y:2621865},{x:12619621,y:2621866}], { x:12619620,y:2621864 }) -
staticfengmap.FMCalculator.latlngToMapCoordinate(latlng){Object}
-
经纬度坐标转地图坐标
Name Type Description latlngObject 经纬度坐标
Returns:
Type Description Object 地图坐标 Example
FMCalculator.latlngToMapCoordinate({x:100,y:12}) -
staticfengmap.FMCalculator.mapCoordinateToLatlng(map){Object}
-
地图坐标转经纬度坐标
Name Type Description mapObject 地图坐标
Returns:
Type Description Object 经纬度坐标 Example
fengmap.FMCalculator.mapCoordinateToLatlng({x:12619620,y:2621864}) -
staticfengmap.FMCalculator.rectangleBuilder(w, h, center){Array}
-
生成矩形
Name Type Description wnumber 矩形宽度
hnumber 矩形高度
centerObject 矩形中心点坐标
Name Type Description xnumber 矩形中心点x坐标
ynumber 矩形中心点y坐标
Returns:
Type Description Array 矩形