0% found this document useful (0 votes)
31 views

Developer Samples Guide

The document describes XML files used in a BuildMap sample. It summarizes two XML files: 1) Zoning.layer which specifies properties for drawing a zoning map layer, including a reference to the Zoning.FeatureSource resource. 2) Zoning.FeatureSource which defines properties of an SDF feature source for the zoning data, pointing to its location on disk. It concludes by explaining these resources can be added in code using the MgResourceService.

Uploaded by

Mathias Eder
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Developer Samples Guide

The document describes XML files used in a BuildMap sample. It summarizes two XML files: 1) Zoning.layer which specifies properties for drawing a zoning map layer, including a reference to the Zoning.FeatureSource resource. 2) Zoning.FeatureSource which defines properties of an SDF feature source for the zoning data, pointing to its location on disk. It concludes by explaining these resources can be added in code using the MgResourceService.

Uploaded by

Mathias Eder
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

The XML Files

This sample uses data from the BuildMap developer sample. When you run
BuildMap, it writes these files to the directory containing BuildMap.dll. See
the Developer Samples Guide for details.
One file is Zoning.layer. This specifies all the properties for drawing one layer
in a map. Note the <ResourceId> element, which refers to the resource for
the feature source.
<?xml version="1.0" encoding="utf-8"?>
<LayerDefinition
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
version="1.0.0">
<VectorLayerDefinition>
<ResourceId>Library://Data/SDF/Zoning.FeatureSource
</ResourceId>
<FeatureName>Schema:Zoning</FeatureName>
<FeatureNameType>FeatureClass</FeatureNameType>
<Geometry>Geometry</Geometry>
<VectorScaleRange>
<AreaTypeStyle>
<AreaRule>
<LegendLabel />
<AreaSymbolization2D>
<Fill>
<FillPattern>Solid</FillPattern>
<ForegroundColor>a03cafda</ForegroundColor>
<BackgroundColor>FF000000</BackgroundColor>
</Fill>
<Stroke>
<LineStyle>Solid</LineStyle>
<Thickness>0.0</Thickness>
<Color>FF000000</Color>
<Unit>Centimeters</Unit>
</Stroke>
</AreaSymbolization2D>
</AreaRule>
</AreaTypeStyle>
</VectorScaleRange>
</VectorLayerDefinition>
</LayerDefinition>

12 | Chapter 2 Resources

The second file is Zoning.FeatureSource, which defines the properties of an SDF


feature source. The File parameter points to the location on disk. See Feature
Service on page 17 for more details.
<?xml version="1.0" encoding="utf-8"?>
<FeatureSource xmlns:xsi="http://www.w3.org/2001/XMLSchema-in
stance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Provider>OSGeo.SDF.3.3</Provider>
<Parameter>
<Name>File</Name>
<Value>C:\Map 3D SDK\Map Samples\Plat
form\BuildMap\Data\SDF\Zoning.sdf</Value>
</Parameter>
<Parameter>
<Name>ReadOnly</Name>
<Value>False</Value>
</Parameter>
</FeatureSource>

Adding The Resource


To use the XML files to create the layer and the feature source, use
MgResourceService.SetResource(). For example:

Adding The Resource | 13

You might also like