-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Creating tileset assumption fix #3435
Creating tileset assumption fix #3435
Conversation
@@ -7,6 +7,9 @@ define([ | |||
'../Core/destroyObject', | |||
'../Core/DeveloperError', | |||
'../Core/Event', | |||
'../Core/getBaseUri', | |||
'../Core/GetExtensionFromUri', |
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.
Change to lowercase.
The code looks mostly good. There may be an issue if the url is given as a directory without a trailing slash, but you can check for that in the tests. |
Do you want to also address CesiumGS/3d-tiles#53 (comment) in this PR? |
Updated. |
|
||
this._url = url; | ||
this._tilesJson = url + 'tiles.json'; | ||
this._tilesJson = url + fileName; |
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 this code can be cleaner. A structure like this might be better:
var url;
var tilesJson;
if (getExtensionFromUri(url) === 'json') {
// Set url and tilesJson
} else {
// Set url and tilesJson
}
this._url = url;
this._tilesJson = tilesJson;
Updated. |
} else { | ||
if (url.lastIndexOf('/') !== (url.length - 1)) { | ||
url = appendForwardSlash(url); | ||
} |
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.
You don't need to check for the trailing slash here because appendForwardSlash
should handle that.
If I don't check for the training slash and there already is one then I would have two slashes, wouldn't I? |
|
Oh, gotcha. That's cool. |
Updated. |
I tweaked the test descriptions a little bit, but this is good to go. Merged. |
Creating tileset assumption fix
Thanks Sean |
Fixes #3404
I believe this fixes the issue, could you take a look before I write some tests.