how to use pictures as labels
Hal Mueller
hal at MOBILEGEOGRAPHICS.COM
Tue Nov 7 17:28:18 PST 2006
I don't have an example, but let me try explaining another way.
For option one, I was suggesting that you figure out, in advance, all
possible combinations of all possible symbols, and generate all
possible icons that correspond to those states. In retrospect I
don't like that idea as much.
For option two, think of it in two steps. Consider only the image
that will be drawn to the upper-right of the mapped location. Say
you're mapping towns: if the town's economy is industrial draw a red
circle, and if it's agricultural draw a green square. Now hopefully
you understand how to map just that much of it, drawing the red
circle or green square at the exact location of the town: define two
classes in your layer for "economy type", with SYMBOL definitions for
the red circle and green square.
At that point you have a map which draws one of the components of
your compound symbol, but it draws it dead center on the city
location, and you need it offset. Let's say your symbol fits in a box
8 pixels by 8 pixels. Now redefine your symbol. Put it in a box
that's 24 pixels by 24 pixels. But don't put it in the center of
that box--put it in the upper right corner instead, and leave the
other 8 cells blank. You can draw that 24x24 symbol at the center
point of the city, and your red circle/green square will be offset.
Now repeat that for each of your other "image labels", with one LAYER
per "label", and one CLASS for each different symbol that could
appear in that corner of the icon.
Hal
At 8:04 AM -0800 11/7/06, william paul wrote:
>Hi Hal:
>
>Do you have an example with a MAP file? I don't understand the first
>option. In the second one how can I use OFF- Centered?
>
>The icons depends on the attribute data, which means that some
>points will have less symbols and other points will have more symbols
>
>William
>
>Hal Mueller <hal at MOBILEGEOGRAPHICS.COM> wrote:
>
>Are the surrounding labels data-dependent? Or is there a small
>number of states?
>
>One way to approach this is to pre-render the point icon plus
>"labels", and use that image as the icon for your plot.
>
>Another way to do it would be to have 5 different layers, one for
>each of the different images. The trick is that for the 4 layers
>representing the layers, you use a large icon, but with the image
>off-centered. That is, make 4 copies of your "image 2". In each
>copy, delete the red circle. In copy one, delete all but the green
>rectangle. In copy two, delete all but the purple diamond.
>
>Hal
>
>
>
>
>Everyone is raving about
><http://us.rd.yahoo.com/evt=45083/*http://advision.webevents.yahoo.com/mailbeta>the
>all-new Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20061107/ab15944d/attachment.htm>
More information about the MapServer-users
mailing list