[Geomoose-users] Need label opacity independent of vector layer

Brent Fraser bfraser at geoanalytic.com
Tue Jul 13 15:29:22 EDT 2010


I'm not sure I understand.  My thought was to have one (and only one) entry in 
the mapbook points to one mapfile with two LAYER entries (one with a CLASS NAME 
and the other with a CLASS but no NAME).

Anyways, it turns out you only need on LAYER in your map file.  The OPACITY 
setting only applies to the feature's geometry STYLE, not the LABEL! Personally 
I consider this a bug in mapserver.

So this works (no OPACITY applied to LABEL, 20% on geometry):

   LAYER
     NAME 'Urban'
     TYPE POLYGON
     DUMP false
     DATA 'G:/GeoData/Parcels/Alberta/t_carsta.shp|layerid=0'
     METADATA
       'ows_title' 't_carsta'
       'identify_record' 'parcels_identify.html'
     END
     STATUS OFF
     LABELITEM 'PID'
     OPACITY 20        # Geometry only!!
     CLASS
       NAME 'Urban'    # show in legend
       STYLE
         SYMBOL 0
         SIZE 7.0
         OUTLINECOLOR 0 0 0
         COLOR 255 255 242 # 222
       END
       LABEL
         FONT arial
         TYPE truetype
         SIZE 8
         COLOR 80 80 80
         OUTLINECOLOR 255 255 255
         POSITION cc
         ANTIALIAS true
         PARTIALS true
       END # Label
     END # Class
   END # Layer


Jim Dahl wrote:
> I see there are three ways to do this, but I can only set individual
> opacities with two entries in the mapbook unless they can be set in the
> mapfile.  Jacob's Invisible = "true" in your .xml file, Bob and Brent
> with no name in the mapbook and the mapfile.
> 
> jim
> 
> -----Original Message-----
> From: Brent Fraser [mailto:bfraser at geoanalytic.com] 
> Sent: Tuesday, July 13, 2010 1:54 PM
> To: Jim Dahl
> Cc: geomoose-users at lists.sourceforge.net
> Subject: Re: [Geomoose-users] Need label opacity independent of vector
> layer
> 
> 
> I don't think so...
> 
> One entry in the mapbook (so only one GM "layer" with a checkbox):
> 
> <map title="Parcels" default="true">
>      <file>./Parcels.map</file>
> </map
> 
> but two LAYERs in the Parcels.map file, one with no NAME entry in the
> CLASS so 
> its no included in the mapserver-generated legend.
> 
> Brent
> 
> Jim Dahl wrote:
>> >From the responses, I see that it cannot be done without hacking or 
>>> GM2.
>> Brent, your suggestion with the two opacities still will show two 
>> layers in the TOC.
>>
>> -----Original Message-----
>> From: Brent Fraser [mailto:bfraser at geoanalytic.com]
>> Sent: Tuesday, July 13, 2010 1:13 PM
>> To: Jim Dahl
>> Cc: geomoose-users at lists.sourceforge.net
>> Subject: Re: [Geomoose-users] Need label opacity independent of vector
>> layer
>>
>>
>> Jim,
>>
>>    You could use mapserver's OPACITY setting in the map file.  Have 
>> two layers in the map file (with the same name, or set STATUS DEFAULT 
>> so they're both
>> always on), one for the geometry (OPACITY 20) and one for the labels
>> (OPACITY 
>> 100).  Of course GM's fade/unfade controls would have no knowledge of
>> this, so 
>> that may be confusing to the end users...
>>
>> Brent
>>
>> Dan Little wrote:
>>> This is/was a limitation in GeoMOOSE 1.X that we addressed in 2.X.  
>>> There is nothing in the standard code base that supports what you'd 
>>> like to do.  Brian/Len/Brent may have a hack they did to make it 
>>> work.
>>>
>>>
>>>     *From:* Jim Dahl <jim.dahl at mail.co.douglas.mn.us>
>>>     *To:* geomoose-users at lists.sourceforge.net
>>>     *Sent:* Tue, July 13, 2010 10:47:56 AM
>>>     *Subject:* [Geomoose-users] Need label opacity independent of
>> vector
>>>     layer
>>>
>>>     I have a polygon layer in GM 1.x that has opacity of 20 but I
> want
>>>     opacity of labels 100.  I can create this effect with separating
>>>     into two layers but I do not want to see the anno layer in the
>>>     layers tab.  Can anyone guide me as to the solution.  If anno is
>>>     separate layer, can the mapbook code be  - visibility="false" ?
>>>      
>>>
>>>     Jim Dahl, GISP
>>>     GIS Coordinator
>>>     Douglas County Public Works
>>>     526 Willow Dr
>>>     PO Box 398
>>>     Alexandria MN 56308
>>>
>>>     V 320-762-2933
>>>        320-762-2999
>>>     F 320-762-2998
>>>
>>>      
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> -
>>> --
>>>
>>> ---------------------------------------------------------------------
>>> -
>>> --------
>>> This SF.net email is sponsored by Sprint
>>> What will you do first with EVO, the first 4G phone?
>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>>>
>>>
>>> ---------------------------------------------------------------------
>>> -
>>> --
>>>
>>> _______________________________________________
>>> Geomoose-users mailing list Geomoose-users at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geomoose-users
>>
> 
> 





More information about the Geomoose-users mailing list