Dear all,

currently I'm facing the following problem:

I want to place city names together with a symbol, and both should only be 
present together or not at all.

When placing a <Graphic> Element inside a TextSymbolizer, I do not get control 
of the relative positioning of the symbol and the text, they get rendered over 
each other. I also noticed that a rotation angle for the text part will be 
ignored as long as the graphic element is there.

Example going wrong:
  <sld:Rule>
          <sld:TextSymbolizer>
            <sld:Label>
              <ogc:PropertyName>name</ogc:PropertyName>
            </sld:Label>
            <sld:Font>
              <sld:CssParameter name="font-family">Arial</sld:CssParameter>
              <sld:CssParameter name="font-size">11</sld:CssParameter>
            </sld:Font>
            <sld:LabelPlacement>
              <sld:PointPlacement>
                <sld:AnchorPoint>
                  <sld:AnchorPointX>0.5</sld:AnchorPointX>
                  <sld:AnchorPointY>0.5</sld:AnchorPointY>
                </sld:AnchorPoint>
                <sld:Displacement>
                  <sld:DisplacementX>0</sld:DisplacementX>
                  <sld:DisplacementY>-12</sld:DisplacementY>
                </sld:Displacement>
                <sld:Rotation>0</sld:Rotation>
              </sld:PointPlacement>
            </sld:LabelPlacement>
<sld:Graphic>
              <sld:ExternalGraphic>
                <sld:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"; 
xlink:type="simple" xlink:href="city.svg"/>
                <sld:Format>image/svg+xml</sld:Format>
              </sld:ExternalGraphic>
            </sld:Graphic>
          </sld:TextSymbolizer>
        </sld:Rule>


My current workaround is to write a second symbolizer into the rule, a 
PointSymbolizer, but that leads to situations where the graphic is shown but 
the corresponding text isn't which I would like to avoid.

    <sld:Rule>
          <sld:TextSymbolizer>
            <sld:Label>
              <ogc:PropertyName>name</ogc:PropertyName>
            </sld:Label>
            <sld:Font>
              <sld:CssParameter name="font-family">Arial</sld:CssParameter>
              <sld:CssParameter name="font-size">11</sld:CssParameter>
            </sld:Font>
            <sld:LabelPlacement>
              <sld:PointPlacement>
                <sld:AnchorPoint>
                  <sld:AnchorPointX>0.5</sld:AnchorPointX>
                  <sld:AnchorPointY>0.5</sld:AnchorPointY>
                </sld:AnchorPoint>
                <sld:Displacement>
                  <sld:DisplacementX>0</sld:DisplacementX>
                  <sld:DisplacementY>-12</sld:DisplacementY>
                </sld:Displacement>
                <sld:Rotation>0</sld:Rotation>
              </sld:PointPlacement>
            </sld:LabelPlacement>
          </sld:TextSymbolizer>
          <sld:PointSymbolizer>
            <sld:Graphic>
              <sld:ExternalGraphic>
                <sld:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"; 
xlink:type="simple" xlink:href="city.svg"/>
                <sld:Format>image/svg+xml</sld:Format>
              </sld:ExternalGraphic>
            </sld:Graphic>
          </sld:PointSymbolizer>
        </sld:Rule>


I am currently testing on Geoserver included in OpenGeoSuite 2.5 (2.1-snapshot, 
buit 24th of may 2012)

Any clues how to achieve a symbol, below it the text and both together 
displayed or left away dependant of available space?

Best regards,
Sebastian
Sebastian Schmidt
SWM - Besser leben mit M.
Informations- und Prozesstechnik
Anwendungen Technische Geschäftsfelder
Telefon: 089/23 61-44 78
[email protected]
www.swm.de
SWM Services GmbH, Emmy-Noether-Straße 2, 80992 München; Geschäftsführer Dr. 
Kurt Mühlhäuser, Herbert König, Reinhard Büttner, Stephan Schwarz, Dr. Florian 
Bieberbach; Sitz München; Registergericht München HRB 126 674; 
Aufsichtsratsvorsitzender Oberbürgermeister Christian Ude
Der Inhalt dieser E-Mail oder eventueller Anhänge ist ausschließlich für den 
bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat 
dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie bitte, dass 
jede Form der Kenntnisnahme, Veröffentlichung, Vervielfältigung oder Weitergabe 
des Inhalts dieser E-Mail unzulässig ist. Wir bitten Sie, sich in diesem Fall 
mit dem Absender der E-Mail in Verbindung zu setzen.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to