From d2a0159a99de331ccf407c9007f762011611a670 Mon Sep 17 00:00:00 2001
From: Josef Moravec <josef.moravec@gmail.com>
Date: Thu, 25 Jun 2020 16:39:14 -0400
Subject: [PATCH] Eliminate unused code/parameter.

---
 themes/bootstrap3/js/map_selection_leaflet.js   |  2 +-
 .../templates/Recommend/MapSelection.phtml      | 17 +++++------------
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/themes/bootstrap3/js/map_selection_leaflet.js b/themes/bootstrap3/js/map_selection_leaflet.js
index 7db126cf787..7a31079ccaf 100644
--- a/themes/bootstrap3/js/map_selection_leaflet.js
+++ b/themes/bootstrap3/js/map_selection_leaflet.js
@@ -2,7 +2,7 @@
 /*exported loadMapSelection */
 //Coordinate order:  Storage and Query: WENS ; Display: WSEN
 
-function loadMapSelection(geoField, boundingBox, baseURL, homeURL, searchParams, showSelection, resultsCoords, basemap) {
+function loadMapSelection(geoField, boundingBox, baseURL, homeURL, searchParams, resultsCoords, basemap) {
   // Initialize variables
   var searchboxLayer = L.featureGroup();
   var drawnItemsLayer = L.featureGroup();
diff --git a/themes/bootstrap3/templates/Recommend/MapSelection.phtml b/themes/bootstrap3/templates/Recommend/MapSelection.phtml
index 9253917a19d..4c9bafce20c 100644
--- a/themes/bootstrap3/templates/Recommend/MapSelection.phtml
+++ b/themes/bootstrap3/templates/Recommend/MapSelection.phtml
@@ -18,29 +18,22 @@
     $basemap = $this->recommend->getBasemap();
     $geoField = $this->recommend->getGeoField();
     $height = $this->recommend->getHeight();
-    $showSelection = true;
     $baseUrl = $this->url('home');
     $urlpath = $this->url('search-results');
     $searchParams = $this->recommend->getSearchParams();
-    $coordinates = $this->recommend->getSelectedCoordinates();
+    $coordinates = $this->recommend->getSelectedCoordinates()
+    	?? $this->recommend->getDefaultCoordinates();
 
-    if ($coordinates == null) {
-      $coordinates = $this->recommend->getDefaultCoordinates();
-      $showSelection = false;
-    }
     $resultsCoords = $this->recommend->getMapResultCoordinates();
     $params = [
       json_encode($geoField), json_encode($coordinates),
       json_encode($urlpath), json_encode($baseUrl),
-      json_encode($searchParams), json_encode($showSelection),
-      json_encode($resultsCoords), json_encode($basemap)
+      json_encode($searchParams), json_encode($resultsCoords),
+      json_encode($basemap)
     ];
 
     $jsParams = implode(', ', $params);
     $jsLoad = "loadMapSelection(" . $jsParams . ");";
-    $addSearchOption = <<<EOF
-      $('.search-query-options>.advanced').after('&nbsp;&nbsp;<a href="#" class="advanced" onclick=\\'{$jsLoad} $(this).remove(); return false;\\'>{$this->transEsc('Geographic Search')}</a>');
-EOF;
   ?>
   <div class="authorbox">
     <div id="geo_search" style="display: none;">
@@ -48,7 +41,7 @@ EOF;
       <span class="geo_maphelp">&nbsp;<a href="<?php echo $this->url('help-home')?>?topic=geosearch" data-lightbox class="help-link"><?php echo $this->transEsc('Need Help?')?></a></span>
       <div id="geo_search_map" style="height: <?php echo $height?>px;"></div>
     </div>
-    <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $showSelection ? $jsLoad : $addSearchOption, 'SET')?>
+    <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $jsLoad, 'SET')?>
   </div>
   <?php
     // Overwrite leaflet.draw.js tooltips with international translations
-- 
GitLab