Select to view content in your preferred language

error rendering result query on map with 'outSpatialReference'

647
2
11-04-2013 05:00 AM
francescodi_vito
Deactivated User
Hello to all.
I created a mobile application and following the example of Mansour Raad I created a query that passes the result directly on the map
But I have a problem, when the result is passed to the map traslatto result than the basemap.
The basemap is Topo with wkid 102100 while the service on which I make the query is 32633. How can I fix the problem in order to correctly project the result on the map?
I try with insert a property "outSpatialReference"
<fx:Declarations>
  <esri:QueryTask id="queryTask"
      executeComplete="navigator.pushView(ApplicazioneHomeView, event.featureSet)"
      showBusyCursor="false"
      url="http://www.pcn.minambiente.it/arcgis/rest/services/classificazione_sismica_comunale_2012/MapServer/0"
      useAMF="true"/>
  <esri:Query id="query"
     outFields="['comune']"
     returnGeometry="true" outSpatialReference="32633"
     where="{data}"/>
 </fx:Declarations>

but return an error:  'outSpatialReference': values of type com.esri.ags.SpatialReference cannot be represented in text.
Any help is welcome
thanks
bye
Tags (2)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Francesco,

    The error message is try to tell you that it is looking for a spatial reference object and not the WKID string.

<esri:Query id="query"
                    outFields="['comune']"
                    returnGeometry="true" outSpatialReference="{new SpatialReference(32633)}"
                    where="{data}"/>
0 Kudos
francescodi_vito
Deactivated User
Hi robert,
i entered in my code the wkid of spatial reference with id
<fx:Declarations>
<esri:Extent>
   <esri:SpatialReference wkid="102100" id="sp"/>
</esri:Extent>
  <esri:QueryTask id="queryTask"
      executeComplete="navigator.pushView(ApplicazioneHomeView, event.featureSet)"
      showBusyCursor="false"
      url="http://www.pcn.minambiente.it/arcgis/rest/services/classificazione_sismica_comunale_2012/MapServer/0"
      useAMF="true"/>
  <esri:Query id="query"
     outFields="['comune']"
     returnGeometry="true" outSpatialReference="{sp}"
     where="{data}"/>
 </fx:Declarations>


and i call it and now the application works
Thanks
0 Kudos