[Cartoweb-users] Hi How can i have a label inside a polygon.

Alexandre Fellay alexandre.fellay at camptocamp.com
Fri Mar 31 11:44:41 EST 2006


Hi
That's actually a Mapserver question. You have to put a LABEL object in your 
layer (within a CLASS) and a LABELITEM. Look at the corresponding part of 
Mapserver documentation.
Probably something like that should work :


   LAYER
     NAME "chittoor"
     TYPE POLYGON
     DATA "DIST_Chittoor_Ver0_011205"
     TEMPLATE "ttt"
     METADATA
       "exported_values" "recenter_name_string,id_attribute_string"
       "recenter_name_string" "NAM"
       "id_attribute_string" "OGC_FID|string"
       "query_returned_attributes" "NAM"
     END
     LABELITEM "NAM"

     CLASS
       STYLE
         COLOR 80 160 74
         OUTLINECOLOR 86 86 74
       END
       LABEL
         TYPE TRUETYPE
         FONT "Vera"
         SIZE 10
         COLOR 0 0 0
         OUTLINECOLOR 255 255 255
         POSITION cc
       END
     END
   END

VenuGopal Papasani wrote:
> Hi all,
>     I have a map with polygons of various districts.Now i need to have 
> names of each districts as labels inside a polygon.It is enough if i 
> have only set all the properties of the Label Class inside myplug 
> server/ServerMypluginname.php or shall i have to include any code 
> anywhere else. i.e i have to add anything inside the Map file or do i 
> have to overwrite any other plugin.
>     If i need to Override the functionality of identity.If i place my 
> cursor on any of the polygon and click i need to get the details of that 
> polygon.how to capture those extents and how to pass them to my template 
> from server in order to write a Javascript code.
> 
> Thanks and regards,
> venu.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users


More information about the Cartoweb-users mailing list