Mark center of map?

Jeff Hoffmann jeff at PROPERTYKEY.COM
Tue Mar 15 17:57:43 EST 2005


Richard A. Milewski wrote:
> Can someone point me at a how-to that describes how to draw on a map?  What
> I need to do is plant a big red X at the very center of a map served by
> mapserver.  The Symbology reference seems to be all about how to place
> symbols at locations defined in a dbf file, but I need to plot this symbol
> at the center of whatever extent the user has chosen. The maps are specified
> by Lat/Lng, so I know the coordinates but not until they request is actually
> sent to MapServer.  Running MapServer 4.4.1 on Linux  (but not Mapscript
> ...yet).

If you know the size of your map, it's pretty simple.  Just create a
layer, set "TRANSFORM FALSE" to tell it that your coordinates are
pixels, not lat/lon (or whatever) & put a FEATURE block in there to tell
it where you want it to show up.  Here's a sample from a map file that
created a map 600x450.

LAYER
   NAME center
   STATUS DEFAULT
   TYPE POINT
   TRANSFORM FALSE
   FEATURE
     POINTS
       299 224
     END
   END
   CLASS
     SYMBOL "/usr/local/mapserver/symbols/flag.png"
   END
END


--
Jeff Hoffmann
jeff at propertykey.com



More information about the mapserver-users mailing list