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

Generate legend for GeoJSON files without styling #1353

Closed
stevage opened this issue Mar 1, 2016 · 3 comments
Closed

Generate legend for GeoJSON files without styling #1353

stevage opened this issue Mar 1, 2016 · 3 comments

Comments

@stevage
Copy link
Contributor

stevage commented Mar 1, 2016

Raised at #910 and #791.

There are a couple of difficulties here:

  • first, if there is styling built into the GeoJSON, it could be pretty fiddly working out how to represent it in a legend. Eg, do we collect every single different style and draw a box for each?
  • secondly, if we solve the first bit, how would we label each box? We don't know what the colours mean, if they have some deeper semantic significance (eg, all anchor symbols represent ports).

But in the basic case (unstyled points), it would be good to show at least label the dataset: green circles = myfile.geojson.

@kring kring changed the title Show legends for GeoJSON files Generate legend for GeoJSON files without styling Feb 19, 2018
@kring
Copy link
Member

kring commented Feb 19, 2018

It's a shame that simplestyles doesn't make any allowance for legends. Given that, a generated legend for a fully-styled GeoJSON is not realistic, but Steve's final suggestion of showing a simple legend in the default case (no styling) is pretty easy.

@kring kring added Z-Small and removed Z-Medium labels Feb 19, 2018
@kring
Copy link
Member

kring commented Feb 19, 2018

If the styles are specified in the TerriaJS init file (rather than per-feature in the GeoJSON), the legend should reflect them, of course.

@nf-s
Copy link
Contributor

nf-s commented Nov 16, 2021

This is now supported for new ProtomapsImageryProvider geojson items (#5900). To use this you will need to set Terria.configParameters.enableGeojsonVt = true

There is still no automatic legend for GeoJson items which use simple-style (inside Feature properties)

I'm going to close this issue, we can re-open later if needed

@nf-s nf-s closed this as completed Nov 16, 2021
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

3 participants