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

Viewer.getState - add more info in error when no source #185

Open
emoen opened this issue May 7, 2013 · 2 comments
Open

Viewer.getState - add more info in error when no source #185

emoen opened this issue May 7, 2013 · 2 comments

Comments

@emoen
Copy link
Contributor

emoen commented May 7, 2013

In Viewer.js - getState -
...
if (!source) {
throw new Error("Could not find source for layer '" + record.get("name") + "'");
}

should be more verbose if eg. layer is a OpenLayers.Layer.Vector. Replace with something like:
throw new Error("Could not find source for record '" + record.get("name") + " and layer" + layer.name + "'");

@emoen
Copy link
Contributor Author

emoen commented May 7, 2013

Also OpenLayers.Layer.Vector has no source so can be skipped - by replacing
if (layer.displayInLayerSwitcher ) {
with
if (layer.displayInLayerSwitcher && !(layer instanceof OpenLayers.Layer.Vector) ) {

@ahocevar
Copy link
Contributor

ahocevar commented May 7, 2013

Thanks for the bug report @emoen. Would you be able to provide a pull request?

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

2 participants