<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns="*"
creationComplete="initMap()"
xmlns:handler="org.openscales.fx.handler.*" width="100%" height="100%">
<mx:Script>
<![CDATA[
import org.openscales.core.events.LayerEvent;
import org.openscales.core.Map;
import org.openscales.core.Trace;
import org.openscales.core.handler.feature.draw.DrawPolygonHandler;
import org.openscales.core.handler.feature.draw.DrawHandler;
import org.openscales.core.events.DrawingEvent;
import org.openscales.core.handler.feature.SelectFeaturesHandler;
import org.openscales.core.handler.Handler;
import org.openscales.core.Map;
import org.openscales.core.Trace;
// Specific imports for this example
import org.openscales.core.feature.LineStringFeature;
import org.openscales.core.feature.MultiLineStringFeature;
import org.openscales.core.feature.MultiPointFeature;
import org.openscales.core.feature.MultiPolygonFeature;
import org.openscales.core.feature.PointFeature;
import org.openscales.core.feature.PolygonFeature;
import org.openscales.core.geometry.Collection;
import org.openscales.core.geometry.Geometry;
import org.openscales.core.geometry.LineString;
import org.openscales.core.geometry.LinearRing;
import org.openscales.core.geometry.MultiLineString;
import org.openscales.core.geometry.MultiPoint;
import org.openscales.core.geometry.MultiPolygon;
import org.openscales.core.geometry.Point;
import org.openscales.core.geometry.Polygon;
import org.openscales.core.layer.FeatureLayer;
import org.openscales.core.style.Rule;
import org.openscales.core.style.Style;
import org.openscales.core.style.fill.SolidFill;
import org.openscales.core.style.symbolizer.PolygonSymbolizer;
import org.openscales.core.style.stroke.Stroke;
import org.openscales.proj4as.ProjProjection;
import org.openscales.core.popup.Anchored;
import org.openscales.core.events.FeatureEvent;
import org.openscales.core.events.MapEvent;
import org.openscales.core.Map;
import org.openscales.core.Trace;
import org.openscales.core.style.Style;
private var popup:Anchored
[Bindable] private var map:Map;
[Bindable] public var displayTrace:Boolean = false;
[Bindable] public var displayFirebugTrace:Boolean = false;
private function initMap():void {
Trace.useFireBugConsole = displayFirebugTrace;
map = fxmap1.map;
map.addEventListener(FeatureEvent.FEATURE_CLICK, onFeatureClick);
}
private function onFeatureClick(event:FeatureEvent):void {
if(popup) {
popup.destroy();
}
popup = null;
popup = new Anchored();
popup.feature = event.feature;
var content:String = "";
if(event.feature.attributes["station_id"] != undefined)
content = content + "<b><font size='20'>" + event.feature.attributes["station_id"] + " (" + event.feature.attributes["STATE_ABBR"] + ")</font></b><br />";
for(var attribute:String in event.feature.attributes) {
if((attribute != "station_id") && (attribute != "coordinates"))
content = content + "<b>" + attribute + "</b> : " + event.feature.attributes[attribute] + "<br />";
}
popup.htmlText = content;
map.addPopup(popup, true);
}
[Bindable] public var wb:Number = 74.051;
[Bindable] public var eb:Number = 11.582;
[Bindable] public var nb:Number = 78.588;
[Bindable] public var sb:Number = 18.477;
private var polygonhandler:DrawPolygonHandler= new DrawPolygonHandler(map,false,graphiclayer);
private var graphiclayer:FeatureLayer;
private var rect:Rectangle = new Rectangle(75,11,79,18);
private var extpoly:PolygonFeature = new PolygonFeature();
]]>
</mx:Script>
<mx:Canvas width="100%" height="100%" id="canvas1" borderStyle="solid">
<os:Map id="fxmap1" height="100%" width="100%" >
<os:WMS name="KarnatakaState"
layers="Final:Karstate_Boundy"
format="image/jpeg"
isBaseLayer="true">
</os:WMS>
<os:WFS name="AWSPOINTS"
typename="Final:atmo_pressure"
projection="EPSG:4326"
version="1.0.0"
useCapabilities="true"
capabilitiesVersion="1.0.0"
style="{Style.getDefaultPointStyle()}">
</os:WFS>
<os:DragHandler id="dragHandler" />
<os:WheelHandler/>
<os:Extent left="74.051"
bottom="11.582"
right="78.588"
top="18.477"/>
<os:Spinner id="spinner"
x="{width / 2}"
y="{height / 2}"/>
<os:MousePosition x="20"
y="675"
displayProjection="EPSG:4326"/>
<os:SelectFeaturesHandler active="true" enableClickSelection="false" enableBoxSelection="false" enableOverSelection="true" />
</os:Map>
<os:ControlPanel x="10" y="10" title="Navigation" paddingRight="0" paddingLeft="0" paddingBottom="0">
<os:PanComponent map="{map}"/>
<mx:HBox width="100%" paddingLeft="5" paddingRight="5">
<os:ZoomComponent map="{map}"/>
<mx:Spacer width="100%" />
<os:ZoomBoxComponent map="{map}" width="32" height="32"/>
</mx:HBox>
<os:OverviewMapComponent map="{map}" width="140">
<os:Mapnik name="Mapnik" isBaseLayer="true"/>
</os:OverviewMapComponent>
</os:ControlPanel>
</mx:Canvas>
</mx:Canvas>
My WFS layer contains the rainfall information. I wanted to set a 4 rules for the quantity of rainfall and i need to show 4 jpeg image as the points for 4 rules,