/opt/canhelp/node_modules/leaflet/src/layer/vector
NameSizeModeActions
Canvas.js119850644editdlrm
Circle.js35130644editdlrm
CircleMarker.js28710644editdlrm
index.js5780644editdlrm
Path.js45610644editdlrm
Polygon.js45770644editdlrm
Polyline.js82280644editdlrm
Rectangle.js14710644editdlrm
Renderer.getRenderer.js15180644editdlrm
Renderer.js36260644editdlrm
SVG.js56480644editdlrm
SVG.Util.js12180644editdlrm
SVG.VML.js36640644editdlrm
Edit: /opt/canhelp/node_modules/leaflet/src/layer/vector/Rectangle.js (1471B)
import {Polygon} from './Polygon'; import {toLatLngBounds} from '../../geo/LatLngBounds'; /* * L.Rectangle extends Polygon and creates a rectangle when passed a LatLngBounds object. */ /* * @class Rectangle * @aka L.Rectangle * @inherits Polygon * * A class for drawing rectangle overlays on a map. Extends `Polygon`. * * @example * * ```js * // define rectangle geographical bounds * var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]]; * * // create an orange rectangle * L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map); * * // zoom the map to the rectangle bounds * map.fitBounds(bounds); * ``` * */ export var Rectangle = Polygon.extend({ initialize: function (latLngBounds, options) { Polygon.prototype.initialize.call(this, this._boundsToLatLngs(latLngBounds), options); }, // @method setBounds(latLngBounds: LatLngBounds): this // Redraws the rectangle with the passed bounds. setBounds: function (latLngBounds) { return this.setLatLngs(this._boundsToLatLngs(latLngBounds)); }, _boundsToLatLngs: function (latLngBounds) { latLngBounds = toLatLngBounds(latLngBounds); return [ latLngBounds.getSouthWest(), latLngBounds.getNorthWest(), latLngBounds.getNorthEast(), latLngBounds.getSouthEast() ]; } }); // @factory L.rectangle(latLngBounds: LatLngBounds, options?: Polyline options) export function rectangle(latLngBounds, options) { return new Rectangle(latLngBounds, options); }