My Idea Factory - By Ludovic Perrichon

Flash, SharePoint, SP2010, SPServices, WebPart

Map web-part with Flash

This is a project I have made in 2013. I had to integrated a flash map have into a Sharepoint 2010 web-part.

See the flash map post here.

I am going to explain the technical main idea of the project, but here is a demo :

Sharepoint 2010 - Flash Map Web Part on Vimeo.

Before to keep going you have to set the Browser File Handling of your web application to Permissive ( Manage web applications -> Select your web application -> General Settings ). Otherwise, it will download your flash file instead of playing it.

About the Visual studio solution.

I have got two lists :

  • A list for the States of Australia, which got three fileds, the Title, the State Short Name which is text type field with as content QLD for example, and the Description which is a note type field.
  • A list for some points, which got five fields, the Title, the Color which is the color of the point, the X position of the point, the Y position of the point and the Description which is a note type field. I have got some custom forms for the Edit and New form to easily get the color by using a jQuery plug-in which is Color Picker and to easily get the X and Y position by using a function of my flash map I have made.

I have got two modules :

  • One for the masterpage. Which is exactly the same than the default one, but with a call to jQuery. Because I am going to use SPServices to load the Description when I click on a state or a point.
  • And another one for all the Style Library files (FLV file, JS, CSS, Images …).

And of course I have got a Visual Web-Part.

I have done this little graphic to quickly show you what I have described below :

All the map has to be settable. So I added the C# code for all the customs parameters in WebPartFlashMap.cs. Below is an example of the code I add for the parameters.

public static string unactiveColor = "b5b5b5";  
[Category("Map settings"),
WebDisplayName("Un-active states color"),  
WebDescription("Please Choose a color")]  
public string _unactiveColor  
get { return unactiveColor; }  
set { unactiveColor = value; }  

In WebPart_ Flash_MapUserControl.ascx.cs. I added all the C# code which will read the custom parameters and all the lists content to generate the HTML web-part of the flash map of Australia.