Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVolland authored Nov 30, 2018
1 parent 6f1c2eb commit c7b705f
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,67 @@
[![npm version](https://badge.fury.io/js/geostyler-sld-parser.svg)](https://www.npmjs.com/package/geostyler-sld-parser)

[GeoStyler](https://github.com/terrestris/geostyler/) Style Parser implementation for Styled Layer Descriptor (SLD)

### Issues
Please provide related issues here https://github.com/terrestris/geostyler/issues

### How to use

ES6:
```js
import SLDParser from "geostyler-sld-parser";

const pointSimplePoint = {
name: "My Style",
rules: [
{
name: "My Rule",
symbolizers: [
{
kind: "Mark",
wellKnownName: "Circle",
color: "#FF0000",
radius: 6
}
]
}
]
};

const parser = new SLDParser();

parser
.writeStyle(pointSimplePoint)
.then(sld => console.log(sld))
.catch(error => console.log(error));
```

Browser:

```js
const pointSimplePoint = {
name: "My Style",
rules: [
{
name: "My Rule",
symbolizers: [
{
kind: "Mark",
wellKnownName: "Circle",
color: "#FF0000",
radius: 6
}
]
}
]
};
var parser = new GeoStylerSLDParser.SldStyleParser();
parser
.writeStyle(geostyle)
.then(function(style) {
console.log(style);
})
catch(function(error) {
console.log(error);
});
```

0 comments on commit c7b705f

Please sign in to comment.