From 3c99fde45db83b531c41c350ed4d0ac2a3c40c62 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:45:13 +0200 Subject: Adding debian version 1.1.0-3. Signed-off-by: Daniel Baumann --- .../leaflet.js/layer/vector/Rectangle.js | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 debian/missing-sources/leaflet.js/layer/vector/Rectangle.js (limited to 'debian/missing-sources/leaflet.js/layer/vector/Rectangle.js') diff --git a/debian/missing-sources/leaflet.js/layer/vector/Rectangle.js b/debian/missing-sources/leaflet.js/layer/vector/Rectangle.js new file mode 100644 index 0000000..ceec041 --- /dev/null +++ b/debian/missing-sources/leaflet.js/layer/vector/Rectangle.js @@ -0,0 +1,57 @@ +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); +} -- cgit v1.2.3