Open JakobMiksch opened 3 years ago
I'm recently running into some limitations with the StyleFactory, which has also confirmed by my dear colleague J.Kaeflein. I was searching, how we could make the app-conf layer style declarations a little more generic. Writing your own customized style language and then translating it to OpenLayers is apparently a long and stony process, so we should look for something existing / simplistic. The obvious choice would be to pick a kind of JSON serialization format of ol/style/Style. I found this little github project. From looking at the code its fairly similar to what we're doing but allows some more nested constructs (Disclaimer: I had not time to test it yet). Maybe there are some other project as well that follow a similiar pattern.
Some general words up in front: First of all the limitations of the StyleFactory
rely on the fact the Wegue was initially designed as little shiny app template and not an all-signing-all-dancing :notes: :dancers: configurable webmapping application framework (I'll give a more detailed public statement on that within the next time). Therefore it was merely thought to implement project specific things - also styles - on your own. The StyleFactory
was a little convenience layer to have simple styles out of the box. It was never intended to be a fully fledged OL Style libs.
Writing your own customized style language and then translating it to OpenLayers is apparently a long and stony process, so we should look for something existing / simplistic.
True, if we want to support generic style configs.
The obvious choice would be to pick a kind of JSON serialization format of ol/style/Style.
That's what its all about
I found this little github project.
This seems very old and nor more maintained. Apart from that there are more sustainable approaches to solve the problem of having a serializable style format for OpenLayers layers:
There is already the possibility to add a text based
label
to an existing style.This does not work when the layer style is text-based itself. See this example:
The label style replaces the icon which causes the layer to look like this:
(The points are the labels "Aral", "Mr Wash", "Shell", "Agip")