-
Notifications
You must be signed in to change notification settings - Fork 799
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
1180-image-and-token #1181
1180-image-and-token #1181
Conversation
- removed options.f conditional override during initialization of DynamicMapLayer (related to #1180); - standardized usage of params.token and params.proxy in "_buildExportParams" and "_requestExport" of DynamicMapLayer and ImageMapLayer; - prepended optional params.proxy in "_requestExport" of DynamicMapLayer and ImageMapLayer;
I'd say these changes are a great candidate for some TDD. what you're proposing is adding support for manipulating DynamicMapLayer
right now Travis is reporting a failing test. if you can fix that test and add two more then we'd be (reasonably) sure that the tweaks accomplish what you advertise and won't break any existing use cases. this test would be a good one to copy/paste and modify. sound good? |
Just to be clear, we are NOT pulling a /ImageServer as type image |
@jptheripper, yes thanks for the clarification. While working on this I wanted to make the same/similar changes to the related |
Perfect thank you. I really appreciate this. |
@jgravois I tinkered with and tried to work on the existing test for a but, but in the end I found that can get the test in question passing again by reversing this change: Which doesn't quite make sense to me since Thus (my bullet 3 above) I had hoped that by replacing
That's correct (for my bullet 4 above), but now I'm thinking about dropping proxy support for f: "image" since this PR already introduces enough changes and I don't want to hold up #1180 too long unless someone else has more free time for writing new proxy tests (which I found commented out). However, regarding adding token support for f: "image":
That's because |
The more I ponder this, the more I see this PR is trying to do too much. Let's start with @gavinr's new unit tests in PR #1182 and go from there. Perhaps then we can ultimately focus on only what is needed to satisfy issue #1180. Again, that's described above as:
My proposed change was to delete those override lines in |
those are wise words. it will always be possible to change the behavior for proxies in a follow-up pass and limiting a pull request to tackling one thing at a time doesn't just make it easier to write, it makes it easier to read too. |
This was initially related to Dynamic layer cannot use both f:image and token #1180 to allow both an optional
token
andf: image
for aDynamicMapLayer
instance. It seems that the conditional override off
in theinitialize
method was not allowing both of these options to persist. But, I still don't know what the original intent of this was and it would be easier to rest at night if we could find out. The similarly-structuredImageMapLayer
does not do this in itsinitialize
.Please also reference changes introduced a few months ago for issue DynamicMapLayer and Proxy JSON returned results in Proxy Request ?undefined #1153 that involved related blocks of code in
DynamicMapLayer
's_requestExport
. I'm leaving this as a breadcrumb here in case we find in the future that we need to add the same extra checks inImageMapLayer
's_requestExport
.Along the way I standardized similarities I noticed between
DynamicMapLayer
andImageMapLayer
in their usage ofthis.options
vsparams
in their_buildExportParams
and_requestExport
methods.Finally, I added an optional prepending of
params.proxy
whenf
isimage
for both layer types.I do not have a way to easily test this functionality. We may want to strike it from this PR and reconsider it in the future if it is reported as an issue that someone can't use both
f: image
and aproxy
. Note that the appending ofparams.token
was already successfully assumed to occur in the code.I can consider updating related tests once we have a chance to talk a bit about these changes.
I also added 3 new debug HTML pages to verify my work so far.
cc @jgravois @jptheripper