-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add support for Access Token when creating an ArcGISMapServerImageryProvider #11098
Conversation
Thanks for the pull request @Tamrat-B!
Reviewers, don't forget to make sure that:
|
Thanks @Tamrat-B! Great to get the most up-to-date servers in! A few items are needed before we can merge this PR:
|
@ggetz Hi Gabby! I'm George, the Esri developer who built our the ArcGIS x CesiumJS guide. We'd like to merge this PR ASAP so that it can fit into next week's Cesium build. Our CesiumJS guide is also slated for release next week (March 1st), but this PR needs to be merged before our guide can release. If we get this PR merged in time, we will be able to showcase a detailed Cesium integration at the Esri Developer Summit, which will benefit all parties. Can you help accelerate this review process? Tamrat is currently traveling and is unable to make contributions for the next few days. I will address the language concerns in your review, but I'm new to the repository so it will take me some time to fix the nontrivial issues. Any aspect of the review that you could assist with would be much appreciated. We could also delay some of the less important suggestions to a future release in order to merge a "version one" of this enhancement quickly. Thanks for your time. |
@gowin20 Hi George, nice to meet you! We understand your urgency around having this PR merged. Is it still possible for you to address my comments above? If not, let me know where you'd want some additional help. For example, I'm happy to updates the release guide or help with unit tests. |
@ggetz thanks for the updates. We will try to get in the required changes in by today and tomorrow; would be great if you are able to help in updating the release guides or help with unit tests. Thanks! |
@Tamrat-B Great, thank you! I'll update the release guide based on my understanding of the token rotation process. For unit tests, let me know what issues you may run into and I'll be happy to provide guidance. |
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.
@@ -212,8 +220,10 @@ function ArcGisMapServerImageryProvider(options) { | |||
if (typeof credit === "string") { | |||
credit = new Credit(credit); | |||
} | |||
this._credit = credit; | |||
|
|||
if (defined(options.warning)) { |
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.
With this change, this._credit
is no longer assigned unless options.warning
is defined.This breaks the existing behavior– Now when not using options.warning
, the provided options.credit
will not show up at all.
I would suggest removing the warning
parameter option from the constructor here, and instead in fromBasemapType
, pass the credit
option when creating the provider.
let credit;
if (defined(defaultTokenCredit)) {
credit = Credit.clone(defaultTokenCredit);
}
return new ArcGisMapServerImageryProvider({
...options,
url: server,
token: accessToken,
credit: credit
});
Additionally, there should be no need to set this._useTiles
in this case. It defaults to true
, but you can also set options.usePreCachedTilesIfAvailable
to true
if you'd like to be explicit.
return new ArcGisMapServerImageryProvider({
...options,
url: server,
token: accessToken,
credit: credit,
usePreCachedTilesIfAvailable: true // ArcGIS Base Map Service Layers only support Tiled views
});
@ggetz thanks for the review; will address the asks and also add the unit tests; I have few additional changes as well. ok on the schedule. |
Hi @Tamrat-B, we just merged a larger-scale PR that affects some of the same areas of the codebase as this one. Another merge from |
@ggetz updated pr based on reveiw and also updated tests to pass (thanks for the help earlier today!). Can you take a look and see if you can resolve the conflicts based on your latest changes... I sent you invite for write access to the repo. thx! |
Thanks @Tamrat-B! I merged in the latest changes. Can you confirm everything is working as intended? I'm noticing a few 404's for a specific tile when any ArcGIS basemap is set. Is this expected behavior? |
@ggetz Thanks! looks good. we just have to swap out the eval keys with yours when they are ready. But other than that looks good. (the 404s are happening when zooming beyond zoom level (request for tiles that don't exist)..the server could be configured to return empty/blank tiles for those & client app needs to handle it. This was not implemented so for now it's expected behavior. |
Added support for ArcGIS Access Token when creating an ArcGisMapServerImageryProvider. Updated samples as well.