Mark center of map?

Ryan, Adam ARyan at CO.LINN.OR.US
Thu Mar 17 16:40:45 PST 2005


> -----Original Message-----
> From: Richard A. Milewski [mailto:ram at RAMPAGE.NET]
> Sent: Thursday, March 17, 2005 3:43 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] Mark center of map?
>
>
> Jeff,
>
> I tried your suggestion and got it to work, but I noticed
> some odd things and I just want to be sure I really
> understand what I'm doing.
>
> Here's the layer that works for me:
>
> LAYER
>    NAME MapPin
>    STATUS ON
>    TYPE Point
>    TRANSFORM FALSE
>    FEATURE
>      POINTS
>        150 150
>      END
>    END
>    CLASS
>      SYMBOL "Symbols/Airport01.gif"
>      OUTLINECOLOR 255 255 255
>    END
> END
>
> The unexpected things I found were:
>
> 1 - I seem to need either a COLOR or OUTLINECOLOR statement
> in the CLASS clause.  It doesn't matter what color I specify
> or whether I use COLOR or OUTLINECOLOR, but without one of
> the two, the symbol doesn't appear.  The specified color has
> no effect on the displayed color of the .gif however.
>
> 2 - The path to the marker specified in the SYMBOL statement
> is a path relative to the .map file directory.  There is a
> SHAPEPATH statement in the MAP object definition, but that
> has no apparant effect here.
>
> 3 - It appears that the symbol is centered on the point
> defined in the FEATURE clause.  This is really cool and makes
> things much easier, but came as a surprise.  I was prepared
> to calculate my own centering a la netpbm and  image magick.
> This is much easier.
>
> I now need to figure out how to change the POINT location on
> the fly because I don't know what the actual map size is
> until the maprequest comes in from the user. (These maps are
> being served to phones and different phones have different
> size screens).  The note at the end of the MapServer CGI
> Reference seems to have enough information about how to do
> that though.  I'll give it a try.
>
> I suspect you already know everything I've mentioned here,
> but I wanted to make sure it got into the thread in the
> MapServer-Users list archive.  I've learned at least half of
> what I know about MapServer from the list, and want to leave
> as much information around for the next guy as I can.
>
> Many thanks for all the help!
>
> -- Richard
>

Richard,

Try leaving the feature object out of your mappin layer in the map file and
add it to your cgi request instead.  That way you can set both the size of
the map and the position of the icon.

...mapserv.exe?map=yourMap.map&mapsize=300 300&map_MapPin_feature_points=150
150&...

Cheers,

Adam



More information about the MapServer-users mailing list