WMS Decorations

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

WMS Decorations

Milan
Hi, All

I created a legend using GetLegendGraphic.
Then I used WMS Decorations from GeoServer User Manual, to add a legend to the map, but I failed.

Can someone help me how to add a legend and scaleline to the map? Is there any example of this?

Thanks!

Milan
Reply | Threaded
Open this post in threaded view
|

Re: WMS Decorations

Milan
I succeeded. If someone needs help....
Reply | Threaded
Open this post in threaded view
|

Re: WMS Decorations

zmagyar
Dear Milan,

I have also the same problem with WMS Decoration.
Please help me!

How can I insert the layout request into my JavaScript code?

Thanks for advance!

Zsolt, Magyar
Forestry Directorate of CAO
Reply | Threaded
Open this post in threaded view
|

Re: WMS Decorations

Milan
Hi,

1. First you must create folder layouts in C:\Program Files\GeoServer 2.1-RC5\data_dir.
2. In follder layouts crerate  xml file that includes, for example:

<layout>
    <decoration type="image" affinity="bottom,left" offset="6,6" size="80,31">       
    </decoration>
    <decoration type="scaleline" affinity="bottom,left" offset="36,6"/>
    <decoration type="legend" affinity="top,right" offset="6,6" size="auto"/>       
</layout>


3. When you preview map with OpenLayers the request is, for example
 http://localhost:8080/geoserver/Doplomski_Kalemegdan/wms?service=WMS&version=1.1.0&request=GetMap&layers=Doplomski_Kalemegdan:Putna_mreza&styles=&bbox=7456663.447,4963974.072,7457375.958,4964914.644&width=387&height=512&srs=EPSG:3909&format=application/openlayers
there is no legend or scaleline.

4. To display the legend, at end of the previous request you have to add request parameter &format_options=layout:Put , where layouts refers to the folder and Put refers to the xml file that is located in the folder layout.  The request for map with legend looks like this:

http://localhost:8080/geoserver/Doplomski_Kalemegdan/wms?service=WMS&version=1.1.0&request=GetMap&layers=Doplomski_Kalemegdan:Putna_mreza&styles=&bbox=7456663.447,4963974.072,7457375.958,4964914.644&width=387&height=512&srs=EPSG:3909&format=application/openlayers&format_options=layout:Put

I hope it will help with!!!
Reply | Threaded
Open this post in threaded view
|

RE: WMS Decorations

zmagyar

Thanks for your fast response!

 

But I don’t want to put format_option=layout: … only in the request. I want to insert into a javascript

 

There are many of layers like this in the script:

Forest_map = new OpenLayers.Layer.WMS(

                    "Forest", "http://erdoterkep.mgszh.gov.hu:80/geoserver/wms",

                    {

                        layers: 'forest_polyg',

                        styles: 'protection',

                        srs: 'EPSG:23700',

                        format: 'image/png',

                        transparent: 'TRUE'

                    },

                    {singleTile: true, ratio: 1}

                );

 

Where can I put the layout stuff…?

 

Could you be so kind and help one little more!

 

Thanks!

Zsolti

 

 


From: Milan [via OSGeo.org] [mailto:[hidden email]]
Sent: Wednesday, June 22, 2011 3:11 PM
To: Magyar Zsolt
Subject: Re: WMS Decorations

 

Hi,

1. First you must create folder layouts in C:\Program Files\GeoServer 2.1-RC5\data_dir.
2. In follder layouts crerate  xml file that includes, for example:

<layout>
    <decoration type="image" affinity="bottom,left" offset="6,6" size="80,31">       
    </decoration>
    <decoration type="scaleline" affinity="bottom,left" offset="36,6"/>
    <decoration type="legend" affinity="top,right" offset="6,6" size="auto"/>       
</layout>


3. When you preview map with OpenLayers the request is, for example
 http://localhost:8080/geoserver/Doplomski_Kalemegdan/wms?service=WMS&version=1.1.0&request=GetMap&layers=Doplomski_Kalemegdan:Putna_mreza&styles=&bbox=7456663.447,4963974.072,7457375.958,4964914.644&width=387&height=512&srs=EPSG:3909&format=application/openlayers
there is no legend or scaleline.

4. To display the legend, at end of the previous request you have to add request parameter &format_options=layout:Put , where layouts refers to the folder and Put refers to the xml file that is located in the folder layout.  The request for map with legend looks like this:

http://localhost:8080/geoserver/Doplomski_Kalemegdan/wms?service=WMS&version=1.1.0&request=GetMap&layers=Doplomski_Kalemegdan:Putna_mreza&styles=&bbox=7456663.447,4963974.072,7457375.958,4964914.644&width=387&height=512&srs=EPSG:3909&format=application/openlayers&format_options=layout:Put

I hope it will help with!!!

Thanks,

Milan Božić

University of Belgrade
Surveying and Geoinformatics, 2006 - 2009
Geoinformatics, 2009 - 2011

E: [hidden email]
T:+381645258153

 


If you reply to this email, your message will be added to the discussion below:

http://osgeo-org.1803224.n2.nabble.com/WMS-Decorations-tp6390926p6504179.html

To unsubscribe from WMS Decorations, click here.

Reply | Threaded
Open this post in threaded view
|

RE: WMS Decorations

Milan
Sorry, but I don't know to help you now.  If I learned something, I'll tell you.
Reply | Threaded
Open this post in threaded view
|

RE: WMS Decorations

zmagyar

OK. Thank you!

Zsolt

 

 


From: Milan [via OSGeo.org] [mailto:[hidden email]]
Sent: Wednesday, June 22, 2011 9:48 PM
To: Magyar Zsolt
Subject: RE: WMS Decorations

 

Sorry, but I don't know to help you now.  If I learned something, I'll tell you.

Thanks,

Milan Božić

University of Belgrade
Surveying and Geoinformatics, 2006 - 2009
Geoinformatics, 2009 - 2011

E: [hidden email]
T:+381645258153

 


If you reply to this email, your message will be added to the discussion below:

http://osgeo-org.1803224.n2.nabble.com/WMS-Decorations-tp6390926p6505834.html

To unsubscribe from WMS Decorations, click here.