[mapserver-users] RE [Polluriel potentiel] Re: proportional circle legend SOLVED

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Wed Dec 19 08:31:54 PST 2012


I need a dynamic legend since I use variable substitution in the FILTER. 
In the interface the user can change parameters, years per example. So the 
SIZE of the circles and the class titles will change.

Here is what I did to manage this
In the Mapfile I use one class for getmap and 3 classes for the legend
FILTER (annee = '%annee%' AND contaminant = '%contaminant%' )
CLASS
        NAME "Concentration maximale horaire"
        STYLE
                SYMBOL 'CIRCLE'
                SIZE [rayonmax]
                COLOR 240 59 32
                OUTLINECOLOR 0 0 0
        END
END
#for the legend NAME will be replaced by TITLE and SIZE  value will be 
change in dostuff.php
CLASS
        NAME "rmax"
        STYLE
                SYMBOL 'CIRCLE'
                SIZE 15 #dummy value
                COLOR 240 59 32
                OUTLINECOLOR 0 0 0
        END
END
CLASS
        NAME "rmoy"
        STYLE
                SYMBOL 'CIRCLE'
                SIZE 13 #dummy value
                COLOR 240 59 32
                OUTLINECOLOR 0 0 0
        END
END
CLASS
        NAME "rmin"
        STYLE
                SYMBOL 'CIRCLE'
                SIZE 15 #dummy value
                COLOR 240 59 32
                OUTLINECOLOR 0 0 0
        END
END


The client call a php script instead of mapserver WMS requests
The php script query the DB to get the values and modify the TITLE and 
SIZE of the classes and launch the GetMap,GetFeatureInfo and 
getLegendGraphic requests.

Thanks for your help
Steve



Daniel Morissette <dmorissette at mapgears.com>@lists.osgeo.org 
Envoyé par : mapserver-users-bounces at lists.osgeo.org
2012-12-19 10:34

A
mapserver-users at lists.osgeo.org
cc

Objet
[Polluriel potentiel]  Re: [mapserver-users] proportional circle legend








Hi Steve,

I think your best would be to set a KEYIMAGE in your CLASS:

http://mapserver.org/mapfile/class.html

Daniel



On 12-12-17 1:39 PM, Steve.Toutant at inspq.qc.ca wrote:
>
> Hi,
> I created a thematic map showing proportional circles. I did that by
> using a table attribute for the SIZE of my circles. It works great.
> CLASS
> NAME 'Pop'
> STYLE
>          SYMBOL 'CIRCLE'
>          SIZE [rayonquot]
>          COLOR 168 221 181
>          OUTLINECOLOR 0 0 0
> END
> END
>
> I would like to generate a nice legend for this layer. Currently I get a
> small dot. I would like to create a commonly used legend for
> proportional circles such as
> 
http://www.google.ca/imgres?imgurl=http://makingmaps.files.wordpress.com/2007/08/scaled-circles.png&imgrefurl=http://makingmaps.net/2007/08/28/perceptual-scaling-of-map-symbols/&h=437&w=684&sz=49&tbnid=9UOZ3j0H8Wah_M:&tbnh=77&tbnw=120&zoom=1&usg=__m0l8_OAAITIGopuQGi7_yE7Ge4I=&docid=1U4GvObRwxH3MM&hl=fr&sa=X&ei=YGbPUO3NLKmq0AG2t4FA&ved=0CDgQ9QEwAQ&dur=656

>
>
> or
>
> 
http://www.google.ca/imgres?imgurl=http://www.historicalatlas.ca/website/hacolp/defining_episodes/military/unit_40/images/LEG_INFO_CE1419_final_rest.gif&imgrefurl=http://www.historicalatlas.ca/website/hacolp/defining_episodes/military/unit_40/U40_leg_info_CE1419.htm&h=90&w=217&sz=4&tbnid=nxf1TkPjY35LxM:&tbnh=50&tbnw=120&zoom=1&usg=__FbmbgCcqIwMCjLtNgWix6tyWeXc=&docid=dtQd4I2ykpB1FM&hl=fr&sa=X&ei=YGbPUO3NLKmq0AG2t4FA&ved=0CD4Q9QEwAw&dur=413

>
>
> Any ideas on how to do that?
> thanks
> steve
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


-- 
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000

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



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20121219/188525f3/attachment-0001.html>


More information about the mapserver-users mailing list