Example - Using Line Rules

Creating line-based rules is very similar.

        // ...

        //---------------------------------------------------//

        $factory = new LayerDefinitionFactory();

        // Create a line rule.

        $legendLabel = '';

        $filter = '';

        $color = 'FF0000FF';

        $lineRule = $factory->CreateLineRule(

          $legendLabel, $filter, $color);

        // Create a line type style.

        $lineTypeStyle = $factory->

          CreateLineTypeStyle($lineRule);

        // Create a scale range.

        $minScale = '0';

        $maxScale = '1000000000000';

        $lineScaleRange = $factory->

          CreateScaleRange($minScale, $maxScale,

          $lineTypeStyle);

        // Create the layer definiton.

        $featureClass = 'Library://Samples/Sheboygan/Data/'

          . 'HydrographicLines.FeatureSource';

        $featureName = 'SHP_Schema:HydrographicLines';

        $geometry = 'SHPGEOM';

        $layerDefinition = $factory->

          CreateLayerDefinition($featureClass, $featureName,

          $geometry, $lineScaleRange);

        //---------------------------------------------------//

        // ...