function addToMap(geometry) { selectionToolbar.deactivate(); map.showZoomSlider(); var selectQuery = new esri.tasks.Query(); selectQuery.geometry = geometry; // selectMethod is a variable that holds selectionMethod constant featureLayer.selectFeatures(selectQuery, selectMethod); map.addLayer(featureLayer); }
dojo.connect(neighborhoods,'onClick',function(e){ var query = new esri.tasks.Query(); query.objectIds = [e.graphic.attributes.FID]; //if shift key is pressed subtract from selection - otherwise add if(e.shiftKey){ neighborhoods.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_SUBTRACT); }else{ neighborhoods.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_ADD); } });
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.