Select to view content in your preferred language

custom SWF symbols, each with their own data feed

2131
2
04-18-2013 05:53 AM
JasonCantrell
Deactivated User
I've been tasked with taking an older Flex map application and adding it's functionality to my current application that uses the ArcGIS API.  The older application displays incoming data from wind sensors (via an LDMP server) using animated SWF windsocks.  This application uses a custom component to display the SWF for each sensor on a static map image (using x,y coordinates rather than lat, long).  The windsock component contains the SWF and the necessary code for updating the SWF with new data.

I'm wondering if anyone can suggest an approach for dealing with this.  I haven't done anything like this with the ArcGIS API before, so I'm at a bit of a loss.  My first idea was to use a PictureMarkerSymbol to display the SWF for my graphics layer, and then display all the wind sensor points within that graphics layer.  But the more I thought about it, I realized that won't work since each symbol needs it's own data feed from the LDMP server and that won't be possible if each graphic is using the same PictureMarkerSymbol.  I'm guessing I'll need to create a custom symbol that uses a renderer and/or an ager of some sort.  I haven't used these much at all so far in my experiences with the ArcGIS API, so I'm not sure how to start with this approach.  There aren't many examples for using renderers on this site, so if anyone could point me to some examples of using custom symbols and/or renderers with SWFs (preferably displaying in the same graphics layer) I would very much appreciate it.  A basic explanation of renderers and their use would be very helpful as well.
Tags (2)
0 Kudos
2 Replies
YannCabon
Esri Contributor
Hi Jason,

As you noticed there are several approach to solve your issue:

The renderer is great to reuse the symbols and also to be able to break on several attributes of the Graphic.
http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/renderers/package-detail.html

Maybe the one you are looking for is the UniqueValueRenderer:
http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/renderers/UniqueValueRenderer.html

Creating a custom Renderer is also possible by implementing IRenderer.
The function to implement is getSymbol(graphic:Graphic):Symbol
Inside your implementation you can do whatever you want to return a Symbol based on a Graphic.
When the layer will draw, it will go through each Graphic and call that function to get the symbol to draw with.
0 Kudos
omega_cancer
Frequent Contributor
Hi Jason,

As you noticed there are several approach to solve your issue:

The renderer is great to reuse the symbols and also to be able to break on several attributes of the Graphic.
http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/renderers/package-detail.html

Maybe the one you are looking for is the UniqueValueRenderer:
http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/renderers/UniqueValueRenderer.html

Creating a custom Renderer is also possible by implementing IRenderer.
The function to implement is getSymbol(graphic:Graphic):Symbol
Inside your implementation you can do whatever you want to return a Symbol based on a Graphic.
When the layer will draw, it will go through each Graphic and call that function to get the symbol to draw with.



I would recommend first approach.
0 Kudos