Note that there is the "GetStyles" request (it's part of the SLD spec) - this 
returns the Style used for the layer as XML.

There are various convertors out there to convert XML to JSON - if you plugged 
one of them in as a piece of middleware between the client which needs JSON and 
GeoServer which is returning XML, you can probably get the desired outcome.
You can then parse the JSON to determine what the legend should be; easy for 
simple things (i.e. a polygon with a fill), but probably not desirable for more 
complex styles.

Cheers,
Jonathan


---- On Thu, 17 Mar 2016 14:45:43 +0000 Deepti 
Puri<deepti202j...@gmail.com> wrote ---- 

Form ArcMap service - we get JSON for Legend similar to this 

https://pxxxx.com/arcgis/rest/services/aaa/aaa/MapServer/Legend?f=pjson&token=ddddd.&callback=angular.callbacks._0

 angular.callbacks._0({ "layers": [ { "layerId": 1, "layerName": "abc", 
"layerType": "Feature Layer", "minScale": 0, "maxScale": 0, "legend": [ { 
"label": "", "url": "76d5be60e5691543860aa46358f5dcf8", "imageData": 
"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAF9JREFUOI1jYaAyYIExzFcw/EeXPBnBwEisPIaBlACYZScjGBjhBmKzjZBrsAGquBDDQGQnU8VAagKqGIjss8HpQgwDKY0MrOmQWmA0HZIH6J8OKSkbqZIOCbqQkrIRAPKcIWF3tuu1AAAAAElFTkSuQmCC
 "contentType": "image/png", "height": 20, "width": 20 } ] },
Geoserver has the option getlegendgraphics for WMS- which is returning image. I 
will need something similar as above. I noticed this proposed change: 
https://github.com/geoserver/geoserver/wiki/GSIP-81---GetLegendGraphic-as-text-(JSON)
Is it part of any release? I am beginner in geoserver and have installed 2.8.2 
(stable release) recently. Please advise. 
Thanks


 ------------------------------------------------------------------------------ 
Transform Data into Opportunity. 
Accelerate data analysis in your applications with 
Intel Data Analytics Acceleration Library. 
Click to learn more. 
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________
 
Geoserver-users mailing list 
Geoserver-users@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/geoserver-users 




------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to