Adding Individual Feature Layers to the Flex Viewer

2557
15
03-08-2011 09:22 AM
AmySmith1
New Contributor II
Hello!

I'm in the process of learning how to use the ArcGIS Viewer for Flex. I have a basic question you seasoned Flex Viewer / API folks will more than likely be able to answer!

I'd like to add a layer from a map service to my map, using the type = "feature" attribute and feature layer url in the config.xml document. I noticed that when I do this, as opposed to adding the service to which it belongs (using type="dynamic"), it doesn't display on my map. I'm guessing this has something to do with the fact that the symbology is contained in the service and not the individual layers. Am I on the right track? How can I add individual layers and make them visible on my Flex Viewer map?

Any advice would be greatly appreciated. Thanks!

-Amy Smith
Tags (2)
0 Kudos
15 Replies
ChrisBrannin
Occasional Contributor
Oh yes, but without using a widget and to be able to just click on the features to pull the attributes, then they must be ArcSDE?
0 Kudos
JonFisher
New Contributor III
Oh yes, but without using a widget and to be able to just click on the features to pull the attributes, then they must be ArcSDE?


Assuming you mean clicking on a feature in the Flex Viewer and have the simple info window pop up, that does require a feature service but I don't think you need to base that service on data in SDE.
0 Kudos
ChrisBrannin
Occasional Contributor
Actually I am seeing this now. So I have to publish my MXD with feature access and then write the code as type="feature" and myserver/***/featureservice/(layer#)

I am seeing a strange error though when I try and upload to my server:

Service was published but cannot be started due to: Configuration Campus_assets_cartlab.MapServer can not be started.
Server Object instance creation failed on machine gis.

any thoughts?
0 Kudos
JonFisher
New Contributor III
Actually I am seeing this now. So I have to publish my MXD with feature access and then write the code as type="feature" and myserver/***/featureservice/(layer#)

I am seeing a strange error though when I try and upload to my server:

Service was published but cannot be started due to: Configuration Campus_assets_cartlab.MapServer can not be started.
Server Object instance creation failed on machine gis.

any thoughts?


One possible cause of this error seems to be having a map extent that goes off the edges of the earth. I've noticed that if I set my data frame properties to fixed extent, and make sure that none of the four extent values is too high or low. For example, if your map service is in Web Mercator, make sure that the left and bottom are no less than -20,037,507.0671618 m, and the top and right are no more than 20,037,507.0671618 m. For geographic it would be y between 90 and -90 and x between -180 and 180. Also set the extent used by full extent command to be the same.

See if that helps? I've had that not very specific or helpful error many times, and the above often seems to fix it. I'd love to know some other possible fixes though.
0 Kudos
NathanEnge
Esri Contributor
Actually I am seeing this now. So I have to publish my MXD with feature access and then write the code as type="feature" and myserver/***/featureservice/(layer#)

I am seeing a strange error though when I try and upload to my server:

Service was published but cannot be started due to: Configuration Campus_assets_cartlab.MapServer can not be started.
Server Object instance creation failed on machine gis.

any thoughts?

Take a look at the config logs. I suspect you may be seeing something like this in there:
Layer: XXXXXXXXXX does not use SDE GeoDatabase. Feature Access capabilty requires the data to be on SDE GeoDatabase.
0 Kudos
ChrisBrannin
Occasional Contributor
I did not check the logs (duh) but I did place all my feature classes into the SDE and now it uploaded like a charm. So yes loading these onto the SDE was the ticket. Thanks for all the help!

Cheers
Chris
0 Kudos