Sha256: a6457abaf642cefeb2a8914bd870ccf3610e17906a5e2c9a99a340c9d355e3f5

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

//= require leaflet
//= require native.history
//= require_tree ./templates

!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

1 entries across 1 versions & 1 rubygems

Version Path
geoblacklight-1.8.0 app/assets/javascripts/geoblacklight/geoblacklight.js