AnsweredAssumed Answered

How do u multi-select parcels?

Question asked by deanthompson10 on Jun 2, 2017

I have a simple  JSAPI 4.3 web map that I created. I added a search widget.  when i do a search it returns several parcels in the result. however it only selects one parcel. How do i return all parcels selected in the result of the search.

 

Image "Selected Parcel" show what I would want to achieve, while image "Selected Parcel 2" is the result I am currently getting.

 

Code: 

<link rel="stylesheet" href="https://js.arcgis.com/4.3/esri/css/main.css">
<script src="https://js.arcgis.com/4.3/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/layers/MapImageLayer",
"esri/widgets/Search",
"esri/tasks/IdentifyTask",
"esri/tasks/support/IdentifyParameters",
"dojo/domReady!"

], function(Map, MapView, FeatureLayer, MapImageLayer, Search){

var map = new Map({
basemap: "streets"
});

var view = new MapView({
container: "viewDiv",
map: map,
zoom: 9,
center: [-77.2975, 18.1096]
});


var parcelLayer = new FeatureLayer({url:"https://myserver/arcgis/rest/services/2013_Unimproved_Values/MapServer/0"});
map.add(parcelLayer);


//add search widget

var searchWidget = new Search({
view: view,
sources: [{
featureLayer: parcelLayer,
searchFields: ["LV_Number"],
displayField: "LV_Number",
exactmatch: false,
outFields: ["*"],
name: " Land Valuation Number",
zoomScale: 10000,
placeholder: "LV Number"
}]
});

view.ui.add(searchWidget, "top-right");

 

Thanks in advance.

Outcomes