UNPKG

rc-leaflet

Version:
14 lines (13 loc) 723 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var leaflet_1 = __importDefault(require("leaflet")); exports.handlers = ['boxZoom', 'doubleClickZoom', 'dragging', 'keyboard', 'scrollWheelZoom', 'tap', 'touchZoom']; exports.getBounds = function (map, scale) { if (scale === void 0) { scale = 1; } var _a = map.getSize(), x = _a.x, y = _a.y; var padding = (scale - 1) / 2; return leaflet_1.default.latLngBounds(map.containerPointToLatLng([-padding * x, (1 + padding) * y]), map.containerPointToLatLng([(1 + padding) * x, -padding * y])); };