Packagecom.esri.aws.awx.map.layers.overlays.style
Classpublic class ImageMarkerStyle
InheritanceImageMarkerStyle Inheritance BaseMarkerStyle Inheritance BaseStyle

Style to render a marker using an image.
  • Note 1: although styles have public properties (such as color, fill, alpha) they should not be edited after construction.
  • Note 2: The image does not have to reside on the same server where the application was downloaded from. Refer to http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14213 for additional information.
  • View the examples.

    See also

    Live Sample - Explore Markers - Flex API


    Public Properties
     PropertyDefined by
      alpha : Number
    The transparency factor from 0 to 1.
    ImageMarkerStyle
      anchorX : Number
    The horizontal offset in pixels.
    ImageMarkerStyle
      anchorY : Number
    The vertical offset in pixels.
    ImageMarkerStyle
      source : String
    The image URL.
    ImageMarkerStyle
    Public Methods
     MethodDefined by
      
    ImageMarkerStyle(source:String = "http://www.arcwebservices.com/awx2lab/images/id.png", anchorX:Number = 8, anchorY:Number = 8, alpha:Number = 1.0)
    Creates a new ImageMarkerStyle.
    ImageMarkerStyle
     Inherited
    cleanUp(overlayObject:OverlayObject):void
    Cleans up the OverlayObject to restore it to its original state.
    BaseStyle
     Inherited
    draw(overlayObject:OverlayObject, projectionModel:IProjectionModel):void
    Creates the default ToolTip (lat/lon) if overlayObject.toolTip is null.
    BaseMarkerStyle
    Protected Methods
     MethodDefined by
      
    drawMarker(overlayObject:OverlayObject, projectionModel:IProjectionModel):void
    All subclasses MUST override this function to draw the marker.
    ImageMarkerStyle
    Property detail
    alphaproperty
    public var alpha:Number

    The transparency factor from 0 to 1.

    The default value is 1.0 .

    anchorXproperty 
    public var anchorX:Number

    The horizontal offset in pixels.

    The default value is 8.

    anchorYproperty 
    public var anchorY:Number

    The vertical offset in pixels.

    The default value is 8 .

    sourceproperty 
    public var source:String

    The image URL.

    The default value is http://www.arcwebservices.com/awx2lab/images/id.png.

    Constructor detail
    ImageMarkerStyle()constructor
    public function ImageMarkerStyle(source:String = "http://www.arcwebservices.com/awx2lab/images/id.png", anchorX:Number = 8, anchorY:Number = 8, alpha:Number = 1.0)

    Creates a new ImageMarkerStyle. To center an image, set the anchorX to half the image width, and the anchorY to half the image height.

    Parameters
    source:String (default = "http://www.arcwebservices.com/awx2lab/images/id.png") — the image URL.
     
    anchorX:Number (default = 8) — the horizontal offset in pixels.
     
    anchorY:Number (default = 8) — the vertical offset in pixels.
     
    alpha:Number (default = 1.0) — the transparency factor from 0 to 1.
    Method detail
    drawMarker()method
    protected override function drawMarker(overlayObject:OverlayObject, projectionModel:IProjectionModel):void

    All subclasses MUST override this function to draw the marker.

    Parameters
    overlayObject:OverlayObject — the overlay object to draw on.
     
    projectionModel:IProjectionModel — the projection model.
    Examples
    Several_MarkerStyle_Examples
    <?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"
        creationComplete="onCreationComplete()"
        styleName="plain">
        <mx:Script>
            <![CDATA[
                // markers
                import com.esri.aws.awx.geom.MarkerShape;
                import com.esri.aws.awx.map.layers.overlays.Marker;
                // specific marker styles
                import com.esri.aws.awx.map.layers.overlays.style.CircleMarkerStyle;
                import com.esri.aws.awx.map.layers.overlays.style.ImageMarkerStyle;
                import com.esri.aws.awx.map.layers.overlays.style.SquareMarkerStyle;
                import com.esri.aws.awx.map.layers.overlays.style.StarMarkerStyle;
                import com.esri.aws.awx.map.layers.overlays.style.TriangleMarkerStyle;
                // Note 'markerLayer' is one of three default OverlayLayers that are part of the default map
    
                private function onCreationComplete():void
                {
                    // default CircleMarkerStyle is a red circle
                    map.markerLayer.addOverlay(new Marker(new MarkerShape(21,-160),new CircleMarkerStyle()));
                    map.markerLayer.addOverlay(new Marker(new MarkerShape(21,-159),new CircleMarkerStyle(10,1,0x0000ff,1,0xffffff,0.2)));
    
                    // default SquareMarkerStyle is a red square
                    map.markerLayer.addOverlay(new Marker(new MarkerShape(20,-160),new SquareMarkerStyle()));
                    map.markerLayer.addOverlay(new Marker(new MarkerShape(20,-159),new SquareMarkerStyle(20,2,0x000000,1,0xffff00,0.2,45)));
    
                    // default StarMarkerStyle is a red star
                    map.markerLayer.addOverlay(new Marker(new MarkerShape(19,-160), new StarMarkerStyle()));
                    map.markerLayer.addOverlay(new Marker(new MarkerShape(19,-159), new StarMarkerStyle(6,10,20,2,0xFF0000,1,0xffff00,0.3,45)));
    
                    // default TriangleMarkerStyle is a red triangle
                    map.markerLayer.addOverlay(new Marker(new MarkerShape(18,-160),new TriangleMarkerStyle()));
                    map.markerLayer.addOverlay(new Marker(new MarkerShape(18,-159),new TriangleMarkerStyle(30,2,0x00ff00,1,0x0000ff,0.2,0)));
    
                    // default ImageMarkerStyle is a black "i"
                    map.markerLayer.addOverlay(new Marker(new MarkerShape(17,-160),new ImageMarkerStyle()));
                    // the sandcastle.gif is 25x25 so we center it with 12x12
                    map.markerLayer.addOverlay(new Marker(new MarkerShape(17,-159),new ImageMarkerStyle("http://www.geographynetwork.com/out/mapicons/raster/sandcastle.gif", 12,12)));
                }
            ]]>
        </mx:Script>
    
        <awx:Framework apiKey="[YOUR AWX API KEY]"/>
        <mx:Text color="0xFF0000" htmlText="&lt;b&gt;Default circle, square, star, and triangle are all red.&lt;/b&gt;" />
        <awx:Map id="map" centerGeoY="19" centerGeoX="-159" scale="8000000"/>
    </mx:Application>