feature layer with no url

3168
7
09-08-2010 08:23 AM
abukhan
New Contributor III
In arcgis flex api 2, I was trying to use feature layer...

However I found if there is no url, feature layer does not show points

What I mean If I return point data from database and put them in array collection and assign that to graphic provider  of the feature layer, it does not show up

Is this right? Can I show feature layer points from database without mentioning url?
Tags (2)
0 Kudos
7 Replies
DasaPaddock
Esri Regular Contributor
FeatureLayer.graphicProvider should be treated as read-only:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/FeatureLayer.html#graphicProvider

You should be using FeatureLayer.featureCollection:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/FeatureLayer.html#featureCollection

Note: If you're not using a temporal renderer, then there's no advantage to using FeatureLayer.featureCollection over GraphicsLayer.graphicProvider.
0 Kudos
abukhan
New Contributor III
The reason I was trying to use feature layer for points (instead of graphic layer) was to use mode=Snapshot (of feature layer attributes)..

I have a large data with over 10000 data points and I thought if I use mode=snapshot, it will help faster panning and zooming...

What is the best option for this scenerio?
0 Kudos
DasaPaddock
Esri Regular Contributor
The FeatureLayer in snapshot mode or when using a FeatureCollection is equivalent to using a GraphicsLayer. If you could expose a REST service, you could use the FeatureLayer in onDemand mode so that it would only query and show the points inside the current extent.

How many points do you need to show at once? Using a clusterer may be a solution.
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/GraphicsLayer.html#clusterer
http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=FeatureLayerClustering
0 Kudos
abukhan
New Contributor III
Here is the scenerio:

The points are dynamic (comes from sql server stored proc with user input variable), so I can not make them a layer..

All the points come, and I store them in a arraycollection...

I didnot use any amf (I donot know if I can use useAMF in arcgis server 10)..

I put them in graphiclayer and assign graphicprovider = arraycollection

I did clustering, and it works.

However when it goes to symbols using renderer(I give option to user to see symbols anytime with button click and I make clusterer=null), then panning and zooming becomes slower...

What are the best options in this case?
0 Kudos
DasaPaddock
Esri Regular Contributor
How are you transmitting the points from the server? HTTPService? If you use something like BlazeDS you can use RemoteObject which uses AMF. (There's other solutions for PHP, .Net, etc.)
http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/

What kind of symbols are you using? SimpleMarkerSymol without an outline are the fastest.
0 Kudos
abukhan
New Contributor III
I am using Httpservice in flex and it connects a .net page which gets data from sql server and return it as xml...
0 Kudos
DasaPaddock
Esri Regular Contributor
0 Kudos