AnsweredAssumed Answered

CENTER- ZOOM TO QUERY RESULTS

Question asked by laura_busolo@redlands.edu_univredlands on Aug 29, 2017
Latest reply on Sep 6, 2017 by thanhtetaung

                    on(dom.byId("GetAcademies"), "click", executeIndQry);

                    function executeIndQry() {
                        var queryString='';
                        var i=0;
                        // define more than one selection to query from the sector
                        for(option in dom.byId("industrySelectDD").options){
                            if(dom.byId("industrySelectDD").options[option].selected)
                            {
                                if(i==0)
                                {
                                    queryString+="Industry ='" +dom.byId("industrySelectDD").options[option].value+"'";
                                    i+=1;
                                }
                                else
                                {
                                    queryString+=" or Industry ='" +dom.byId("industrySelectDD").options[option].value+"'";
                                }
                            }
                        }
                        query.where = queryString;
                        query.outSpatialReference = mapMain.spatialReference;
                        lyrAcademies.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(results){
                            showResults(results);
                        })
                    }
                };

                //Show the results as highlighted boxes on the map
                function showResults(results) {
                    mapMain.graphics.clear();

                    var selectSymbol = new SimpleMarkerSymbol(
                        SimpleMarkerSymbol.STYLE_SQUARE, 15,
                        new SimpleLineSymbol(
                            SimpleLineSymbol.STYLE_SOLID,
                            new Color([255,0,0]), 1),
                        new Color([0,255,0,0.25])
                    );
                   

Outcomes