<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns="*" xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:os="http://openscales.org"
creationComplete="initMap();">
<os:Map id="fxmap" width="100%" height="100%" zoom="13" centerLonLat="-74.011,40.710">
<os:TraceInfo x="{width-200}" y="0" visible="{displayTrace}" />
<os:Mapnik name="Mapnik"
isBaseLayer="true"
proxy="http://openscales.org/proxy.php?url=" />
<os:DragHandler active="false" />
<os:WheelHandler />
<os:Spinner id="spinner" x = "{width / 2}" y = "{height / 2}"/>
<os:MousePosition x="10" y="{height-20}" displayProjection="EPSG:4326"/>
<os:ScaleLine x="{width-100-10}" y="{height-80}" />
<os:WFS name="Tiger poi (WFS)"
url="http://openscales.org/geoserver/wfs"
typename="tiger:poi"
projection="EPSG:4326"
version="1.0.0"
useCapabilities="true"
capabilitiesVersion="1.0.0"
style="{Style.getDefaultPointStyle()}"
numZoomLevels="18"
>
</os:WFS>
<os:WMSGetFeatureInfo url="http://openscales.org/geoserver/wms" layers="tiger:poi" />
<os:SelectFeaturesHandler id="selectFeaturesHandler" active="true" />
</os:Map>
<os:ControlPanel title="Informations about the last selected feature" horizontalAlign="center" x="10" y="10">
<os:FeatureInfoComponent id="featureInfoComponent" map="{map}"
creationComplete="{(selectFeaturesHandler.handler as SelectFeaturesHandler).onSelectedFeature = featureInfoComponent.showInfo;}" />
</os:ControlPanel>
<mx:Script>
<![CDATA[
import org.openscales.core.handler.feature.SelectFeaturesHandler;
import org.openscales.core.Map;
import org.openscales.core.Trace;
import org.openscales.core.style.Style;
import org.openscales.core.events.GetFeatureInfoEvent;
[Bindable] private var map:Map = null;
[Bindable] public var displayTrace:Boolean = false;
[Bindable] public var displayFirebugTrace:Boolean = false;
private function initMap():void {
Trace.useFireBugConsole = displayFirebugTrace;
map=fxmap.map;
map.addEventListener(GetFeatureInfoEvent.GET_FEATURE_INFO_DATA, onFeatureInfoData);
}
private function onFeatureInfoData(event:GetFeatureInfoEvent):void {
Trace.log("Data=" + event.data);
}
]]>
</mx:Script>
</mx:Canvas>