Skip to content

Commit

Permalink
Merge cd10f79 into b865799
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Feb 10, 2017
2 parents b865799 + cd10f79 commit ec63bbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion blacklight_heatmaps.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|

s.add_dependency 'rails', '>= 4.2.6', '< 6'
s.add_dependency 'blacklight', '~> 6.0'
s.add_dependency 'leaflet-rails'
s.add_dependency 'leaflet-rails', '<= 1.0.1'
s.add_dependency 'leaflet-sidebar-rails', '~> 0.1.9'

s.add_development_dependency 'sqlite3'
Expand Down
22 changes: 9 additions & 13 deletions vendor/assets/javascripts/leaflet_solr_heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ L.SolrHeatmap = L.GeoJSON.extend({
}

var bounds = this._map.getBounds();
return [bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth()].join(',');
var wrappedSw = bounds.getSouthWest().wrap();
var wrappedNe = bounds.getNorthEast().wrap();
return [wrappedSw.lng, bounds.getSouth(), wrappedNe.lng, bounds.getNorth()].join(',');
},

_mapViewToEnvelope: function () {
Expand All @@ -343,7 +345,9 @@ L.SolrHeatmap = L.GeoJSON.extend({
}

var bounds = this._map.getBounds();
return ':"Intersects(ENVELOPE(' + bounds.getWest() + ', ' + bounds.getEast() + ', ' + bounds.getNorth() + ', ' + bounds.getSouth() + '))"';
var wrappedSw = bounds.getSouthWest().wrap();
var wrappedNe = bounds.getNorthEast().wrap();
return ':"Intersects(ENVELOPE(' + wrappedSw.lng + ', ' + wrappedNe.lng + ', ' + bounds.getNorth() + ', ' + bounds.getSouth() + '))"';
},

_mapViewToWkt: function () {
Expand All @@ -352,7 +356,9 @@ L.SolrHeatmap = L.GeoJSON.extend({
}

var bounds = this._map.getBounds();
return '["' + bounds.getWest() + ' ' + bounds.getSouth() + '" TO "' + bounds.getEast() + ' ' + bounds.getNorth() + '"]';
var wrappedSw = bounds.getSouthWest().wrap();
var wrappedNe = bounds.getNorthEast().wrap();
return '["' + wrappedSw.lng + ' ' + bounds.getSouth() + '" TO "' + wrappedNe.lng + ' ' + bounds.getNorth() + '"]';
},

_solrQuery: function () {
Expand All @@ -364,16 +370,6 @@ L.solrHeatmap = function (url, options) {
return new L.SolrHeatmap(url, options);
};

L.LatLngBounds.prototype.getWest = function () {
var west = this._southWest.lng;
return west < -180 ? -180 : west;
};

L.LatLngBounds.prototype.getEast = function () {
var east = this._northEast.lng;
return east > 180 ? 180 : east;
};

// Check if L.MarkerCluster is included
if (typeof L.MarkerCluster !== 'undefined') {
L.MarkerCluster.prototype.initialize = function (group, zoom, a, b) {
Expand Down

0 comments on commit ec63bbc

Please sign in to comment.