Select to view content in your preferred language

Draw a circle with a radius in miles

3322
3
04-27-2011 04:07 PM
DaviKucharski
Deactivated User
Hello,

I am trying to update my application from ArcIMS to ArcGIS 10 for Flex 1.3. One of the options I have is to click on the map and enter in a number of miles. The system would then draw a circle around the point I clicked on with a radius in miles equaling the number I entered. The system would also return me back all the geographies that was in the circle. Below is the code used from ArcIMS to do such a process. I was looking for the comparable way to do this in ArcGIS 10.0 API for Flex 1.3. Thanks

        Dim mCircle As aims.Circle = New aims.Circle
        mCircle.Distance = radius // number of miles entered in by the user
        mCircle.X = X // latitude of point clicked on the map
        mCircle.Y = Y //longitude of point clicked on the map

        MapLayerIndex = GetLayerIndexByName(mLayers, ZipLayerName) // get the index of the zip code layer we are using
        ZipLayer = mLayers.Item(MapLayerIndex).Clone() //make a copy of the zip code layer
        ZipLayer.Recordset.Filter.WhereExpression = Where
        ZipLayer.Recordset.Filter.ClearGObjects()
        ZipLayer.Recordset.Filter.AddGObject(mCircle) //Add the circle to the cloned layer to fill it

        If (ZipLayer.Recordset.MoveFirst) Then
            Do    //Loop through the new clone layer to get all of the geographies in the layer
                flds = ZipLayer.Recordset.Fields
                If Not (ZipCodeValues = "") Then ZipCodeValues &= ","
                ZipCodeValues &= flds.FieldValueAsString(FieldIndex)
            Loop While ZipLayer.Recordset.MoveNext
        End If
       At this point ZipCodeValues has a comma-delimited string of geographies
Tags (2)
0 Kudos
3 Replies
BjornSvensson
Esri Regular Contributor
Davi, I'm just curious why you are migrating to the 1.3, instead of the latest 2.x release...
0 Kudos
DaviKucharski
Deactivated User
Davi, I'm just curious why you are migrating to the 1.3, instead of the latest 2.x release...


This application was written by a consulting firm that used both the 1.3 api for flex and some arcims calls. I am trying to convert the arcims processes so get arcims out of our system by august. I don't have time to convert that and upgrade to 2.X.

Let me know.
0 Kudos
gaopeng
New Contributor
Hello,
I am facing this problem,I think you should read the "aims.Circle" file.
I will appreciate you if you can send the VB project to me,my Email is 897710242@qq.com
Thanks
0 Kudos