[mapserver-users] Repeating annotation, using LABEL_NO_CLIP=1 with Open Layers

Fawcett, David (MPCA) David.Fawcett at state.mn.us
Wed Jan 27 06:51:15 PST 2010


Ted, 

If you go the tile route, each image request to MapServer is independent, so it will get a copyright notice.  

You can go use an OpenLayers Layer.WMS layer with singleTile set to True and a ratio of 1 to get one tile that only fills the viewport.  (This is similar to the deprecated OpenLayers.Layer.WMS.Untiled).  http://dev.openlayers.org/releases/OpenLayers-2.8/examples/notile.html

The only issue with ratio of 1 is that you see the white background when you pan. 

I think that the best solution would be to add an attribution layer using OpenLayers.  http://openlayers.org/dev/examples/attribution.html

David.


-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Bob Basques
Sent: Tuesday, January 26, 2010 7:20 PM
To: Ted Spradley; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Repeating annotation, using LABEL_NO_CLIP=1 with Open Layers

It probably still there, only out of frame if you are using OpenLayers, 
which I believe grabs a tile larger than the current view for panning by 
the user.

Other than adding another layer or restricting the tiles retrieved to 
the same size as the current view port, I don't know of a way of getting 
a copyright into view.  There may be some OpenLayers settings that aloow 
for a center tile that is as large as the current view with tiles 
arouand the edges, but this may be a performance hit.

bobb



On 1/26/2010 5:51 PM, Ted Spradley wrote:
> Hi everyone,
>
> I recently added a copyright notice via an annotation layer.  When the
> mapfile is accessed as a WMS
> via OpenLayers, the annotation repeats on every tile.  I am using the
> directive:
>       PROCESSING 'LABEL_NO_CLIP=1'
>
> Setting the OL WMS call to Untiled did cause the annotation to disappear
> altogether.  Any thoughts?
>
> Thank you!
> Ted S.
>
> /* The layer */
>
>    LAYER
>      NAME "copyright"
>      STATUS ON
>      TYPE annotation
>      PROCESSING 'LABEL_NO_CLIP=1'
>      TRANSFORM ll #set the image origin to be lower left
>      FEATURE
>        POINTS
>          100 -20 #set the offset from lower left position in pixels
>        END
>        TEXT "copyright text" #this is your displaying text
>      END
>      CLASS
>        LABEL #defines the font, colors etc. of the text
>          FONT "ARIAL"
>          TYPE TRUETYPE
>          SIZE 8
>          BUFFER 1
>          COLOR 0 0 0
>          BACKGROUNDCOLOR 255 255 255
>        END
>      END
>      UNITS PIXELS #sets the units for the feature object
>    END
>
>
>
> -----
> Thank you,
> Ted S
>
> MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
> OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV
> SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
> SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS
> INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>
>
> Linux/Fedora7
>    

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list