protected override function createArcWebService(useHTTPS:Boolean, arcwebHost:String):IArcWebService
This method must be overriden by the extending class to return an instance of an IArcWebService.
Parameters
| useHTTPS:Boolean — the service created should use HTTPS.
|
| |
| arcwebHost:String — the service created should use this ArcWeb host.
|
Returns
protected override function getClassName():String
This method must be overriden by the extending class to return the fully qualified class name of the service to be registered.
Returns
| String — The fully qualified class name of the service to be registered.
|
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:awx="http://www.arcwebservices.com/2007/awx"
layout="absolute" >
<!-- Install the framework and the services we'll need -->
<awx:Framework apiKey="[MY-API-KEY]">
<awx:SpatialQueryActivator/>
</awx:Framework>
<awx:Map scale="800000" centerGeoX="-87.62" centerGeoY="41.86">
<!-- show airports on top of default basemap -->
<awx:QueryLayer dataSource="ArcWeb:ESRI.Airports.World" labelField="NAME" />
</awx:Map>
</mx:Application>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:awx="http://www.arcwebservices.com/2007/awx"
pageTitle="Basic SpatialQuery - findFeaturesByPoint()"
implements="mx.rpc.IResponder"
creationComplete="onComplete()"
>
<mx:Script>
<![CDATA[
import com.esri.aws.awx.geom.GeoPoint;
import com.esri.aws.osgi.framework.ServiceTracker;
import com.esri.aws.osgi.framework.IServiceReference;
import com.esri.aws.services.ISpatialQuery;
import com.esri.aws.services.ResultSet;
import com.esri.aws.services.ResultSetRange;
import com.esri.aws.services.SearchOptions;
import com.esri.aws.services.SpatialQueryOptions;
import flash.utils.getQualifiedClassName;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.IResponder;
private var spatialTracker:ServiceTracker;
private function onComplete():void
{
spatialTracker = new ServiceTracker(Framework.getInstance().systemContext, getQualifiedClassName(ISpatialQuery));
spatialTracker.open();
}
private function doQuery():void
{
var spatialService:ISpatialQuery = spatialTracker.getService() as ISpatialQuery;
if (spatialService)
{
//build some simple options to return the closest state/province polygon
var sqOptions:SpatialQueryOptions = new SpatialQueryOptions();
sqOptions.dataSource = "ArcWeb:ESRI.AdminAreas.World";
sqOptions.returnDistance = true;
var s2:SearchOptions = new SearchOptions;
var s3:ResultSetRange = new ResultSetRange;
sqOptions.searchOptions = s2;
s2.resultSetRange = s3;
s3.count = 1;
spatialService.findFeaturesByPoint(new GeoPoint(-117, 33), sqOptions, this);
}
}
public function result(data:Object):void
{
try {
var rs:ResultSet = ResultSet(data);
for(var j:int = 0; j < rs.rows.length; j++)
{
for(var k:int = 0; k < rs.fields.length; k++) {
log.htmlText += "<b>" + rs.fields[k].name + ":</b> " + rs.rows[j].fieldValues[k] + ".<br>";
}
}
}
catch(error:Error)
{
Alert.show(error.message);
}
}
public function fault(info:Object):void
{
Alert.show(info.toString());
}
]]>
</mx:Script>
<awx:Framework id="m_framework" apiKey="[MY-API-KEY]">
<awx:SpatialQueryActivator/>
</awx:Framework>
<mx:Button label="Run a SpatialQuery" click="doQuery()"/>
<mx:Panel title="SpatialQuery Results">
<mx:TextArea id="log" minHeight="200" minWidth="300"/>
</mx:Panel>
</mx:Application>