From fc7b840c65e5bba1860e10bfd2b959e68d84403c Mon Sep 17 00:00:00 2001 From: Leila Gonzales <lmg@agiweb.org> Date: Tue, 8 Aug 2017 12:55:51 -0700 Subject: [PATCH] Improve Geo-search Search Box selection (#1013) --- themes/bootstrap3/js/map_selection.js | 6 +++--- themes/root/templates/HelpTranslations/en/geosearch.phtml | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/themes/bootstrap3/js/map_selection.js b/themes/bootstrap3/js/map_selection.js index fe2159cb0b7..7641bd1fc7b 100644 --- a/themes/bootstrap3/js/map_selection.js +++ b/themes/bootstrap3/js/map_selection.js @@ -199,8 +199,7 @@ function loadMapSelection(geoField, boundingBox, baseURL, homeURL, searchParams, function addInteraction() { draw = new ol.interaction.Draw ({ source: searchboxSource, - type: 'LineString', - maxPoints: 2, + type: 'Box', geometryFunction: function rectangleFunction(coords, geometryParam) { var geometry = geometryParam ? geometryParam : new ol.geom.Polygon(null); var start = coords[0]; @@ -209,7 +208,8 @@ function loadMapSelection(geoField, boundingBox, baseURL, homeURL, searchParams, [start, [start[0], end[1]], end, [end[0], start[1]], start] ]); return geometry; - } + }, + freehand: true }); draw.on('drawend', function drawSearchBox(evt) { diff --git a/themes/root/templates/HelpTranslations/en/geosearch.phtml b/themes/root/templates/HelpTranslations/en/geosearch.phtml index 4872934a1d2..9373c98df80 100644 --- a/themes/root/templates/HelpTranslations/en/geosearch.phtml +++ b/themes/root/templates/HelpTranslations/en/geosearch.phtml @@ -5,9 +5,7 @@ <h3>To draw the search box:</h3> <ol> <li>Click on the 'Draw Search Box' button.</li> - <li>Click and release on starting point of the search box.</li> - <li>Drag the search box to the cover the area of the map you wish to search.</li> - <li>Click and release on the ending point of the search box.</li> + <li>Click and drag to create the search box over the area of the map you wish to search.</li> </ol> <h3>Interacting with the search results</h3> <p>Search results are displayed on the map as clusters (circular icons with numbers). The numbers represent -- GitLab