MapFlashViewer Framework is a simple Flash viewer for several (even any, if someone intends to write an implementation) internet map server (at the moment I wrote an implementation for Esri ArcIMS and MapServer).
You can view a working demo of MapFlashViewer for Esri ArcIMS here and the same working demo (with same data) for MapServer here.
Why using Flash?
It has always been a pain writing web user interface for web mapping. The most common approach is to write javascript client code to perform the main GIS actions (zooming, panning, etc etc).
There is also some example of java applet GIS web interface, but the problems with applet are performances, generally very slow.
IMHO the best way to write Rich UI for the web, like a GIS web interface is, is by using Flash: quick, rich OO programming environment (ActionScript), compatible for every browser (not like javascript) and a couple of other reasons.
XML to support any internet map server and environment
Many GIS Web Viewers developed in the past are specific for a particular map server. I wanted to have a solution that could be easily implemented for any map server (ArcIMS, MapServer,…) and any programming envirnoment (Asp .NET, J2EE, php) without the need to write a specific UI for each map server and each environment.
Architecture
To do so I have decided to develop a Flash interface that comunicates with XML to a Controller class (written in C# .NET, Java, Php,…). The controller class will then translate the XML request from Flash (a zoom in, a pan,…) in a specific method that will get a response from a concrete (ArcIMS, MapServer…) class. The response is then translated again in XML and sended back to the MapFlashViewer.
Let’s look at this sample:
The user will perform a typical GIS action on the MapFlashViewer, for example a Zoom In Box. The MapFlashViewer will translate this GIS action in a XML request (x1,y1,x2,y2 are the image map coordinates at the GIS user interface):
<REQUEST action="ZoomInBox" xmin="x1" ymin="y1" xmax="x2" ymax="y2"> </REQEST>
This XML request is then sended to the Controller class. The Controller class and the other classes could be written in any environment supporting XML and the map server you are using (Asp .NET, Asp, J2EE, PHP, …).
The Controller class will translate the XML request (and requested action) from MapFlashViewer into a call to the corresponding method at the MapServerFactory, in this case MapServerFactory.DoZoomBox(ZOOMMODE zoomMode, Double xmin, Double ymin, Double xmax, Double ymax).
The MapServerFactory is an abstract class following the rules of Abstract Factory Design Pattern: the client who is calling the DoZoomBox method doesn’t need to know the specific code implementation for a particular internet map server. He will just need to know the MapServerFactory API, as the variable code implementation for each internet map server will be implemented in the concrete class of the Abstract Factory.
This is also good if at one time you want to change the internet map server: you will not need to change any code, because you are just coding with the MapServerFactory API, not with the ArcIMS ActiveX or .NET or Java connector, neither with MapServer php, C#, java MapScript….
And the most important thing is that you will be able to use the MapFlashViewer framework at the same way with any internet map server and for any development environment.
How to start
With this first release of MapFlashViewer framework you get:
- the MapFlashViewer UI with the first available GIS actions (ZoomIn, ZoomOut, ZoomInBox, ZoomOutBox, ZoomToPreviousExtent, ZoomToFullExtent, Pan)
- the C# implementation for the framework
You can download the code:
- Just the ActionScript for writing your custom implementation
- Both the ActionScript and the C# .NET implementation (for Visual Studio 2003 - .NET Framework 1.1)
Next releases
In my spare time and in the next iteration of this project (end of 2006) I plan to add:
- Identify action
- Table of contents
- J2EE implementation of the framework
If someone is interested in writing:
- Another internet map server implementation (ie: SharpMap), meaning at this time another concrete class for the MapServerFactory abstract class
- Another environment implementation (php…)
- Extending the FlashMapViewer UI with ActionScript
- Some more documentation
you can contact me, I will be glad to assist you in your contribution development.











It look like something I know…..
LOL!!!!
Hi … What’s about next releases? Sorry for my English ))
And what’s about AJAX? Thank’s )
Hi Dmitry,
actually I have not time to work on this for the next months, so maybe you can continue yourself and, if you like, share results
thanks
About AJAX there is already something in the road in the GIS open source community, I don’t know if I will have time to replicate this Flash interface for AJAX
Paolo
hi all
I Download this project but it not run.
I debuged and i look when it run to fucntion GetURLMap() image.save(ImageName, map); it not run.
I try it with .net 2.0 is ok but not show image on Flash. I debuged on Flash it have error beacause it not open file image. I dont understant when image.save() but image not save on computer so flash not open that image.
Some body help me
Sorry with my Question. But when function GetURLMap() will save on Server or Client Machine
Hi MeoMeo, GetURLMap is saving in the server directory specified in the IMAGEURL parameter in mapfile if you are using MapServer, and in the ArcIms output directory specified in map service for ArcIMS. Don’t forget to give this directory write permission for asp .net user.
thanks Paolo Corti.
i permission for asp.net user full. I use Mapserver and my Windows 2003 Server, IIS6. but when i debug it run image.save(ImageName, map); in function GetURLMap(). it stop(). After that i convert that project to Vs2005 (.net 2.0) it run but not show image on flash. And haven’t image on forder “FlashViewer/UI” So i still dont understand when function GetURLMap() u tell is saving in server directory specified therefore i check forder “FlashViewer/UI” but not contain Image. If this Function save image on Server will have many Image on Server. How do manage all Image. Previous i use MapServer & Asp.net i show image on my page dont save on Server. Same Exameple Mapserver&C# in this site.
Can u show me or send to me a other Project i cant it
Sorry MeoMeo, I did’t see your comment, only today i realized about that.
Could you solve your issue?
[...] It is very easy to get started with the MapFlashViewer Framework in the ASP .NET Implementation (C#) I talked about in this post. [...]
First Thank you so much for this application. I was having a similar problem as MeoMeo, I am using VS2005 and for some reason the pictures that are saved using GetURLMap() are not displayed in the mapcontrol (the flashviewer is blank), do you thing it has something to do with the version or am I doing something wrong to set up the application? Thanks Again…
When i download your app MapFlashViewer
but i not run. Into Aps.net so export to image(map) but on the flash is not show ????????
so i premission all this forder contain it!
hi!
i am just studing on .net,& i am developing
an application for which i need a code for zooming & zoom out an image.
plz help me out.
thnx.