| Package | com.esri.aws.services |
| Class | public class Site |
| Property | Defined by | ||
|---|---|---|---|
| calcType : String
The type of rings.
| Site | ||
| polygons : Array
The array of polygon areas for the report.
| Site | ||
| ringRadii : Array
The array of radii for the rings.
| Site | ||
| ringUnits : String
The units for the ring's radius.
| Site | ||
| siteLocation : GeoPoint
The x,y coordinates of the site.
| Site | ||
| siteName : String
The site name.
| Site | ||
| calcType | property |
public var calcType:StringThe type of rings. Valid values are "solid" or "hollow". Used with the methods getCustomSiteReport and getSiteReports.
The default value is "solid".
| polygons | property |
public var polygons:ArrayThe array of polygon areas for the report. The report can contain polygons or ringRadii but not both.
| ringRadii | property |
public var ringRadii:ArrayThe array of radii for the rings. The report can contain ringRadii or polygons but not both.
| ringUnits | property |
public var ringUnits:StringThe units for the ring's radius. Valid values are "km" (kilometers) or "miles".
The default value is "miles".
| siteLocation | property |
public var siteLocation:GeoPointThe x,y coordinates of the site. Used to define either the center of the rings or a reference point for the polygons (it does not define the geometry of the polygons).
| siteName | property |
public var siteName:StringThe site name. On site reports, the site name appears as the header of the report. On site map reports, the site name appears as the label for the point (site) on the map.
<?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 Site Demographic Report"
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.IReport;
import com.esri.aws.services.ReportInfo;
import com.esri.aws.services.ReportOptions;
import com.esri.aws.services.Site;
import flash.utils.getQualifiedClassName;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.IResponder;
private var m_report:ReportInfo;
private var reportTracker:ServiceTracker;
private function onComplete():void
{
reportTracker = new ServiceTracker(Framework.getInstance().systemContext, getQualifiedClassName(IReport));
reportTracker.open();
}
private function getSiteReport():void
{
var reportService:IReport = reportTracker.getService() as IReport;
if (reportService)
{
var site:Site = new Site();
site.siteLocation = new GeoPoint(-117.18908, 34.055219);
site.ringRadii = [2];
site.ringUnits = "miles";
site.siteName = "Location #1";
var rOptions:ReportOptions = new ReportOptions;
rOptions.dataSource = "ArcWeb:ESRI.TapestryAreaProfile.US";
rOptions.reportFormat='pdf';
reportService.getSiteReports(site,[rOptions],false,this);
m_info.htmlText = "Creating report ...";
}
}
public function result(data:Object):void
{
var reports:ArrayCollection = ArrayCollection(data);
m_report = reports.getItemAt(0) as ReportInfo;
m_info.htmlText = "Site report in " + m_report.reportFormat + " format using the '" + m_report.dataSource
+ "' data source:<br><u><a href='" + m_report.reportURL + "'>" + m_report.reportURL + "</a></u>";
}
public function fault(info:Object):void
{
Alert.show(info.toString());
}
]]>
</mx:Script>
<awx:Framework id="m_framework" apiKey="[MY-API-KEY]">
<awx:ReportActivator/>
</awx:Framework>
<mx:Button click="getSiteReport()" label="Click to create a 2-mile site report" fontSize="14" />
<mx:Text id="m_info" fontSize="14" text=" "/>
</mx:Application>