Skip to content
Snippets Groups Projects
Commit fc7b840c authored by Leila Gonzales's avatar Leila Gonzales Committed by Demian Katz
Browse files

Improve Geo-search Search Box selection (#1013)

parent 1d45945a
No related merge requests found
...@@ -199,8 +199,7 @@ function loadMapSelection(geoField, boundingBox, baseURL, homeURL, searchParams, ...@@ -199,8 +199,7 @@ function loadMapSelection(geoField, boundingBox, baseURL, homeURL, searchParams,
function addInteraction() { function addInteraction() {
draw = new ol.interaction.Draw ({ draw = new ol.interaction.Draw ({
source: searchboxSource, source: searchboxSource,
type: 'LineString', type: 'Box',
maxPoints: 2,
geometryFunction: function rectangleFunction(coords, geometryParam) { geometryFunction: function rectangleFunction(coords, geometryParam) {
var geometry = geometryParam ? geometryParam : new ol.geom.Polygon(null); var geometry = geometryParam ? geometryParam : new ol.geom.Polygon(null);
var start = coords[0]; var start = coords[0];
...@@ -209,7 +208,8 @@ function loadMapSelection(geoField, boundingBox, baseURL, homeURL, searchParams, ...@@ -209,7 +208,8 @@ function loadMapSelection(geoField, boundingBox, baseURL, homeURL, searchParams,
[start, [start[0], end[1]], end, [end[0], start[1]], start] [start, [start[0], end[1]], end, [end[0], start[1]], start]
]); ]);
return geometry; return geometry;
} },
freehand: true
}); });
draw.on('drawend', function drawSearchBox(evt) { draw.on('drawend', function drawSearchBox(evt) {
......
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
<h3>To draw the search box:</h3> <h3>To draw the search box:</h3>
<ol> <ol>
<li>Click on the 'Draw Search Box' button.</li> <li>Click on the 'Draw Search Box' button.</li>
<li>Click and release on starting 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>
<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>
</ol> </ol>
<h3>Interacting with the search results</h3> <h3>Interacting with the search results</h3>
<p>Search results are displayed on the map as clusters (circular icons with numbers). The numbers represent <p>Search results are displayed on the map as clusters (circular icons with numbers). The numbers represent
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment