Skip to content

Commit

Permalink
Missing metadata: support missing solr_geom
Browse files Browse the repository at this point in the history
Only draw a bounding box on the map if data-bbox exists.

Addresses #855
  • Loading branch information
ewlarson committed Jan 24, 2020
1 parent 1c6b014 commit a7a6d2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/assets/javascripts/geoblacklight/modules/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ Blacklight.onLoad(function() {
// set hover listeners on map
$('#content')
.on('mouseenter', '#documents [data-layer-id]', function() {
var bounds = L.bboxToBounds($(this).data('bbox'));
geoblacklight.addBoundsOverlay(bounds);
if($(this).data('bbox').length > 0) {
var bounds = L.bboxToBounds($(this).data('bbox'));
geoblacklight.addBoundsOverlay(bounds);
}
})
.on('mouseleave', '#documents [data-layer-id]', function() {
geoblacklight.removeBoundsOverlay();
Expand Down

0 comments on commit a7a6d2a

Please sign in to comment.