Select to view content in your preferred language

drawinginfo.renderer.symbol.source...

1877
4
07-01-2010 02:11 PM
RoyceSimpson
Frequent Contributor
At beta, update 3, I was doing with success...
item.legendImage = o.drawingInfo.renderer.symbol.source;

to get the image source url string for point features.

Now the "source" property returns a ByteArray and crashes the app.

I was using the string to populate a custom Item object as show above. Then using the item in a List object for a custom legend/TOC.

How can I do the same thing now with a ByteArray?  I notice that what used to be a url with PNG file is now like this:
"http://hiatus/ArcGIS/rest/services/dev/EM_Assets/MapServer/32/images/C8D05CC1"

Anyway, I'd just like to be able to use the drawinginfo property (or whatever property would have the image path for point features) for the point symbol.

Thanks much.
Tags (2)
0 Kudos
4 Replies
RoyceSimpson
Frequent Contributor
Here is more verbose code snippet for what I was doing successfully at beta update3...

   protected function titlewindow1_creationCompleteHandler(event:FlexEvent):void
   {
    emLayerList.selectedIndices = selectedIndices;
   
    emAssetLayer.getAllDetails(new AsyncResponder(onResult, onFault));
   }
   private function onResult(allDetailsResult:AllDetails, token:Object = null):void
   {
    _emLayerDetails=allDetailsResult.layersDetails;
   
    _emLayerListDataProvider = new ArrayCollection;
   
    for each (var o:Object in _emLayerDetails)
    {
     var item:Item = new Item;
     item.layerID = o.id;
     item.name = o.name;
      if (o.geometryType == "esriGeometryPoint")
     {
      item.legendImage = o.drawingInfo.renderer.symbol.source;
     }
     _emLayerListDataProvider.addItem(item);
    }
   
   }
0 Kudos
DasaPaddock
Esri Regular Contributor
You could call http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/symbols/Symbol.html#createSwatch() or pass the ByteArray to the Flex Image component as it's source.
0 Kudos
RoyceSimpson
Frequent Contributor
You could call http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/symbols/Symbol.html#createSwatch() or pass the ByteArray to the Flex Image component as it's source.


Thanks Dasa,
I've got the ByteArray working... what would be an example usage of the createSwatch method?  How would I use the resulting object as the source from an Image?
0 Kudos
DasaPaddock
Esri Regular Contributor
You can just add the UIComponent returned by createSwatch() to a container to view a representation of the symbol.
0 Kudos