1

I am adding an SVG icon on the map, but I got very small icon. I would like to get the icon size 30% or 50% larger than it is now. I tried to scale the icon, but I think that GeoServer has a size limit for the icon and it cannot be too big.

I added this code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW 2019 (64-Bit) -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="236px" height="283px" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 236 283.2"
 xmlns:xlink="http://www.w3.org/1999/xlink"
 xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
 <defs>
 <filter id="f1">
       <feColorMatrix result="matrixOut" in="offOut" type="matrix" values="0.2 0 0 0 0 0 0.2 0 0 0 0 0 0.2 0 0 0 0 0 1 0" />
      <feGaussianBlur result="blurOut" in="matrixOut" stdDeviation="5" />
      <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
 </filter>
  <style type="text/css">
   <![CDATA[
    .fil3 {fill:black}
    .fil1 {fill:#9FC53A}
    .fil2 {fill:#F29200}
    .fil0 {fill:white}
    .fil4 {fill:white; fill-rule:nonzero}
   ]]>
  </style>
 </defs>
 <g id="Слой_x0020_1">
  <metadata id="CorelCorpID_0Corel-Layer"/>
  <path class="fil0" d="M136.44 236.46c-1.13,3.41 -2.09,6.84 -3.39,10.2 -0.35,0.91 -0.74,1.8 -1.16,2.68 -2.84,5.98 -7.83,10.53 -14.79,10.53 -6.95,-0.01 -11.94,-4.55 -14.78,-10.53 -0.41,-0.88 -0.8,-1.77 -1.15,-2.68 -1.3,-3.36 -2.26,-6.79 -3.39,-10.2 -1.78,-4.43 -4.13,-8.59 -6.96,-12.42 -6.94,-9.37 -15.99,-17.33 -24.51,-24.93 -4.37,-3.75 -8.7,-7.55 -12.68,-11.37 -19.63,-17.9 -30.75,-43.05 -30.75,-69.64 0,-52.04 42.19,-94.23 94.23,-94.23 52.04,0 94.23,42.19 94.23,94.23 0,26.66 -11.18,51.87 -30.71,69.6 -4.1,3.93 -8.36,7.67 -12.53,11.24 -8.66,7.72 -17.76,15.72 -24.7,25.1 -2.84,3.83 -5.18,7.99 -6.96,12.42z" filter="url(#f1)"/>
  <path class="fil1" d="M127.08 233.04c-1.13,3.37 -2.03,6.68 -3.32,10.03 -0.27,0.68 -0.56,1.34 -0.87,2 -1.17,2.46 -2.97,4.86 -5.78,4.84 -2.82,0.02 -4.62,-2.38 -5.79,-4.84 -0.31,-0.66 -0.6,-1.32 -0.86,-2 -1.29,-3.35 -2.2,-6.66 -3.32,-10.03 -2.14,-5.38 -4.93,-10.36 -8.32,-14.93 -7.4,-10 -16.96,-18.48 -26.02,-26.56 -4.22,-3.62 -8.42,-7.3 -12.45,-11.17 -16.9,-15.41 -27.51,-37.6 -27.51,-62.28 0,-46.54 37.73,-84.27 84.27,-84.27 46.54,0 84.27,37.73 84.27,84.27 0,24.74 -10.66,46.99 -27.64,62.41 -3.99,3.82 -8.13,7.45 -12.27,10.99 -9.11,8.13 -18.67,16.61 -26.07,26.61 -3.39,4.57 -6.19,9.55 -8.32,14.93z"/>
  <path class="fil4" d="M117.11 49.62c37.82,0 68.48,30.66 68.48,68.48 0,37.82 -30.66,68.48 -68.48,68.48 -37.82,0 -68.48,-30.66 -68.48,-68.48 0,-37.82 30.66,-68.48 68.48,-68.48z"/>
  <g id="_2043580368">
   <path class="fil2" d="M144.61 93.79l-0.04 -0.03c-0.33,-0.32 -0.67,-0.62 -1,-0.91 -0.26,-0.23 -0.52,-0.45 -0.8,-0.66 -2.24,-1.78 -4.47,-2.83 -7.48,-3.12 -1.59,-0.2 -3.23,-0.13 -4.86,0.23 -0.8,0.17 -1.56,0.41 -2.3,0.7 -6.11,2.38 -9.45,8.24 -9.99,14.62 -0.05,0.59 -0.08,1.18 -0.08,1.77 0,0.72 0.03,1.43 0.1,2.15 0.74,8.11 5.51,14.95 10.68,20.92 4.58,5.29 9.41,9.43 14.59,14.05 1.03,0.92 2.24,2.06 3.3,2.89 0.44,0.33 0.69,0.49 0.95,0.48 0.25,0.01 0.51,-0.15 0.94,-0.48 1.06,-0.83 2.27,-1.97 3.31,-2.89 5.18,-4.62 10,-8.76 14.58,-14.05 5.18,-5.97 9.94,-12.81 10.69,-20.92 0.06,-0.72 0.09,-1.43 0.09,-2.15 0,-0.59 -0.02,-1.18 -0.08,-1.77 -0.54,-6.38 -3.88,-12.24 -9.99,-14.62 -0.73,-0.29 -1.5,-0.53 -2.3,-0.7 -1.63,-0.36 -3.26,-0.43 -4.85,-0.23 -3.02,0.29 -5.25,1.34 -7.49,3.12 -0.27,0.21 -0.54,0.43 -0.8,0.66 -0.33,0.29 -0.66,0.59 -1,0.91l-0.04 0.03c-1.04,1.05 -2.54,3.32 -3.06,4.76 -0.52,-1.44 -2.03,-3.71 -3.07,-4.76z"/>
   <path class="fil3" d="M93.63 116.61c-5.63,0 -13.46,0.15 -16.11,-5.31 -2.5,-5.15 -1.63,-13.43 1.52,-17.24 2.61,-3.15 10.1,-3.58 12.73,-2.67 1.71,0.59 1.92,1.56 1.91,3.63 -0.01,1.93 0.11,20.26 -0.05,21.59zm-8.65 1.13c-0.37,0.43 -2.51,0.81 -4.61,2.09 -1.38,0.86 -2.81,1.84 -3.9,3.05 -0.66,0.72 -1.15,1.14 -1.76,1.97 -3.53,4.76 -5.2,10.96 -7.41,16.39 -0.44,1.09 -1.29,3.15 -2.29,3.82 -0.8,0.5 -1.79,0.65 -2.87,0.66 -0.72,0 -2.24,-0.28 -2.71,0.31 -0.39,0.48 0.12,0.99 0.63,1.12 0.58,0.16 1.46,0.07 2.08,0.05 1.31,-0.02 2.65,-0.05 3.93,-0.07l8.06 0c0.41,-2.5 1.18,-5.31 1.83,-7.76 0.95,-3.5 1.98,-7.21 3.15,-10.64 1.13,-3.33 2.51,-6.13 5.34,-8.33 2.74,-2.14 5.93,-1.95 9.23,-1.95 0,7.29 -0.04,14.59 0,21.88 0,0.99 0.17,2.98 -0.11,3.82 -0.44,1.16 -2.42,1.26 -3.46,1.35 -0.89,0.08 -1.76,0.06 -2.63,0.13 -0.5,0.04 -1.3,0.2 -1.28,0.86 0.02,0.75 2.48,0.7 2.98,0.68 0.81,-0.03 1.61,-0.11 2.42,-0.12 5.17,0.03 10.35,0.08 15.52,0.09 0.6,0 1.51,-0.03 1.7,-0.75 0.1,-0.4 -0.35,-0.64 -0.7,-0.69 -0.48,-0.08 -1.42,-0.05 -1.97,-0.09 -1.01,-0.06 -3.54,-0.21 -4.07,-1.2 -0.33,-0.76 -0.14,-39.4 -0.14,-43.28 0,-2.06 -0.23,-6.74 0.15,-8.46 0.44,-1.73 2.17,-1.74 3.67,-1.74 0.71,0 2.42,0.12 2.99,-0.27 0.32,-0.22 0.34,-0.98 -0.22,-1.23 -0.67,-0.29 -2.56,-0.14 -3.35,-0.11 -1.83,0.08 -3.59,0.18 -5.43,0.24 -8.86,0.32 -22.79,-2.25 -29.08,4.43 -3.82,4.05 -4.71,11.29 -1.67,17.2 1.33,2.6 3.56,4.09 6.26,5.03 4.12,1.43 9.1,1.05 9.72,1.52z"/>
  </g>
 </g>
</svg>
2

assuming that you want to publish your map via WMS, you could use SLD to style your layer. You can use the <size> element. You can find an example in the GeoServer SLD Cookbook. The Point as Graphic section should cover what you want.

Your SLD could look like this:

<sld:PointSymbolizer>
            <sld:Graphic>
                <sld:ExternalGraphic>
                    <sld:OnlineResource xlink:type="simple"
                                        xlink:href="myIcon.svg" />
                    <sld:Format>image/svg+xml</sld:Format>
                </sld:ExternalGraphic>
                <sld:Size>12</sld:Size>
            </sld:Graphic>
</sld:PointSymbolizer>
| improve this answer | |
  • The size will default to 6px if you don't specify it. – Ian Turton Jan 13 at 13:40

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.