How do I embed any text onto the map

Aniruddha S. Khadkikar as.khadkikar at NCL.RES.IN
Wed Dec 7 04:33:10 PST 2005


Hi Steve,
Thanks for the map file syntax. I thought it would be easy to translate 
the same into PHP Mapscript. But I am lost. I cannot find the equivalent 
for describing the feature and text. Could you give me some clues.
Would I need to use connection type = inline for the purpose.
Best wishes
Aniruddha


Steve Lime wrote:
> Hi Aniruddha: The way to do that is using inline layers. For example:
> 
> LAYER
>   NAME 'copyright'
>   TYPE ANNOTATION
>   STATUS DEFAULT
>   TRANSFORM FALSE # coordinates are in pixels
>   FEATURE
>     POINTS 10 10 END
>   END
>   CLASS
>     LABEL 
>       SIZE MEDIUM
>       COLOR 0 0 0
>       OUTLINECOLOR 255 255 255
>       POSITION CR
>     END
>     TEXT 'Copyright 2005'
>   END
> END
> 
> This would place the text 'Copyright 2006' towards the upper-left hand corner of the map, just to the right of the pixel coordinate 10,10. You could do similar things with a custom string:
> 
>   - you can alter the CLASS TEXT dynamically with run-time subsitutions (e.g. TEXT '%title%')
> 
>  and a north arrow marker:
> 
>   - use a POINT layer that references a north arrow graphic in the CLASS STYLE
> 
> The problem you'll run into is that inline pixel coordinates are absolute so they really only work with one image size. (except for the UL corner which is always 0,0) The only solution there is to either have 1 mapfile for each image size you need. You could muck with the coordinates at runtime possibly too. 
> 
> Ideally we'd allow relative pixel coordinates some like:
> 
> FEATURE
>   RELATIVETO LR
>   POINTS -50 -50 END
> END
> 
> Which would give you a point just inside the lower right-hand corner, but alas it has not been implemented. (not a bad idea and not that hard- I'll file a bug now).
> 
> Steve
> 
>>>> "Aniruddha S. Khadkikar" <as.khadkikar at NCL.RES.IN> 12/01/05 11:34 PM >>>
> Hi,
> I am unable to resolve how to add any text on the map.
> I wish to add the following elements:
> 1. Copyright statement for the image produced.
> 2. North Symbol
> 3. Dynamic text e.g. Name of the species for which the distribution map 
> is being generated.
> 
> I am providing an option for downloading the image at 100, 200,300 dpi. 
> I am using pmapper for the project. So it is necessary that the final 
> jpg file have all these details on the image itself. All the above 
> elements will be 'relatively' fixed on the map. i.e. I want the name on 
> the upper left corner, north symbol and copyright statement towards the 
> upper right corner of the map.
> 
> I hope I am clear.
> 
> Aniruddha

*****************************************************************
This email is virus free by TrendMicro Inter Scan Security Suite.
*****************************************************************



More information about the MapServer-users mailing list