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

GeoJSON layer with several styles, only uses one of them #340

Open
Unraveler opened this issue May 19, 2021 · 0 comments
Open

GeoJSON layer with several styles, only uses one of them #340

Unraveler opened this issue May 19, 2021 · 0 comments

Comments

@Unraveler
Copy link
Contributor

Unraveler commented May 19, 2021

This is related to the GeoJSON serializer.

If a layer has two styles, only one of them will be used.

e.g.

style": {
  "0": {
    "fillColor": "#000000",
    "fillOpacity": 0,
    "strokeColor": "#96d361",
    "strokeDashstyle": "5 5",
    "strokeOpacity": 1,
    "strokeWidth": 2
  },
  "1": {
    "fillColor": "#000000",
    "fillOpacity": 0,
    "strokeColor": "#ff0000",
    "strokeDashstyle": "5 5",
    "strokeOpacity": 1,
    "strokeWidth": 2,
     "strokeDashoffset": 5
  }
}			},

only one of this styles will be used for printing. Actually is the one that is defined in the GeoJSON feature properties:

"properties": {
  "_style": 1,
  ...
}							},

I tried to add it as "0 1", [0, 1], or ["0", ",1"], but it didn't work, resulting in the same or no rendering of the feature at all.

A found solution for it is to actually render the same element as many times as there are a style, but that is a very poor and dumb solution in my opinion. There has got to be a better way to handle this.

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

No branches or pull requests

1 participant