Sha256: 0b4aed3e8ac944f7e7a0794f7b8a5b1879a32eebac451b532495b2f2525c7d21

Contents?: true

Size: 995 Bytes

Versions: 4

Compression:

Stored size: 995 Bytes

Contents

//= require leaflet
//= require leaflet-iiif
//= require native.history
//= require readmore

!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 {
      return null;
    }
  };

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

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

  global.GeoBlacklight = GeoBlacklight;

}(this);

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
geoblacklight-0.6.1 app/assets/javascripts/geoblacklight/geoblacklight.js
geoblacklight-0.6.0 app/assets/javascripts/geoblacklight/geoblacklight.js
geoblacklight-0.5.1 app/assets/javascripts/geoblacklight/geoblacklight.js
geoblacklight-0.5.0 app/assets/javascripts/geoblacklight/geoblacklight.js