通过ARCGIS for Javascript api 加载数据 ,并显示在dojo的FilteringSelect上

  首先创建一个FeatureLayer,不加载到地图上,调用feature layer的query 方法


var treeList = new esri.layers.FeatureLayer("http://192.168.200.232/ArcGIS/rest/services/WEM/wem/MapServer/3", {  outFields: ["Name"]   }); 
                var query = new esri.tasks.Query(); 
                query.where = "1=1"; 


                treeList.queryFeatures(query, function(featureSet) { 
                var values = dojo.map(featureSet.features, function(feature) { 
              return { 
              name: feature.attributes.Name };  }); 
              var dataItems = { 
            identifier: 'name', 
            label: 'name', 
            items: values  }; 
 
          var store = new dojo.data.ItemFileReadStore({ 
            data: dataItems 
          }); 
 
          dijit.byId("cboRiverbasino").store = store;


你可能感兴趣的:(JavaScript,api,function,query,dojo,layer)