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); } });
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.