fl.setSelectionSymbol(new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASH, new Color([255, 0, 0]), 3));
By this I mean,every row I select from the grid, thats the line that shows in the map.Cheers
window.statesUrl = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0";
fl.setSelectionSymbol(new SimpleFillSymbol().setOutline(null).setColor("#AEC7E3"));
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); } }); }
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.