GeoStyler-Style-Parser implementation for Masterportal Styles
ES6:
import MasterportalParser from "geostyler-masterportal-parser";
const pointSimplePoint = {
name: "My Style",
rules: [
{
name: "My Rule",
symbolizers: [
{
kind: "Mark",
wellKnownName: "circle",
color: "#FF0000",
radius: 6
}
]
}
]
};
const parser = new MasterportalParser();
const { output: mpStyle } = await parser.writeStyle(pointSimplePoint);
console.log(mpStyle);
Browser:
const pointSimplePoint = {
name: "My Style",
rules: [
{
name: "My Rule",
symbolizers: [
{
kind: "Mark",
wellKnownName: "Circle",
color: "#FF0000",
radius: 6
}
]
}
]
};
var parser = new GeoStylerMasterportalParser.MasterportalStyleParser();
parser
.writeStyle(pointSimplePoint)
.then(function(res) {
var mpStyle = res.output;
console.log(mpStyle);
});
Maintenance and further development of this code can be funded through the GeoStyler Open Collective. All contributions and expenses can transparently be reviewed by anyone; you see what we use the donated money for. Thank you for any financial support you give the GeoStyler project 💞