Access Graphics on AGSFeatureLayer

2271
7
Jump to solution
06-25-2012 01:52 PM
juliangarcia-anton
New Contributor
Hi,

I am trying to access the graphics NSMutableArray on an AGSFeatureLayer as soon as it is loaded, in order to add a new attribute to each of its graphics.

I have subscribed to the LayerDidLoad notification, but when the notification is raised, the layer received as an argument, has an empty graphics array.
The layer displays fine, and I can see the features on the map.

Am I doing anything wrong ? Is there another way to capture when a layer has fully loaded ?

Thanks in advance.
julian.
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
Currently there is no way in the SDK to know when all graphics are loaded in the graphics array of feature layer. However, it is not recommended to make any modifications to the graphics array as it is maintained by a feature layer.

Regards,
Nimesh

View solution in original post

0 Kudos
7 Replies
NimeshJarecha
Esri Regular Contributor
Currently there is no way in the SDK to know when all graphics are loaded in the graphics array of feature layer. However, it is not recommended to make any modifications to the graphics array as it is maintained by a feature layer.

Regards,
Nimesh
0 Kudos
juliangarcia-anton
New Contributor
Hi Nimesh,

Thanks for your reply. Ok I will take your advice abour the graphics array.

Although I think it is very reasonable to want to know when a layer has fully loaded, maybe for other tasks, so I hope it gets added to the runtime in the future. In the Silverlight API we can use the UpdateCompleted event to find when the graphics have been populated on a FeatureLayer.

Thanks again.
j.
0 Kudos
AdamKaupisch
New Contributor
Hi, I'm a (Java) software developer trying to understand ESRI. In doing so, I'm trying to understand the concepts/terminolgy, so if I am off, please let me know!

background:
I understand a Feature Service is basically a Web Service. You query it and it returns data to be displayed. A traditional web service can be setup to send a checksum along with the data...I can then run the same checksum on the data I received and compare to see if they match (if they dont, then I know I need to re-request the data).

Does ESRI support this?

Is there a way to verfiy that the data I receive (based on the request I made) is indeed all the information that was sent?

If not, is there a plan to implement this?

if you are wondering why this would be important, imagine we are trying to get real-time fire data in an area with spotty internet connectivity. Not receiving all of that information could put people in danger. If they are notified that the data might be incomplete, it might save a life.

Thanks
0 Kudos
DiveshGoyal
Esri Regular Contributor
Hi,

I am trying to access the graphics NSMutableArray on an AGSFeatureLayer as soon as it is loaded, in order to add a new attribute to each of its graphics.

I have subscribed to the LayerDidLoad notification, but when the notification is raised, the layer received as an argument, has an empty graphics array.
The layer displays fine, and I can see the features on the map.

Am I doing anything wrong ? Is there another way to capture when a layer has fully loaded ?

Thanks in advance.
julian.


From version 10.1.1 of the SDK, a feature layer posts the AGSFeatureLayerDidLoadFeaturesNotification  notification whenever it finishes downloading features from the web server. You can register an observer for this notification.
0 Kudos
AdamKaupisch
New Contributor
so is there an internal checksum that is done to verify that all data was sent and upon that it triggers that notification?
0 Kudos
DiveshGoyal
Esri Regular Contributor
so is there an internal checksum that is done to verify that all data was sent and upon that it triggers that notification?


All communication with the web service is minifed using gzip. The gzip protocol includes computing CRC checksums.
If some of the data is accidentally truncated or if the payload is incomplete, none of the features will load.
0 Kudos
ShawnCastrianni
New Contributor II
This new AGSFeatureLayerDidLoadFeaturesNotification notification for iOS is FANTASTIC!  I have been waiting for this for a long time.  However, where is the equivalent listener for Android??  Does Android not support this type of callback for feature layers?
0 Kudos