ESRI Flex API without ESRI

ESRI has done a fantastic job with their Flex API but I recently ran in to a situation where I could not use the ArcGIS Server RESTful services to serve up my base map data. In fact, I couldn’t access anything outside of the local intranet and I was not able to use ArcGIS Server at all so push button publishing was not an option for me. This naturally forced me to look elsewhere to solve my problem…

After searching the web for options, I came across this blog post and as it turns out Mansour Raad is actually a major player on the Flex team at ESRI so I pretty much hit the jackpot by finding his blog. This code example parses a shapefile and displays it as a custom graphics layer which is exactly what I needed! I extracted the ZIP file and modified my Flex project to include the supporting ActionScript Packages and voila…It works as promised. The very basic application reads a shapefile that is or can be in the same directory on your web server as the .swf file itself so there is no need for another web service which was exactly what I needed. The bare minimum amount of mxml code needed to display your shapefile is as follows.

1
2
3
4
5
6
7
8
9
10
11
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:shp="com.esri.shp.*"
    layout="absolute"
    >
    <shp:ShpMap>
        <shp:ShpLayer/>
    </shp:ShpMap>
</mx:Application>

View the compiled project below.

Of course, I modified the heck out of this example so I will post more on that later. Thanks again to Mansour for putting this together for us!

Bookmark and Share
This entry was posted in ESRI, Flex, GeoSpatial and tagged , , . Bookmark the permalink.

2 Responses to ESRI Flex API without ESRI

  1. Marcus Melody says:

    To bad you only thought of ESRI, there are plenty of other technologies that would have served you fine in such a restrictive place.

  2. Adam Estrada says:

    Marcus,

    I agree that there are a lot of technologies out there that can do the same thing. My current customer has an ELA with ESRI and therefore has access to *all* of ESRI’s products. This and this alone is what really turned me on to the solution described above.

    This is an open discussion which means that anyone can post suggestions, hints and tips on how to do the same thing using a different solution. So, please! Let me know another technologies to use and maybe next time I will actually use them ;-)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam protection by WP Captcha-Free