Load Local Shapefile with Symbology and Attributes

3940
24
07-14-2010 01:10 PM
by Anonymous User
Not applicable
Original User: tbrophy

All,
This is a question that I hope has been asked before:
Is there any way for my users to load a shapefile into my SFV while retaining the attributes and the symbology of the layer file?

I downloaded and am using �??Shape File Overlay for Sample Viewer�?� from the ArcGIS resource Center, submitted 3-4-2010 by �??HardWork�?�. It works great, but I need it go a step further.
//
Shape File Overlay for Sample Viewer
http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&scriptID=16846
//

I really need the symbology and attributes to make it complete. Has anyone done this? Any suggestions would be incredibly appreciated!!!

I have 2 applications using Web Mercator & WGS84
Sample Flex Viewer: flexviewer-src-1.0.zip (Build 06.12.09)
agslib-1.2.swc
flex_sdk_3.2
Required Adobe Flash Player version 10

Attached are 2 sample shapefiles (and .lyr files) in both projections: (102100, 4326)
0 Kudos
24 Replies
by Anonymous User
Not applicable
Original User: elmeras

Hello.  I believe you and I want the same thing.  I asked as similar question on the thread below:  http://forums.arcgis.com/threads/7364-How-to-display-.dbf-attributes-for-the-Shape-File-Overlay-for-....
I hope we get direction soon.  I will continue to check both of our threads and I will let you know if I receive any feedback.  Thanks - Allison
0 Kudos
ReneRubalcava
Frequent Contributor
A quick look at the description of the Shapefile Overlay description says it uses some of this library
http://code.google.com/p/vanrijkom-flashlibs/wiki/SHP
and Mansour Raad's post here
http://thunderheadxpler.blogspot.com/2008/12/shapefile-viewer.html

The latest comments also state the file has been updated to include the DBF library needed to show attributes, so you may want to try downloading it again. Looks he compiled them into a nice .swc already. The source should be the same as here
http://vanrijkom-flashlibs.googlecode.com/svn/trunk/org/vanrijkom/dbf/

If you check out the example Mansour provides, he also uses that DBF library from the same author to show the attribute data. Unforunately, I don't know of a way to read a .lyr file and parse it in Flex. I don't know enough about the internals of the file for that.
0 Kudos
by Anonymous User
Not applicable
Original User: nathanenge

Have you been sucessful in getting the shapefile overlay to label based on attribute?
0 Kudos
ThomasBrophy
New Contributor III
Have you been sucessful in getting the shapefile overlay to label based on attribute?

Not yet. I was hoping this widget had already been created. This has to be a common workflow. . .
0 Kudos
by Anonymous User
Not applicable
Original User: rjgonzalez73

Have you been sucessful in getting the shapefile overlay to label based on attribute?


Attached is a modified version of the shapefile overlay widget that allows you to modify the symbology, displays the first attribute and supports points, lines and polygons.  You will need to have the original shapefile widget installed and update with the attached files. 

Let me know if this works for you.  If it does, I can post it to the code gallery.

DISCLAIMER: An intern in my group modified the widget, so I didn't write the code.
0 Kudos
ThomasBrophy
New Contributor III
Attached is a modified version of the shapefile overlay widget that allows you to modify the symbology, displays the first attribute and supports points, lines and polygons. You will need to have the original shapefile widget installed and update with the attached files.

Let me know if this works for you. If it does, I can post it to the code gallery.

DISCLAIMER: An intern in my group modified the widget, so I didn't write the code.


Works great! Thank you so much. I got about 12 "3596: Duplicate variable definition" warnings in FB3, but I can live with that.

Have you done much re-projection work in Flex? Robert Scheitlin helped me out a bunch with this before he moved on to his work w/ SFV 2.0. I use Bing base maps in the Web Mercator Aux Sphere (102100) projection for my Flex project. Every time my users want to use this tool, they need to convert their shapefile from WGS 1984 Geographic (4326) à (102100) in ArcMap first. Do you know of a way to convert this �??on-the-fly�?�?

Note: The input shapefiles are always in (4326), so the conversion would always be the same.

Any help would be greatly appreciated. Thanks again for the earlier help. I�??m going to implement it this week.
0 Kudos
by Anonymous User
Not applicable
Original User: nathanenge

It worked for me as well, though I had to search the net for a couple of i_bold icons. thanks for this.
0 Kudos
ThomasBrophy
New Contributor III
[ATTACH]2208[/ATTACH]

Attached are the DrawWidget_wm adjusted files Robert Scheitlin helped me with some time ago. The code might help in the re-project on-the-fly. Thanks again.
0 Kudos
by Anonymous User
Not applicable
Original User: rjgonzalez73

Works great! Thank you so much. I got about 12 "3596: Duplicate variable definition" warnings in FB3, but I can live with that.


I am using FB3 also and I get several 3596: Duplicate variable definition warnings, however the warnings point to my ConfigManager.as file. I am using a heavily customized version of the Sample Viewer, but I can download the original Sample Viewer and install the widget and see if I get the same warnings.

Have you done much re-projection work in Flex? Robert Scheitlin helped me out a bunch with this before he moved on to his work w/ SFV 2.0. I use Bing base maps in the Web Mercator Aux Sphere (102100) projection for my Flex project. Every time my users want to use this tool, they need to convert their shapefile from WGS 1984 Geographic (4326) à (102100) in ArcMap first. Do you know of a way to convert this �??on-the-fly�?�?

Note: The input shapefiles are always in (4326), so the conversion would always be the same.


I am new to Flex and GIS systems in general so I am trying to get up to speed and haven't done any re-projection work.  Sorry I am not able to help with this part of it.  Since I have received help from others on the forums, I wanted to share what I could.
0 Kudos