CreateRasterLayerDefinitionXml
This function creates layer definition information for a raster image feature and returns it as a string containing XML data. It takes two parameters: the identifier of the feature source and the string name of the raster feature.
- Create an OSGeo.MapGuide.Schema.LayerDefinition.GridColorType object.
- Create an OSGeo.MapGuide.Schema.LayerDefinition.GridColorRuleType object. Embed the GridColorType object in the GridColorRuleType object.
- Create an OSGeo.MapGuide.Schema.LayerDefinition.GridColorStylizationType object. Embed the GridColorRuleType object in the GridColorStylizationType object.
- Create an OSGeo.MapGuide.Schema.LayerDefinition.GridColorRangeType object. Embed the GridColorStylizationType object in the GridColorRangeType object.
- Create an OSGeo.MapGuide.Schema.LayerDefinition.GridLayerDefinitionType object. Embed the GridColorRangeType object in the GridLayerDefinitionType object.
- Create an OSGeo.MapGuide.Schema.LayerDefinition.LayerDefinitionType object. Embed the GridLayerDefinitionType object in the LayerDefinitionType object.
- Serialize the resulting xml LayerDefinitionType object as a string.
Here is an example of a raster layer definition type.
<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n
<LayerDefinitionType xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n
<GridLayerDefinition>\r\n
<ResourceId>Library://Data/Raster/bayarea.FeatureSource</ResourceId>\r\n
<FeatureName>rasters:bayarea</FeatureName>\r\n
<Geometry>Image</Geometry>\r\n
<GridScaleRange>\r\n
<ColorStyle>\r\n
<ColorRule>\r\n
<LegendLabel />\r\n
<Color>\r\n
<Band>1</Band>\r\n
</Color>\r\n
</ColorRule>\r\n
</ColorStyle>\r\n
<RebuildFactor>1</RebuildFactor>\r\n
</GridScaleRange>\r\n
</GridLayerDefinition>\r\n
</LayerDefinitionType>