Posts

Showing posts from November, 2008

ESRI Podcast

Checkout this ESRI podcast about the Flex API for ArcGIS Server. Hope you like it :-)

Polygon and Geodetic Circle Draw Tool

In this sample , I'm demonstrating how to roll you own draw tool using the Flex API for ArcGISServer . I'm attaching mouse listeners to the map and based on the selected tool, I'm drawing a polyline, a circle or a geodetic circle. For the latter, I'm using the undocumented (subject to changes) ProjUtils class to enable me to calculate the distance in meters between two lat/lon values. In addition, this class has the capability to calculate a lat/lon value for a given lat/lon origin, radius and azimuth. When using this sample, watch out for boundary condition (too close to the poles or crossing the date line) as this is a very simple implementation. How to handle these conditions will be another post :-) as usual, you can download the source from here . Have fun, and hope to see some of you at MAX next week.

Serializing Geometries To BlazeDS

Was asked if there is a way to serialize the geometries of a Flex client application using for example BlazeDS . And the answer is 'yes'. All geometries are tagged with a [RemoteClass] metadata. Here is the break down (BTW - this is subject to change in the next version): SpatialReference com.esri.ags.ASSpatialReference MapPoint com.esri.ags.geometry.ASPoint Polyline com.esri.ags.geometry.ASPolyline Polygon com.esri.ags.geometry.ASPolygon Here is for example the Java side of MapPoint : package com.esri.ags.geometry; import com.esri.ags.ASSpatialReference; public class ASPoint implements IASGeometry { public double x; public double y; public ASSpatialReference spatialReference; } The following is a very simple client application that calls a RemoteObject to save a MapPoint instance: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout=...

Speaking At MAX 2008

This year, I will be a speaker at MAX 2008 . The session title is 'Delivery of a Mission-Critical RIA for NATO' and is held on Tuesday at 4:30. Hope to see you all there.

Saving Map Snapshot

This week, while in Redlands for a holistic lab session on the Flex API for ArcGIS Server , a user showed me the following gem. Using the new Flash Player 10 FileReference class, you can create an image snapshot of a map component and save it locally to a file, without a server side service. To compile the application using FlexBuilder, you need to adjust your compiler SDK to version 3.2. <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:esri="http://www.esri.com/2008/ags" layout="vertical" > <mx:Script> <![CDATA[ import mx.graphics.ImageSnapshot; import mx.graphics.codec.JPEGEncoder; private function clickHandler() : void { const decoder: JPEGEncoder = new JPEGEncoder(); map.logoVisible=false; map.scaleBarVisible=false; map.zoomSliderVisible = false; const imageSnapshot:ImageSna...

Find Nearby Place

So... if you are given a latitude and a longitude values and you want to find a nearby place, then you have to check out GeoNames . They have a web API that you can access for free (as in beer :-) Here is a simple usage of the API using the Flex API for AGS: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:esri="http://www.esri.com/2008/ags" layout="absolute" > <mx:Script> <![CDATA[ import com.esri.ags.geometry.MapPoint; import com.esri.ags.Graphic; import com.esri.ags.events.MapMouseEvent; import mx.rpc.events.ResultEvent; private function mapClickHandler( event : MapMouseEvent ) : void { const urlVar : URLVariables = new URLVariables(); urlVar.lat = event.mapPoint.y.toFixed( 6 ); urlVar.lng = event.map...