Why my ArcGISLocalFeatureLayer does not bring its graphics after Initialize?

1172
1
Jump to solution
03-14-2014 07:24 AM
Cristian_Galindo
Occasional Contributor III
DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far???

I have created an ArcGISLocalFeatureLayer using a local package that i already setup with some data.

var localCenterlineServiceMPK = new LocalFeatureService { Path = @"C:\myPackage.mpk",                                                                                                                            MaxRecords = 100000 };              localCenterlineServiceMPK.Start();              var lineLayer = new ArcGISLocalFeatureLayer                                 {                                     Url = localCenterlineServiceMPK.UrlFeatureService + "/0",                                      Service = localCenterlineServiceMPK,                                      ID = "MyLayer",                                      LayerName = "MyLayer",                                      Editable = true,                                      DisableClientCaching = true,                                      AutoSave = false,                                      Mode = FeatureLayer.QueryMode.Snapshot,                                      OutFields = new OutFields { "*" }                                 };              lineLayer.Initialize();


I suscribe to the initialize method:

centerlineLayer.Initialized += (sender, args) =>                     {                         var newCenterlineLayer = sender as ArcGISLocalFeatureLayer;                         centerlineLayer.Update();                         this.LayerController.CreateRouteGraphics(routes, newCenterlineLayer);                     };


if i check fot the graphics list in the object newCenterlineLayer before the update it is O;

Afther them, it is still 0
0 Kudos
1 Solution

Accepted Solutions
Cristian_Galindo
Occasional Contributor III

centerlineLayer.Initialized += (sender, args) =>                     {                         var newCenterlineLayer = sender as ArcGISLocalFeatureLayer;                         centerlineLayer.Update();                         this.LayerController.CreateRouteGraphics(routes, newCenterlineLayer);                     };


if i check fot the graphics list in the object newCenterlineLayer before the update it is O;

Afther them, it is still 0


I had to subscribe to the UpdateComplete event...then the layer has all its graphics

View solution in original post

0 Kudos
1 Reply
Cristian_Galindo
Occasional Contributor III

centerlineLayer.Initialized += (sender, args) =>                     {                         var newCenterlineLayer = sender as ArcGISLocalFeatureLayer;                         centerlineLayer.Update();                         this.LayerController.CreateRouteGraphics(routes, newCenterlineLayer);                     };


if i check fot the graphics list in the object newCenterlineLayer before the update it is O;

Afther them, it is still 0


I had to subscribe to the UpdateComplete event...then the layer has all its graphics
0 Kudos