Select to view content in your preferred language

Retrieving Zip Code Polygons from Map.Extent

479
0
04-28-2011 07:25 AM
DaviKucharski
Deactivated User
Please disregard. Code works fine.


I am trying to get all the zip codes in my map's extent. I have coded the process below. There are no errors, but I am not receiving polygon's back. I am receiving points back. I would like to highlight the zip codes in my extent. Any suggestions? Thank you in advance. When I use the same service with a where clause instead of the geometry = map.extent, I do get back polygons and can highlight.

       private function highlightViewableArea():void
        {
         myGraphicsLayer.graphics.clear();

//Add the Qraphics Layer
var queryTask:QueryTask = new QueryTask("http://dg2k8esridev1/ArcGISDevelopment/rest/services/ZipCodesNoDemographics/MapServer/2");  
            var query:Query = new Query(); 
            query.geometry = map.extent;      
            query.outSpatialReference = map.spatialReference;
            query.returnGeometry = true;
            query.outFields = [ "ID_" ];
      queryTask.execute(query, new AsyncResponder(onVAExecute, onOverlayFault));
        }

private function onVAExecute(featureSet:FeatureSet, token:Object = null):void
        {
            for each (var myGraphic:Graphic in featureSet.features)
            {
             myGraphic.symbol = mySymbol;
               myGraphicsLayer.add(myGraphic);
            }
        }
Tags (2)
0 Kudos
0 Replies