Hello,

I'm new with Cartaro, and is't a great feature once you got it working.
Everything runs fine now, but i'm having to following issue.

I am trying to figure out how to:
1) change the look and colors of the Geometry type you can add.
Things like the color of a polygon, color and thickness of a line, size of point, etc.

2) activate OpenLayers Styles (Home » Administration » Structure » OpenLayers » Styles)
I managed to create custom extra styles, but it seems i am missing something.
How and where can i activate them, use them in my layers?

There seems to be no description anywhere on how to use your custom styles.

Thx in advance

Comments

VBN’s picture

I tried to follow the instructions here, but is't not working

http://docs.geoserver.org/latest/en/user/styling/sld-cookbook/points.htm...

ulim’s picture

We are working on more detailed documentation of custom styling in Cartaro. Until this is done please refer to the HowTo on the Cartaro site and the documentation for the OpenLayers module:

http://cartaro.org/blog/14-how-use-qgis-great-looking-symbols-cartaro
https://drupal.org/node/1585880

If this doesn't help, please be a little more sepcific in your explanation what you want to do and which errors you see.

VBN’s picture

I'll do some tests, thx

VBN’s picture

I do find the QGIS way to complicated for a style change.
I just want to activate some symbols i created in the openlayers styles

If i check everything in the style layer selection menu (capture 0), there are no changes.
The default icon stays the same on the map.

VBN’s picture

Meanwhile i figured out that any changes in the SLD (style Layer descriptor) are not registered.
Layer style changes wont work, the layer stays gray.

What do i do wrong?

VBN’s picture

Priority: Normal » Major
azuledu’s picture

Hi Nico.
The problem is that you are applying a Openlayers Style over a WFS GeoServer layer. Currently, the Geoserver module does not allow override GeoServer styles with OpenLayers styles. This is a functionality we want to implement in the future but there is no date for it.
The way of achieve what you want is defining SLD styles directly in GeoServer (http://docs.geoserver.org/latest/en/user/styling/index.html). You can also define dynamic styles using SLD filters.

VBN’s picture

Ok, thx for the WFS Geoserver layer info.
No need to apply then.

But i still have a problem when modifying the geoserver SLD style under drupal.
I get the following error:
"Failed to completely update style. See the log for details."

Logfile:
Error when attempting to create style capital: Access to http://[myserver]/geoserver/rest/workspaces/cartaro/styles.sld?name=capital returned HTTP status code 404.

azuledu’s picture

Annoying, "random" and not-easily reproducible error....
Reported here: https://drupal.org/node/2098941
As a workaround, I added a new line at the end of the SLD definition inside Drupal. Sometimes, GeoServer do the same when a style is saved using the GeoServer UI.

VBN’s picture

Ok, i'll give it a try

azuledu’s picture

The layer SLD style can be defined in GeoServer directly or using the Drupal GeoServer module.

The layer displayed style (screenshot 1) should be the same as the displayed style inside Drupal (screenshot 2) if you are using the WFS layer of GeoServer from Openlayers module.

VBN’s picture

I deployed a new geoserver in tomcat and started over.

It seems there was a problem with the settings of "Using Drupal users and roles" in GeoServer.
The way to go was this:
I added a user with the drupal login and pass into geoserver and returned to default settings (for Active Role Service).
-> this results into the following: I need to add every Drupal member also in geoserver with the correct pass, in order to project the map in Drupal.
A bit of a hassle, but it works.

Now the SLD is indeed projected the way i want.

Phew, this still asks a lot of works guys.
Hope i could help in some way, keep up the good work

azuledu’s picture

Drupal and Geoserver user, roles and permissions synchronization can be done automatically with the Geoserver-Drupal extension. Documentation can be found here: https://drupal.org/node/1778042
Data permissions are explained here: https://drupal.org/node/2138329

Thanks for your help offer. Suggestions for improve Cartaro or patches to its modules are always welcome. Now that you are installing and testing, adding your findings to the documentation or clarify obscure points will be the best.

VBN’s picture

Last question:

Why does the SLD looks different in Drupal then the default SLD information (cookbook version)?

I'll give an example:
Default code

<?xml version="1.0" encoding="UTF-8"?><sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
          <NamedLayer>
          <Name>capital</Name>
               <UserStyle>
               <Name>default</Name>
               <Title>Capital</Title>
                    <FeatureTypeStyle>
                         <Rule>
                              <PointSymbolizer>
                                   <Graphic>
                                   <Mark>
                                   <WellKnownName>circle</WellKnownName>
                                   <Fill>
                                   <CssParameter name="fill">#FF0000</CssParameter>
                                   </Fill>
                                   </Mark>
                                   <Size>8</Size>
                                   </Graphic>
                              </PointSymbolizer>
                         </Rule>
                    </FeatureTypeStyle>
               </UserStyle>
          </NamedLayer>
     </StyledLayerDescriptor>

And the Drupal version to insert:

<?xml version="1.0" encoding="UTF-8"?><sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
          <sld:NamedLayer>
          <sld:Name>capital</Name>
               <sld:UserStyle>
               <sld:Name>default</sld:Name>
               <sld:Title>Capital</sld:Title>
                    <sld:FeatureTypeStyle>
                         <sld:Rule>
                              <sld:PointSymbolizer>
                                   <sld:Graphic>
                                   <sld:Mark>
                                   <sld:WellKnownName>circle</sld:WellKnownName>
                                   <sld:Fill>
                                   <sld:CssParameter name="fill">#FF0000</sld:CssParameter>
                                   </sld:Fill>
                                   </sld:Mark>
                                   <sld:Size>8</sld:Size>
                                   </sld:Graphic>
                              </sld:PointSymbolizer>
                         </sld:Rule>
                    </sld:FeatureTypeStyle>
               </sld:UserStyle>
          </sld:NamedLayer>
     </sld:StyledLayerDescriptor>

If that sld: is not in front, i get following error:
-> Failed to completely update style. See the log for details.

Log details:
-> Error when attempting to update style capital: Access to http://[mysite]/geoserver/rest/workspaces/cartaro/styles/capital.sld returned HTTP status code 500.

Why is the sld: addition in front of every command?

VBN’s picture

Nobody?

augustus.kling’s picture

It should not matter if the sld: is in front of the elements as it points to the same namespace that is also the default namespace. See http://www.w3.org/TR/xml-names/#defaulting for details.

That being said both documents can be considered equal, thus both should work. Check your GeoServer log file for details.

Anonymous’s picture

Status: Active » Closed (fixed)