14.01.2013 Views

Developer's Guide - MapGuide Open Source - OSGeo

Developer's Guide - MapGuide Open Source - OSGeo

Developer's Guide - MapGuide Open Source - OSGeo

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

...<br />

//---------------------------------------------------//<br />

$factory = new LayerDefinitionFactory();<br />

// Create a mark symbol<br />

$resourceId = 'Library://Samples/Sheboygan/Symbols/BasicSym<br />

bols.SymbolLibrary';<br />

$symbolName = 'PushPin';<br />

$width = '24'; // points<br />

$height = '24'; // points<br />

$color = 'FFFF0000';<br />

$markSymbol = $factory->CreateMarkSymbol($resourceId, $symbol<br />

Name, $width, $height, $color);<br />

// Create a text symbol<br />

$text = "ID";<br />

$fontHeight="12";<br />

$foregroundColor = 'FF000000';<br />

$textSymbol = $factory->CreateTextSymbol($text,<br />

$fontHeight, $foregroundColor);<br />

// Create a point rule.<br />

$legendLabel = 'trees';<br />

$filter = '';<br />

$pointRule = $factory->CreatePointRule($legendLabel,<br />

$filter, $textSymbol, $markSymbol);<br />

// Create a point type style.<br />

$pointTypeStyle = $factory-><br />

CreatepointTypeStyle($pointRule);<br />

// Create a scale range.<br />

$minScale = '0';<br />

$maxScale = '1000000000000';<br />

$pointScaleRange = $factory->CreateScaleRange($minScale,<br />

$maxScale, $pointTypeStyle);<br />

// Create the layer definiton.<br />

$featureClass = 'Library://Tests/Trees.Feature<strong>Source</strong>';<br />

$featureName = 'Default:Trees';<br />

$geometry = 'Geometry';<br />

$layerDefinition = $factory-><br />

CreateLayerDefinition($featureClass, $featureName,<br />

$geometry, $pointScaleRange);<br />

//---------------------------------------------------//<br />

// ...<br />

66 | Chapter 4 Modifying Maps and Layers

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!