ThinkGeo.com    |     Documentation    |     Premium Support

Question about GeoCache in regards to WFSFeatureLayer

Hello,


I would like to describe a scenario I am hoping to acheive.


I have two map controls. One serves as a locus map. When I add a layer to one map I add it to both and so I use CloneDeep to create the locus map layers. I am utilizing a GeoCache on my WFSFeatureLayers as it significantly is improving performance.


The situation I am running into is that I must retrieve from the WFS Server twice. I would like to cache the features once and if at all possible I would like to then like to place the exact contents of the first GeoCache into the locus map layers GeoCache so as not to retrieve from the WFS Server unneccesarily a second time. Is there a fluid means of doing so?


Thanks,


Nelson



Nelson,


Thanks for your post and question!
 
Probably there are 2 solutions for your problem as following:
1) The 2 WfsFeatureLayersshare the same GeoCache.

FeatureCache featureCache = new FeatureCache();

WfsFeatureLayer layer1;
WfsFeatureLayer layer2;
layer1.FeatureSource.GeoCache = featureCache;
layer2.FeatureSource.GeoCache = featureCache;

2) Try to share the same layer between the two map controls.


Any more questions feel free to let me know.
 
Thanks.
 
Yale