3

It seems like all the Mapserver documentation on changing the center-point of a symbol only deals with TYPE 'vector' symbols.

I have pixmap symbol (the standard looking Google marker image thingy) that i'm using with a WMS overlay. Once it's rendered the location the symbol represents ( the symbol center-point ) is the middle of the image. This makes the location the symbol represents seem off. I would rather have the marker's tip/point line up with the location it represents. I'm not sure how to do this. Any advice?

1

Here's a solution that doesn't require Mapserver at all. Though, i'd rather find out how to do this in Mapserver because this solution seems hackish.

Mapserver renders Pixmap symbols based on the image center point as mentioned above. If the marker center-point is not where we want it, then we just need to change it. Take your marker PNG and open it in GIMP. Click Image > Resize Canvas -- this will resize the transparent canvas behind the marker. Then offset your image to your liking -- for my purposes i just made sure the marker tip was close to the center of the image.

Can anyone tell me how this can be done in Mapserver?

1

Try the ANCHORPOINT property of SYMBOL object (You will need mapserver >=6.2) I use this to align symbols that have their tip at middle bottom.

SYMBOL
  NAME "symbol_name"
  TYPE PIXMAP
  IMAGE "icons/photo-marker.png"
  ANCHORPOINT 0.5 1
END

see: http://mapserver.org/mapfile/symbol.html

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.