alpha transparency and querymap

Jim White jbw2003 at EARTHLINK.NET
Sun Dec 17 23:16:57 EST 2006


Steve,

Here are the querymap and symbol portions of the mapfile. I think that 
is what you mean by type.

 
     SYMBOL
         NAME 'hatch-lines'      
         TYPE HATCH
     END
    
     QUERYMAP
         STATUS ON
         STYLE  SELECTED
     END


Jim

Steve Lime wrote:
> Jim: What does the querymap def look like? What TYPE are you using?
>
> Steve
>
>   
>>>> Jim White <jbw2003 at earthlink.net> 12/13/2006 8:29:28 PM >>>
>>>>         
> Steve,
>
> First some of the mapfile:
>
>  OUTPUTFORMAT
>          NAME mypng
>          DRIVER "GD/PNG"
>          MIMETYPE "image/png"
>          IMAGEMODE rgba
>          EXTENSION "png"
>          TRANSPARENT ON
>  END
>
>   LAYER
>           CONNECTIONTYPE postgis
>           NAME "counties_q"
>           CONNECTION "user=postgres  dbname=mydb host=localhost"
>           DATA "wkb_geometry FROM county"
>           STATUS OFF
>           TYPE POLYGON
>           TRANSPARENCY alpha
>           CLASS
>                STYLE
>              SYMBOL 'hatch-lines'
>              COLOR 255 0 0      
>                    ANGLE 60
>                    SIZE 10
>                END     
>                STYLE
>                   WIDTH 2
>                   OUTLINECOLOR 255 0 0
>                END              
>                TEMPLATE "dummy.html"
>           END         
>       END
>
> Here's the PHP/mapscript for one of the layers that's used to display 
> items the user selects from a select box. The idea is to create a 
> transparent hatch pattern over a user created area of interest before
> it 
> is submitted. This is currently working with the maps we have but we 
> might like to add a satellite background or a shaded dem background, 
> which I imagine will look better in true color.
>
> $this_layer = $map->getLayerByName('counties_q');
> $this_layer->set('status', MS_OFF);
> if (isset($key_counties)) $this_layer->set('status', MS_ON);
> $layer_index = $this_layer->index;
> for($i=0; $i<count($key_counties); $i++){
>    @$map->queryByIndex($layer_index,1,$key_counties[$i], MS_TRUE);
>
> and followed eventually by:
>
> $queryimage = $map->drawQuery();
> $queryimage->saveImage($maploc);
>
>
>
> The counties_q layer will properly display in rgba mode if I just set
> it 
> to default and don't use the queryByIndex method to select particular 
> elements in the layer. It will also display properly in 256 color mode
>
> using queryByIndex. However, when I use queryByIndex in rgba mode the 
> hatch pattern is not transparent and has the white background.
>
> Thanks,
> Jim
>
>   
>


-- 
Jim White
Biodiversity and Spatial Information Center
North Carolina State University
http://www.basic.ncsu.edu/



More information about the mapserver-users mailing list