-
Notifications
You must be signed in to change notification settings - Fork 43
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
Feature request: custom WMS layers for django-olwidget #60
Comments
Okay, I've added a 'custom.foo' constructor. This gist shows how it works, with an example in the docs - though rather than applying this to my olwidget fork, so far I'm applying this as a monkeypatch in my own javascript. |
On second thought, I pushed it to my fork as the custom_base_layers branch. |
We need this functionality too. I think the ideal way to do this would be to have, in settings.py:
rather than declare this explicitly in JS-land. Then in JS we can allow olwidget.registerCustomBaseLayers() which acts in much the same way. I've added this to my fork's custom_base_layers_fixed branch. I'll issue a pull request after we've played with it in production for a bit. |
Interested to see how this plays out, could be major win for one of my current projects too. Please keep us posted. |
I've issued a pull request after using this in production for a few weeks. |
yourcelf, any thoughts on this? |
Much like #47 ... I'd like to be able to add any WMS server as a base layer option, via some array or something in settings.py.
If the wms server didn't need any extra options, one expedient hack might be to interpret unknown types as URLs, eg. do this in olwidget.js at the end of the wms function:
{{{
...
} else if (type === "blank") {
return new OpenLayers.Layer("", {isBaseLayer: true});
}
else {
return new OpenLayers.Layer.WMS("custom WMS server", type);
}
}}}
but this is pretty obviously lame: you're going to need to pass options somehow.
I have one possibly better idea to pursue, will check it out.
The text was updated successfully, but these errors were encountered: