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
[WIP] print proxy blog post #369
Conversation
This is most commonly used as a print service for web applications allowing the user to download a PDF of the current map extent. | ||
|
||
### The Problem | ||
AGRC's [base map services](https://gis.utah.gov/data/base-map-and-imagery/) (including the [Google imagery](https://gis.utah.gov/data/google-imagery-license/)) are hosted as WMTS services on `discover.agrc.utah.gov`. In order to use them an organization needs to [register](https://gis.utah.gov/data/base-map-and-imagery/) and request a quad word. To prevent unauthorized use they are each locked down to a specific domain or set of domains. So if someone tries to use your quad word from any other domain or server the request is blocked. This all works well until you send a web map to the PrintingTools service in ArcGIS Server. The web map contains URL's to discover services that have quad words locked down to your web app's domain. When the service requests tiles, it does so from the server that is hosting the service not the browser. This causes discover to reject the request because the origin of the request does not match what the quad word is locked down to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any link to within gis.utah.gov should use a relative url and the liquid templating with the base url. See the readme for examples.
|
||
_Why don't I just use a wide open quad word in the first place?_ That's a great question. I'm glad you asked! Using wide open quad words in web applications would violate the [Organizational Usage Agreement](https://docs.google.com/a/utah.gov/forms/d/e/1FAIpQLScL5uUQIvw7op_ZcF4bijxcoOMGhNF0MXwJNGqSXS6IbjbKhA/viewform). It would be very easy for a savvy web developer to get your quad words and use them on their own site. | ||
|
||
AGRC's print proxy service is open source and available for download and deployment to your own servers from: https://github.com/agrc/print-proxy. Feedback and pull requests are welcome. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make this a hyperlink?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix up the links and if you want to fool with http://www.hemingwayapp.com/ go for it. Otherwise I think this is pretty cool
### The Solution | ||
To work around this issue AGRC developed a [print-proxy geoprocessing service](https://github.com/agrc/print-proxy). This service accepts the same parameters as Export Web Map with the addition of `ExportWebMapService_URL` which defines the Export Web Map Service that you want to proxy to. Then within the service, it simply switches out your locked down quad-word for a wide open one and passes the request onto the URL defined in `ExportWebMapService_URL`. | ||
|
||
_Why don't I just use a wide open quad word in the first place?_ That's a great question. I'm glad you asked! Using wide open quad words in web applications would violate the [Organizational Usage Agreement](https://docs.google.com/a/utah.gov/forms/d/e/1FAIpQLScL5uUQIvw7op_ZcF4bijxcoOMGhNF0MXwJNGqSXS6IbjbKhA/viewform). It would be very easy for a savvy web developer to get your quad words and use them on their own site. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a good idea to not tell people what they can do with the unregulated quad word. We don't need to give people ideas but this benign use case seems acceptable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm not clear; should I remove this sentence?
layout: post | ||
status: publish | ||
published: true | ||
title: 'Using discover.agrc.utah.gov Services PrintingTools/Export Web Map Service' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should shorten this title to something like 'Printing Web Maps with Discover Services'
email: stdavis@utah.gov | ||
date: 2017-02-02 21:04:30 | ||
categories: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the - Developer
category
OK. This looks good to me. I'd just like to get this reviewed by @rkelson before it gets merged... |
This is just the first draft. Feedback is welcome.