-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Issues with tutorial and documentation #302
Comments
Thanks for the info @davidblasby!
We introduced a breaking change with geostyler-style@5, which changes the usage of the The tutorials need to be updated to describe how to work GeoStyler with the new API. As a workaround for you, there are two options:
|
In JavaScript, you are free to name imports/requires as you like, as you are actually just assigning a variable.
or
the parser will be assigned to the variable |
I can reproduce the error. There seems to be a version mismatch. Until this is fixed, it is better to use Node<16. Thanks for the info! |
solved with geostyler/geostyler#1524 |
Bug
I am a JS tool-chain beginner. I'm trying to follow the beginner tutorial and the github documentation.
Beginner Tutorial
https://geostyler.github.io/geostyler-beginner-workshop/
I installed the latest node 12, and then tried to run the big code block in the "Parsing SLD" section.
However, I get an error (in the browser) when i do this:
"Error: Objects are not valid as a React child (found: object with keys {errors}). If you meant to render a collection of children, use an array instead."
I did some digging and the error is in the
sldParser.writeStyle(style)
method."Cannot read properties of undefined (reading 'map')"
Sorry I cannot give more details, but that's the best info I could get with my knowledge.
Trying to Install Geostyler with npm
I noticed that the advanced workshop used node v6. I went to another machine, and installed the latest node (
brew install node@16
).npm i geostyler
This failed.
I went to node v14 (
brew install node@14
).npm i geostyler
This worked. Perhaps the documentation should indicate which node version to run.
Trying to get SLD parser working
I then moved on to https://github.com/geostyler/geostyler-sld-parser so I could try to get the tutorial code working.
I wasn't sure how to run the sample code (README).
The documentation shows this;
const parser = new SLDParser();
The code seems to indicate that this should be
SldStyleParser
- see https://github.com/geostyler/geostyler-sld-parser/blob/master/src/SldStyleParser.ts#L69The second example in the README uses;
var parser = new GeoStylerSLDParser.SldStyleParser();
I was able to get this working (code in
app.js
node app.js
):I think the README should be updated to use
SldStyleParser
and perhaps add an easy-to-run node command (as above).I will try to add a doc update to the Git repo, but I have no idea what's wrong with the tutorial.
The text was updated successfully, but these errors were encountered: