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

Legend shows items with no GetLegend response #64

Closed
jonathan-wcc opened this issue Jun 5, 2013 · 7 comments
Closed

Legend shows items with no GetLegend response #64

jonathan-wcc opened this issue Jun 5, 2013 · 7 comments

Comments

@jonathan-wcc
Copy link

A subjective one.

I have a layer enabled on my map that's not visible because it has a scale threshold and I'm outside that range.

However, when I print the map, MFP 2.0 shows the legend item below (Bus Stops):

clipboard02

What I think it should do is see that the GetLegend response doesn't actually include a graphic and then omit the legend item entirely.

@jbjonesjr
Copy link
Contributor

Jonathan, I think the wms spec responds with a full list of features available, regardless if they are available in a single viewport or not. I do not think it is common for a "client" to keep track of what features are in view and update the legend accordingly.

Let me know if you have a contradictory example.

@jonathan-wcc
Copy link
Author

Hey,
The GetLegend request doesn't seem to return a legend if the item is outside of viewing threshold. Instead, at least in the case of GeoServer, it returns an exception:
"java.lang.IllegalArgumentException: no legend passed
no legend passed"

My view is that on a printed map, a legend item shouldn't be printed if there is no legend item to print. From the end users perspective, having "Bus Stops" on a legend as in my original screenshot is worse than pointless - its taking up valuable map space to tell them absolutely nothing.

Incidentally, some clients do update the legend - I think its a common GeoExt thing. See:
http://lib.heron-mc.org/heron/0.73/examples/defaultnl/index.html
Try "streekpaden"
or "BAG - Verbilfsobjecten"
and zoom in/out.

They don't show the legend image itself (they can't, there isn't one at those scales), but they do still show the text.

@geekdenz
Copy link
Contributor

If I understand this correctly, you don't want to print legend items that are not displayed on the map. This is a very similar requirement if not the same we have. Basically, when the map only displays 'class 1', 'class 3' and 'class 4', it should not show 'class 2' in the legend, right?

If this is what this issue is about, please confirm so that I can work against this.

So, GeoServer and MapServer actually return an exception if you give them a GetLegend request and the class is not defined for that extent? If yes, please detail how to configure this in MapServer as we are quite keen on this feature as well.

@jonathan-wcc
Copy link
Author

Hi Tim,
Not quite. In this particular case there's a scale threshold on the layer. The layer is enabled but I am zoomed out too far for it to be rendered.

The legend shouldn't be shown because the layer isn't shown on the map.

From MFP's perspective it is simply amatter of noting that the response from the server was an exception rather than a PDF. If an exception has been received it shouldn't print any part of that particular legend item.

Hope that's clearer.

@geekdenz
Copy link
Contributor

Yes it is and i think it would actually be reasonably simple to implement. However, I will need to find some time to do it.

@jonathan-wcc
Copy link
Author

Has this been fixed but the ticket not closed? It doesn't seem to be happening in the 2.0.0 release.

@geekdenz
Copy link
Contributor

Closing because @jonathan-wcc reports it to be fixed.

jesseeichar pushed a commit that referenced this issue Oct 10, 2014
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

3 participants