I am trying to select multiple features in a feature layer by using "hold 'ctrl' button and mouse click event". I am using ArcGIS JS API 3.x.
I am creating the US State boundary by using FeatureCollection, [Able to display the boundary on map] I have to select multiple states by mouse click while holding 'ctrl' or 'alt' key.
var featureLayer = new esri.layers.FeatureLayer(featureCollection, {
id: stateLayer,
opacity: 0.30,
visible: true,
infoTemplate: infoTemplate
});
g_esri.map.addLayer(featureLayer);
featureLayer.on("click", onBoundaryClick);
function onBoundaryClick(evt) {
var g = evt.graphic;
g_esri.map.infoWindow.setContent(g.getContent());
g_esri.map.infoWindow.show(evt.screenPoint, g_esri.map.getInfoWindowAnchor(evt.screenPoint));
formatInfotemplate(false, g);
}I tried to follow some of the below links,
a. https://community.esri.com/t5/arcgis-api-for-javascript/selecting-multiple-features-with-graphics/m-p/562210#M52481
b. https://community.esri.com/t5/arcgis-api-for-javascript/select-multiple-features-by-mouse-clicks/td-p/588560
But couldn't able to get through,
Any help welcome
Regards,
Kishor