Hi Martin,
I simply made sure that the SVG symbol was defined on a square grid (100x100) and that the point I wanted as the reference point was located in the middle i.e. 50,50. Once this was done the symbols were positioned exactly where they should have been.
From: Martin Davis [mailto:mtnclimb@anonymised.com]
Sent: 30 January 2013 23:16
To: Chris Haste
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] SVG Marks
Chris, what exact technique did you use to solve the problem? Did you use the “invisible circle” technique? Any chance you could post your SVG file to look at?
On Wed, Jan 30, 2013 at 9:38 AM, Chris Haste <CHaste@anonymised.com> wrote:
Thank you, that was the problem and it is now behaving as it should
From: Ákos Maróy [mailto:akos@anonymised.com]
Sent: 30 January 2013 17:05
To: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] SVG Marks
On 30/01/13 17:22, Chris Haste wrote:
Hello List,
I want to use an external SVG symbol as a mark and I’m using the CSS module for my styling, although I don’t think that makes any difference to this question.
The SVG represents a pin and I want to position the pin so that the base of the pin is drawn at the position for that point, but the pins all seem to be drawn quite away to the left of the actual position.
What considerations do I need to take into account in order to be able to accurately position the SVG symbol relative to the reference coordinate?
what you have to achieve is that the ‘middle point’ of your SVG is the point you want to align with the depicted point on the map. if this is not the case for the natural shape of the SVG, you might want to add a non-visible element to the SVG itself (say, a circle that encoloses all of the SVG, with the circles center point being your wanted center point), and use the SVG that way.
from my experience, the SLD rendering engine will try to ‘center’ the SVG so that its center point is the point of reference being drawn. (and the CSS styling is based on the SLD styling)
*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***