Being able to flash a shape on the map is a nice usability feature in GIS applications to relate shapes on the map to attributes in a data table or data grid. Also, most GIS users have gotten used to the feature in ArcMAP. I had written up an extension method to the Graphic class in the ESRI Silverlight API to be able to do this easily with a simple function call. Here is the code for the extension method.
public static void Flash( this Graphic graphic )
Flash( graphic, 200, 10 );
public static void Flash( this Graphic graphic, double milliseconds, int repeat )
int count = 1;
repeat = repeat * 2;
Symbol tempSymbol = graphic.Symbol;
Storyboard storyboard = new Storyboard();
storyboard.Duration = TimeSpan.FromMilliseconds( milliseconds );
graphic.Symbol = null;
storyboard.Completed += ( sender, e ) =>
if( count % 2 == 1 )
graphic.Symbol = tempSymbol;
graphic.Symbol = null;
if( count <= repeat )
After including the above extension method in your project just call the ‘Flash’ method on the graphic object
I just added some utility methods to the ESRI Silverlight API Contrib project that do the following
- Determine if a point is inside a polygon. Find the code here
- Buffer a point in the WGS84 spatial reference system. Find the code here
- Midpoint of two points in the WGS84 spatial reference system. Find the code here
- Find the end point given an origin point with a distance and an angle. Find the code here
The above methods should help you avoid some HTTP requests back to the ArcGIS Server to perform these spatial operations. Thus reducing the load on your ArcGIS Server and also increasing the performance of your web application by sticking to Steve Souders’s performance rule number one even though this is a Silverlight client.
There are a lot more things that the Silverlight plug-in is capable of that a lot of web-mapping applications can use. The ESRI Silverlight API packs a lot of punch but there are still a lot more holes to be filled. So, to help fill those holes, I have started an open-source project on CodePlex where I have uploaded some of the useful things that I have been working on. Please find the link to the project below.
The project currently contains the following features.
1) A custom GeoRSS layer type that can be added to the ESRI Silverlight API map.
2) An custom map layer where the image is created dynamically in the browser itself. The current layer regenerates the image for the layer multiples times a second to simulate ripples on the map.
3) Utility classes that will help users load shapefiles from their computer directly on to the Silverlight API map without uploading the shapefile to the server
Please download and use the project as you see fit. Even better, you can sign-up as a contributor and help grow the project and the codebase. I also welcome any and all inputs on other ideas for new features that you might want to see added or critiques of the current codebase.