1.0.1 • Published 2 years ago

ol-json-style v1.0.1

Weekly downloads
-
License
BSD 2-Clause "Sim...
Repository
github
Last release
2 years ago

ol-json-styles

This package can use json instead of classes to make OpenLayers style easily shareable.

import { loadStyle } from "ol-json-style";

const json = {
    Style: {
        fill: {
            Fill: {
                color: "red",
            },
        },
        stroke: {
            Stroke: {
                color: "blue",
            },
        },
    },
};

const myStyle = loadStyle(json);

const layer = new VectorLayer({
    source: source,
    style: myStyle,
});
1.0.1

2 years ago

1.0.0

2 years ago