[mapguide-users] Creation of a FeatureSource

jerome.duckers jerome.duckers at gmail.com
Mon Sep 10 06:31:32 PDT 2012


Hi,
 
I have a problem to create a FeatureSource with the MgResourceService
 
My Code is very simple: 
 
string xml =  DynamicLayer.GetTemplate("MgData_test.templ");
 
MgResourceIdentifier dataId =
DynamicLayer.SaveSessionResource("test.FeatureSource", xml, sessionId,
resourceSrvc);
xml = DynamicLayer.GetTemplate("MgLayer_test.templ");
MgResourceIdentifier layerId =
DynamicLayer.SaveSessionResource("test.LayerDefinition", xml, sessionId,
resourceSrvc);
new
MgLayer(layerId, resourceSrvc); 
...
map.Save(resourceSrvc, mapStateId);
the function SaveSessionResource is: 
public
static MgResourceIdentifier SaveSessionResource(string name, string content,
string sessionId, MgResourceService resourceService) 
{
string resourceId = string.Format("Session:{0}//{1}" ,sessionId, name); 
var mgResourceIdentifier = new MgResourceIdentifier(resourceId); 
resourceService.SetResource(mgResourceIdentifier, 
new MgByteReader(content, "text/xml"), null); 
return mgResourceIdentifier; 
}
 


The Layer appears in my legend, everything is correct, but nothing appears
on the map. 
I thing that the featureSource is not created ! I miss something ?
I try to create in Maestro a Layer based on my FeatureSource, but nothing
appears.
The featureSource is based on a SDF, that is not empty.
 
 
Thanks a lot.
Best Regards.
Jérôme.



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Creation-of-a-FeatureSource-tp5000822.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list