Hi,

I did this some time ago... You just need to GET the description of the
layergroup , via REST. (Something like:
http://localhost:8080/geoserver/rest/layergroups/<yourgroup>.[format] (I
used json in format).

Then you need to add the new layer to the json, with something like this:

{
name: "layer_name",
href: "http://localhost:8080/geoserver/rest/layers/layer_name.json";
}

(This is valid only when using json)...

At last, all you need to do is POST it back to the same URL you got it.

Getting the layergroup description will show you all you can change in
it...

Regards,

Rodrigo C. Antonialli
======================================
Rio Claro - SP - Brasil
LinkedIn: http://www.linkedin.com/in/rcantonialli
Contato:  (19) 98136-2347
              rcantonia...@gmail.com
              Skype: rc_antonialli


On Tue, Apr 29, 2014 at 5:29 PM, tt5430 <tt9...@gmail.com> wrote:

> I have an existing layerGroup:
> workspace: NAIP
> name: NAIP-Imagery
> and a new layer that I would like to add to this layerGroup:
> workspace:NAIP
> store: Store1
> layerName: layer1
>
> I'd like to add this layer to the layerGroup and could not find any example
> for that.  All examples I saw were to create new layerGroup with layers.  I
> assume this can be done with REST api and hope someone can show me how.
>
> Many thanks in advance.
>
> Regards,
> Tam
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/REST-API-for-adding-new-layer-to-existing-LayerGroup-tp5137863.html
> Sent from the GeoServer - User mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.  Get
> unparalleled scalability from the best Selenium testing platform available.
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to