Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing map layer style breaks layer #12752

Open
jeff-bradley opened this issue Nov 27, 2024 · 4 comments
Open

Changing map layer style breaks layer #12752

jeff-bradley opened this issue Nov 27, 2024 · 4 comments

Comments

@jeff-bradley
Copy link

Expected Behavior

After changing a layers style in a map, I can click the Layer Settings button and under the Style setting switch between the new style and another style.

Actual Behavior

When clicking the Layer setting button it either instantly fails or the panel opens and when selecting the Style settings dropdown I get this error
image

Steps to Reproduce the Problem

  1. Add a layer to a map
  2. Change the layers style and click Apply
  3. At this point it works as i would think and can use the Layer settings > Style settings panel to toggle between styles.
  4. Change the style again
  5. Save the map and close
  6. Open map
  7. Click Layer settings for the layer

Specifications

  • GeoNode version: master
  • Installation type (vanilla, geonode-project): geonode-project
  • Installation method (manual, docker): docker
  • Platform: ubuntu 20
  • Additional details:
    Experienced the same behavior on the demo site

If I remove the styles array from the maps_layer extra params column I am able to get the layer to work again

{
"msId": "9a4e93cb-296e-4086-a18c-9cd5519eacbb",
"styles": [
{
"name": "geonode:e3a7d800-ace9-11ef-bdfa-259dc132ae4c_ms_airports",
"title": "airports",
"format": "sld"
}
]

}

The console log
TypeError: Cannot read properties of undefined (reading 'LAYER')
at visual-style-editor-…ea.chunk.js:1:28531

I do not see any network calls before the error comes up.

@giohappy
Copy link
Contributor

@jeff-bradley can you prepare a reproducible setup either on the stable or dev GeoNode demos?

@jeff-bradley
Copy link
Author

jeff-bradley commented Nov 28, 2024

@giohappy here is a test map on the development site. once I click style settings I get an error
https://development.demo.geonode.org/catalogue/#/map/1652

@kikislater
Copy link
Contributor

kikislater commented Dec 5, 2024

I have the same problem with a 404 in geoserver logs like :

24 Oct 11:16:10 ERROR [geoserver.rest] - No such style: my_beautiful_layer_20231211
org.geoserver.rest.ResourceNotFoundException 404 NOT_FOUND: No such style: my_beautiful_layer_20231211

Whereas the style exists.

Btw I think it is not the same issue, it is about uploading an SLD in v1.1.0. Did you upload an SLD before ? If you try with more logs you will see an error during uploading sld 1.1.0 you will see:

celery     |   File "/usr/local/lib/python3.10/dist-packages/geoserver/style.py", line 34, in __init__
celery     |     assert style_format in Style.supported_formats
celery     | AssertionError

Error about SLD in 1.1.0 version is also reported using the rest api here below:
eblondel/geosapi#29

SLD 1.1.0 is still not supported:
https://github.com/GeoNode/geoserver-restconfig/blob/master/src/geoserver/style.py#L24-L28

@jeff-bradley
Copy link
Author

jeff-bradley commented Dec 13, 2024

I can see the original issue has been resolved by what I think is part of the mapstore client integration. The new settings panel works a lot better, as I do not see the issue if the layer has multiple styles (the image has a second style created in geoserver not geonode)
image

Not sure if need to open a new issue if I cant seem to create the second style in geonode to have it show up under the style selection list. For example when changing a style layers style in a map it works with no issue but after clicking the layer settings and going to the style tab only the original style exists and when selecting this it does change the style but i am unable to return to the other style just created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants