Help a beginner get rolling with Flex and ArcGIS, please!

793
8
07-29-2010 07:52 AM
JeremyCoulson
New Contributor III
Hey, I received a good answer from a post yesterday, so I'm hoping to get equally awesome help today. I am brand new to GIS concepts and have really only worked with Flex by hand-writing some MXML and AS files and compiling them myself without Flash Builder.  We are launching two mapping sites here: one is using the .NET API and the other is using Flex.  I am working with a GIS tech to get the Flex one started; the .NET site is being done by someone else.  We have added one of our own map services to the site and we're seeing our county.  Awesome.  We just don't know where to go from here.  The links below are for sites that are not publicly linked yet.

Our Flex site:
http://208.11.222.208/gis_temp/flexviewer/

The .NET site:
http://gis1.co.frederick.va.us/frederickcountyva/Default.aspx

See how the map seems to show different layers on the .NET site as you zoom in?  How do we accomplish this on the Flex site?  Also, where should we look or what should we read for our next step?  I'm certainly not asking for anyone to do my job for me, but we really would love some pointers for the right direction.

I'll post the code for our config.xml if it's of any help.

<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 ESRI
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions.  See use restrictions in the file:
// <install location>/License.txt
//
////////////////////////////////////////////////////////////////////////////////
-->
<configuration>
    <httpproxy enabled="false">proxy.php</httpproxy>
    <title>Frederick County General Mapping</title>
    <subtitle></subtitle>
    <logo>assets/images/fredc-assembled.png</logo>
    <stylesheet>blackgold.swf</stylesheet>

    <!-- UI elements -->
    <widget right="20" top="55"    config="widgets/MapSwitcher/MapSwitcherWidget.xml" url="widgets/MapSwitcher/MapSwitcherWidget.swf"/>
    <widget left="0"   top="0"     config="widgets/HeaderController/HeaderController.xml" url="widgets/HeaderController/HeaderControllerWidget.swf"/>
    <widget right="1" bottom="1" config="widgets/OverviewMap/OverviewMapWidget.xml" url="widgets/OverviewMap/OverviewMapWidget.swf"/>

 <map initialextent="11428023.5620323 7044712.37840232 11661407.1864131 7229241.03074607" fullextent="11282090.75 6883424.125 11723944.25 7320825.375">
        <basemaps>
   <mapservice label="Frederick County" type="dynamic" visible="true" alpha="1"
      url="http://gis1.co.frederick.va.us/ArcGIS/rest/services/Publicsite/MapServer" />
        </basemaps>
        <operationallayers>

        </operationallayers>
    </map>

    <!-- widgets organized into widget containers that manage close/open etc -->
    <!-- supported layout property options: horizontal(default)|float|vertical|fix-->
    <widgetcontainer layout="float">
        <widget label="Bookmarks"          x="400" y="60" icon="assets/images/i_bookmark.png"
                config="widgets/Bookmark/BookmarkWidget.xml"
                url="widgets/Bookmark/BookmarkWidget.swf"/>
        <widget label="Find an address"   x="70" y="94" preload="open" icon="assets/images/i_target.png"
                config="widgets/Locate/LocateWidget_US.xml"
                url="widgets/Locate/LocateWidget.swf"/>
        <widget label="Louisville Police" x="590" y="300" icon="assets/images/i_police.png"
                config="widgets/Query/QueryWidget_PublicSafety_Louisville.xml"
                url="widgets/Query/QueryWidget.swf"/>
        <widget label="Search"
                icon="assets/images/i_search.png"
                config="widgets/Search/SearchWidget_Louisville.xml"
                url="widgets/Search/SearchWidget.swf"/>
        <widget label="Earthquakes (GeoRSS)"
                icon="assets/images/i_rss.png"
                config="widgets/GeoRSS/GeoRSSWidget.xml"
                url="widgets/GeoRSS/GeoRSSWidget.swf"/>
        <widget label="Draw"
                icon="assets/images/i_draw2.png"
                config="widgets/Draw/DrawWidget.xml"
                url="widgets/Draw/DrawWidget.swf"/>
        <widget label="Print"
                icon="assets/images/i_print.png"
                config="widgets/Print/PrintWidget.xml"
                url="widgets/Print/PrintWidget.swf"/>

        <!--
        <widget label="My first widget"
                icon="assets/images/i_widget.png"
                config="widgets/Samples/HelloWorld/HelloWorldWidget.xml"
                url="widgets/Samples/HelloWorld/HelloWorldWidget.swf"/>
        -->
    </widgetcontainer>

</configuration>


Thanks!

Jeremy
Tags (2)
0 Kudos
8 Replies
MatthewLawton
Occasional Contributor
I feel your pain Jeremy. I have been doing GIS for 12 years, I have been working with ArcGIS Server for about 3 years, I have had a lot of success with the JavaScript API this past year and built several applications with it, but when it comes to the Flex API I just don't "get it".

I tried to work with Flex Builder 3 and modify the Sample Flex Viewer several months ago and it is very confusing to me. I finally ended up editing the config.xml file directly in a text editor just to get my map services and extents working, but now I want to do more development in Flex and I feel lost. Everything seems to be geared toward advanced users. I've tried to edit some MXML files, but I'm not sure if I am even editing the right ones. I've now upgraded to Flash Builder 4 (because we just had to, according to ESRI) and I find it to be equally confusing. I assume I should be editing in the src folder, but then the bin-debug files don't seem to update when I run the debugger. Am I doing something wrong? Is my project set up incorrectly?

The things I want to do seem very simple: Expand the layer list in the Table of Contents. Toggle between 3 or 4 base maps without the viewer going haywire. Filter the Identify layers. But when I find forum posts on these exact topics, it is like the instructions begin two thirds of the way through the process already.

Sorry to rant, but I feel like I did when ESRI first pushed out the .NET API and thought we could all become .NET developers overnight.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeremy,

  I would love to help you but as the links you have posted to compare are both terribly dis-functional it is hard to see what you are trying to compare.
0 Kudos
JeremyCoulson
New Contributor III
Robert, how about this: http://gis.co.frederick.va.us/Freeance/Client/PublicAccess1/Index.html?appconfig=GISMap ?  That's our current Freeance site that is being replaced by ESRI.  I basically want to attain similar functionality.

Matthew, I'm glad I'm not the only frustrated guy around!  It can't be that hard, though.  I see plenty of awesome working Flex sites out there, so I'm obviously just missing something simple.

Jeremy
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeremy,

   So for the "Base Map  Services   Planning  Environment  Political" tabs at the top of your app that can simply be done by adding the map service or services to the config.xml and you can either control their visibility by using the operational layer control or adding a buttonbar to your map and have the click set the visibility of the layer. All the searching capability can be replicated by just configuring the searchwidget with multiple queries in it's xml configuration file. The save map image code is available in the old forums. The find Lat Long coordinates would not be hard to develop a widget for this. So I would say start by configuring the searchwidget.
0 Kudos
MattWilliams
New Contributor
Not sure how my post will be received, but if you want to LEARN Flex and ArcGIS Flex API I'd build an application piecemeal using the variety of samples on the samples page. If you want to get an application up and running quickly then go with the Flex Sample Viewer. You probably won't learn flex as well, but turning necessary widgets on/off for your application is simple enough. I think the reason why it seems people are starting the code in the middle somewhere is they are asking questions concerning the Flex Sample Viewer (which isn't specified in the post a lot of times).

I also want to add that if its the development environment that's confusing, you might want to check out Adobe sites for tutorials or any of the hundreds of websites that can familiarize you with it. Really, though, getting comfortable with the IDE will come over time with usage.

I could be wrong here and am open to other enlightening points of view.
0 Kudos
MatthewLawton
Occasional Contributor
Thanks for your thoughts, Matt. I have been trying to learn by modifying the Flex Sample Viewer and the VIPER code (built from FSV). I will keep your comments in mind as this may not be the best way for me to actually learn Flex. But I still have to produce something for my boss 😄

I had a lot of trouble trying to learn Visual Studio when the Web ADF came out. It was a totally foreign environment for me. When the JavaScript API was relesed it was a blessing because I could return to the HTML and JavaScript fundamentals I had learned with ArcIMS. Unfortunately Flex has put me back into the world of an IDE. I guess I just feel constricted working within the confines of an IDE, especially when I am also trying to learn a new programming language. It is like trying to learn English by using Microsoft Word.
0 Kudos
DrewDowling
Occasional Contributor III
Jeremy

I couldn't agree with    laosuey more. I started flex 2 years ago after several years of arcObjects programming. I tried to dive straight into the sample view. After a couple of days I was confused and discouraged so I went to the Adobe site and spent some time on the "Lean flex in a week". I did the first 2 or 3 days of this and then went straight to the esri flex samples. I found enough examples here that I could copy to easily create my first site.

After this it was easier to get back to customizing the sample viewer.

fyi I'm getting a sandbox security violation when I try to access your link. Have you set your crossdomain.xml file?
0 Kudos
SheriNorton
Occasional Contributor II
I'm taking a course through GeospatialTrainging.com - not cheap, but certainly more feasible than an ESRI course, and self-paced for a full year.
0 Kudos