<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Query result graphics being returned backwards? in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/query-result-graphics-being-returned-backwards/m-p/389528#M9097</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;try removing the negatives from your min and max x extents or switching the min with the max or both...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Oct 2010 17:59:39 GMT</pubDate>
    <dc:creator>philippschnetzer</dc:creator>
    <dc:date>2010-10-21T17:59:39Z</dc:date>
    <item>
      <title>Query result graphics being returned backwards?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/query-result-graphics-being-returned-backwards/m-p/389526#M9095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having an odd problem this morning with graphics. I have a query that I use to query a layer, then populate the results to a GraphicsLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem is, the graphics seem to be coming back in mirrored form from the actual data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have attached an image. The green shaded area is the service and the dark shaded area is the same polygon after it has been queried and displayed. Weird huh?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately the service is not available to the public, but here is the REST data for it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
{
&amp;nbsp; "id" : 1, 
&amp;nbsp; "name" : "Landbase.SDE.LA_Parcels", 
&amp;nbsp; "type" : "Feature Layer", 
&amp;nbsp; "description" : "", 
&amp;nbsp; "definitionExpression" : "", 
&amp;nbsp; "geometryType" : "esriGeometryPolygon", 
&amp;nbsp; "copyrightText" : "", 
&amp;nbsp; "parentLayer" : null, 
&amp;nbsp; "subLayers" : [], 
&amp;nbsp; "minScale" : 10000, 
&amp;nbsp; "maxScale" : 0, 
&amp;nbsp; "defaultVisibility" : true, 
&amp;nbsp; "extent" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "xmin" : -13241845.3287006, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; "ymin" : 3867765.81297817, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; "xmax" : -13096080.9165718, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; "ymax" : 4139925.57253608, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; "spatialReference" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "wkid" : 102113
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }, 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
public function findParcelFeatures(ains:Array):AsyncToken {
 var query:Query = new Query();
 query.outFields = ['*'];
 query.returnGeometry = true;
 query.where = queryStringFromArray(ains, "AIN");
 trace(query.where);
 return parcelFeaturesTask.execute(query);
 
 function queryStringFromArray(items:Array, fieldName:String):String {
&amp;nbsp; var where:String = fieldName;
&amp;nbsp; for each (var item:String in items) {
&amp;nbsp;&amp;nbsp; if (item != "")
&amp;nbsp;&amp;nbsp;&amp;nbsp; where += " = " + item + " OR " + fieldName;
&amp;nbsp; }
&amp;nbsp; var fieldL:int = fieldName.length;
&amp;nbsp; var trim:int = (where.length - fieldL) - 4;
&amp;nbsp; return where.substr(0, trim);
 }
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
private function onParcelFeaturesLoaded_handler(fSet:FeatureSet):void {
 trace("got parcel features results", fSet.features.length);
 parcelLayer.clear();
 //parcelLayer.graphicProvider = fSet.features;
 for each (var g:Graphic in fSet.features) {
&amp;nbsp; parcelLayer.add(g);
 }
 map.extent = GraphicUtil.getGraphicsExtent(fSet.features);
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I deleted the service, created a new MXD, created a new MSD and rebuilt the service, but the results are the same? Any clues as to what can be causing this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 15:49:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/query-result-graphics-being-returned-backwards/m-p/389526#M9095</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2010-10-21T15:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Query result graphics being returned backwards?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/query-result-graphics-being-returned-backwards/m-p/389527#M9096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, this was a weird problem. If I add the GraphicsLayer to the map right after initializing it at the same time as I dynamically add my service layers, the graphics are backwards.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So services is an array map service layers&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
for each (var layer:Layer in services) {
 map.addLayer(layer);
}
map.addLayer(parcelLayer);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But if I wait until the after I do the first query and add it, it works ok.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just add this "if" statement in my Query Result handler&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if (!map.getLayer(parcelLayer.id)) {
 map.addLayer(parcelLayer);
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know if it has to do with adding the GraphicsLayer before the map has been added to the stage or what exactly, but I'm going to enjoy the solution I found.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:52:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/query-result-graphics-being-returned-backwards/m-p/389527#M9096</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-11T17:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Query result graphics being returned backwards?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/query-result-graphics-being-returned-backwards/m-p/389528#M9097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;try removing the negatives from your min and max x extents or switching the min with the max or both...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 17:59:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/query-result-graphics-being-returned-backwards/m-p/389528#M9097</guid>
      <dc:creator>philippschnetzer</dc:creator>
      <dc:date>2010-10-21T17:59:39Z</dc:date>
    </item>
  </channel>
</rss>

