[mapguide-users] Re: Create feature source

Lee lee.wade at eurocoast.nsw.gov.au
Sun Nov 28 18:06:56 EST 2010


Hi, what would be the code to create an oracle feature source  at
(Library://New Feature source.FeatureSource)
 
to replace the following code:

// Create the Feature Source (SDF)

                MgFeatureSchema sdfSchema = this.CreateFilterSchema();
                MgCreateSdfParams sdfParams = new MgCreateSdfParams("MAPCS",
map.GetMapSRS(), sdfSchema);
                featureService.CreateFeatureSource(sdfResId, sdfParams);

                // Create the Layer

                MgResourceIdentifier layerResId = new
MgResourceIdentifier("Session:" + GetParameter(this.args, "SESSION") +
"//Filter.LayerDefinition");
                String layerDefinition =
File.ReadAllText(GetQueryXmlTemplatePath());
                layerDefinition = layerDefinition.Replace("%s",
sdfResId.ToString());

                MgByteReader reader = new MgByteReader(layerDefinition,
"text/xml");
                resourceService.SetResource(layerResId, reader, null);

                layer = new MgLayer(layerResId, resourceService);

                layer.SetName("_QuerySpatialFilter");
                layer.SetLegendLabel("_QuerySpatialFilter");
                layer.SetDisplayInLegend(false);
                layer.SetSelectable(false);

                layers.Insert(0, layer);
            }

thank you
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Create-feature-source-tp5768882p5782797.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list