Posts

Showing posts from September, 2009

Map Layer From Local Shapefile

Image
In this post, I will demo how to load a local shapefile from your hard drive, and overlay it on an map whose base layer is derived from a remote ArcGIS server. Using the Flash Player 10 FileReference API, this task is fairly easy. However, I did not want the user to be prompted for each imported file as a shapefile is composed of a .shp file holding the geometry and a .dbf file holding the attributes. So, the idea is to zip the shp and dbf and load the zip, and then let the application unzip the content and parse the shp and dbf entries. The application is using the Flex API for AGS and makes use of two wonderful as3 library; the shp library from Edwin van Rijkom , and a zip library from David Chang . In this application, I created a custom geometry to take advantage of the coordinate array format in the shapefile reducing the impedance and taking advantage of the "compression". Well, this not truly compressed - this an array of x,y,x,y,etc... rather than an array of MapP...

Horizontal Map Slider

A customer emailed me asking me how to create a horizontal map slider using the Flex API for AGS . The Map component has a property navigationClass to enable users to define a custom navigation class. <esri:Map navigationClass="com.esri.sample.MyNavigation"> In this sample, I defined a reference to the class com.esri.sample.MyNavigation which is a subclass of the Navigation class. public class MyNavigation extends Navigation { public function MyNavigation() { mx_internal::layoutObject.direction = BoxDirection.HORIZONTAL; navigationSliderClass = MyNavigationSlider; } /** * Override the order of the components. */ override protected function addZoomInZoomOutComponents(zoomInButton:UIComponent, zoomOutButton:UIComponent):void { addChild(new Spacer()); addChild(zoomOutButton); addChild(zoomInButton); addChild(new Spacer()...