Rectangle
概述
绘制矩形,扩展Polygon
用法示例
// 定义矩形的地理边界
var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
// 创建一个橘黄色矩形
FMap.rectangle(bounds, {color: ""#ff7800"", weight: 1}).addTo(map);
// 变焦地图至矩形
map.fitBounds(bounds);
创建(Creation)
创建:
创建 | 描述 |
---|---|
FMap.rectangle( <LatLngBounds> bounds, <Path options> options? ) | 根据地理坐标范围和可选的option对象实例化一个rectangle 对象 |
方法(Methods)
方法:
方法 | 参数 | 返回值 | 描述 |
---|---|---|---|
setBounds() | <LatLngBounds> bounds | this | 用传进的bounds参数重绘矩形 |