Sha256: f10b554decde87851b887fac95f8533d38a3e8073a695da2c9a8488a85da1714

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

//= require leaflet
//= require native.history

!function(global) {
  'use strict';

  /**
   * Convert bounding box string to Leaflet LatLngBounds.
   * @param {String} bbox Space-separated string of sw-lng sw-lat ne-lng ne-lat
   * @return {L.LatLngBounds} Converted Leaflet LatLngBounds object
   */
  L.bboxToBounds = function(bbox) {
    bbox = bbox.split(' ');
    if (bbox.length === 4) {
      return L.latLngBounds([[bbox[1], bbox[0]], [bbox[3], bbox[2]]]);
    } else {
      throw "Invalid bounding box string";
    }
  };

  var GeoBlacklight = L.Class.extend({
    statics: {
      __version__: '1.4.0',

      debounce: function(fn, delay) {
        var timeout = null;
        return function() {
          var args = arguments, _this = this;
          clearTimeout(timeout);
          timeout = setTimeout(function() {
            fn.apply(_this, args);
          }, delay);
        };
      }
    }
  });

  // Hash for leaflet controls.
  GeoBlacklight.Controls = {};
  global.GeoBlacklight = GeoBlacklight;
}(this);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geoblacklight-1.7.1 app/assets/javascripts/geoblacklight/geoblacklight.js
geoblacklight-1.7.0 app/assets/javascripts/geoblacklight/geoblacklight.js
geoblacklight-1.6.0 app/assets/javascripts/geoblacklight/geoblacklight.js