Skip to content
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

Merged
merged 9 commits into from
Jan 15, 2016
Merged

Creating tileset assumption fix #3435

merged 9 commits into from
Jan 15, 2016

Conversation

TomPed
Copy link
Contributor

@TomPed TomPed commented Jan 15, 2016

Fixes #3404

I believe this fixes the issue, could you take a look before I write some tests.

@@ -7,6 +7,9 @@ define([
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/Event',
'../Core/getBaseUri',
'../Core/GetExtensionFromUri',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to lowercase.

@lilleyse
Copy link
Contributor

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.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jan 15, 2016

Do you want to also address CesiumGS/3d-tiles#53 (comment) in this PR?

@TomPed
Copy link
Contributor Author

TomPed commented Jan 15, 2016

Updated.


this._url = url;
this._tilesJson = url + 'tiles.json';
this._tilesJson = url + fileName;
Copy link
Contributor

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;

@TomPed
Copy link
Contributor Author

TomPed commented Jan 15, 2016

Updated.

} else {
if (url.lastIndexOf('/') !== (url.length - 1)) {
url = appendForwardSlash(url);
}
Copy link
Contributor

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.

@TomPed
Copy link
Contributor Author

TomPed commented Jan 15, 2016

If I don't check for the training slash and there already is one then I would have two slashes, wouldn't I?

@lilleyse
Copy link
Contributor

appendForwardSlash handles that case.

@TomPed
Copy link
Contributor Author

TomPed commented Jan 15, 2016

Oh, gotcha. That's cool.

@TomPed
Copy link
Contributor Author

TomPed commented Jan 15, 2016

Updated.

@lilleyse
Copy link
Contributor

I tweaked the test descriptions a little bit, but this is good to go. Merged.

lilleyse added a commit that referenced this pull request Jan 15, 2016
@lilleyse lilleyse merged commit 4d9379f into CesiumGS:3d-tiles Jan 15, 2016
@lilleyse lilleyse deleted the creating-tileset-assumption-fix branch January 15, 2016 18:44
@TomPed
Copy link
Contributor Author

TomPed commented Jan 15, 2016

Thanks Sean

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants