fl.setSelectionSymbol(new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASH, new Color([255, 0, 0]), 3));
function selectState(e) { // select the feature var fl = map.getLayer("states"); var query = new Query(); //query.objectIds = [parseInt(e.target.innerHTML)]; var selection = []; var selected = window.grid.selection; if (selected) { for (row in selected) { selection.push(parseInt(row)); } } query.objectIds = selection; fl.selectFeatures(query, FeatureLayer.SELECTION_NEW, function (result) { if (result.length) { // re-center the map to the selected feature //window.map.centerAt(result[0].geometry.getExtent().getCenter()); } else { console.log("Feature Layer query returned no features... ", result); } }); }
fl.setSelectionSymbol(new SimpleFillSymbol().setOutline(null).setColor("#AEC7E3"));
window.statesUrl = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0";
By this I mean,every row I select from the grid, thats the line that shows in the map.Cheers
Ingelogde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Maak gratis een account aan.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.