PageSourceSearch

https://kaitsealad.ee/modules/contrib/geolocation/js/MapCenter/fitlocations.js?tl5b1f

js kaitsealad.ee collected 2026-10-02 06:09:07 UTC 992 bytes, 41 lines download raw bytes

1/**
2 * @file
3 * Fit locations.
4 */
5
6(function (Drupal) {
7  "use strict";
8
9  Drupal.geolocation = Drupal.geolocation || {};
10  Drupal.geolocation.mapCenter = Drupal.geolocation.mapCenter || {};
11
12  /**
13   * @param {GeolocationMapInterface} map
14   * @param {GeolocationCenterOption} centerOption
15   * @param {Boolean} centerOption.settings.reset_zoom
16   * @param {Boolean} centerOption.settings.min_zoom
17   */
18  Drupal.geolocation.mapCenter.fit_bounds = function (map, centerOption) {
19    if (typeof map.mapMarkers === "undefined") {
20      return false;
21    }
22
23    if (map.mapMarkers.length === 0) {
24      return false;
25    }
26
27    map.fitMapToMarkers();
28
29    if (centerOption.settings.reset_zoom) {
30      map.setZoom(undefined, true);
31    } else if (centerOption.settings.min_zoom) {
32      map.getZoom().then(function (zoom) {
33        if (centerOption.settings.min_zoom < zoom) {
34          map.setZoom(centerOption.settings.min_zoom);
35        }
36      });
37    }
38
39    return true;
40  };
41})(Drupal);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.