Skip to content
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

Custom shapes #75

Open
Razi91 opened this issue May 28, 2020 · 1 comment
Open

Custom shapes #75

Razi91 opened this issue May 28, 2020 · 1 comment

Comments

@Razi91
Copy link
Contributor

Razi91 commented May 28, 2020

There are many wellknownshapes that are not so 'well known', used in QGIS and GeoServer, like equilateral_triangle or half_square. WDYT: should them be hard-coded in this lib, or there should be made an endpoint to add them in your app code? It could be solved with a simple map.

Some shapes requires more ellastic style system (like half_square) in openLayers, I'm working on it.

@ajkopinga
Copy link
Member

I think that better interoperability with QGIS is a good argument for hard-coding these in the SLDReader library.

If someone wants to add other wellknown names, I think that adding a custom factory method might be the way to go. Perhaps something like this:

SLDReader.registerWellKnownSymbol('mycustomsymbol', function(size, olStroke, olFill) {
  // returns a new OpenLayers Image subclass (like Circle or Regularshape)
  // that uses the given size, olStroke and olFill.
})

And then store the factory function for 'mycustomsymbol' inside a map in wellknown.js, like you suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants