2

I want to change the placement of the label of special polygon by sending SLD to WMS of Mapserver. But it seems as it has no effect. Is label placement in polygons support by mapserver?

        <TextSymbolizer>
        <Font>
            <CssParameter name="font-family">arial</CssParameter>
            <CssParameter name="font-size">20</CssParameter>
        </Font>
        <LabelPlacement>
            <PointPlacement>
                <AnchorPoint>
                    <AnchorPointX>0</AnchorPointX>
                    <AnchorPointY>0</AnchorPointY>
                </AnchorPoint>
                <Displacement>
                  <DisplacementX>0</DisplacementX>
                  <DisplacementY>50</DisplacementY>
                </Displacement>
            </PointPlacement>
        </LabelPlacement>
        <Fill>
            <CssParameter name="fill">#000000</CssParameter>
        </Fill>
    </TextSymbolizer>
2

I found out, that I missed the label-TAG with PropertyName:

<TextSymbolizer>
    <Label>
        <PropertyName>name</PropertyName>
    </Label>
    <Font>
        <CssParameter name="font-family">arial</CssParameter>
        <CssParameter name="font-size">20</CssParameter>
    </Font>
    <LabelPlacement>
        <PointPlacement>
            <AnchorPoint>
                <AnchorPointX>0.5</AnchorPointX>
                <AnchorPointY>0.5</AnchorPointY>
            </AnchorPoint>
            <Displacement>
                <DisplacementX>0</DisplacementX>
                <DisplacementY>50</DisplacementY>
            </Displacement>
        </PointPlacement>
    </LabelPlacement>
    <Fill>
        <CssParameter name="fill">#000000</CssParameter>
    </Fill>
</TextSymbolizer>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.