Skip to content
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 options.query to KMLDataSource #5434

Merged
merged 5 commits into from
Jun 7, 2017
Merged

Conversation

ottaviohartman
Copy link
Contributor

Fixes #5408

Pass around a query parameter which eventually gets blobbed onto the various uri in KMLDataSource. I've added like 6 unit tests, but am unconvinced about the thoroughness of this implementation. @mramato please test elsewhere? :)

One problem: using proxyUrl to append query means that processNetworkLinkQueryString will be using the already-formatted href (LINE). Therefore, it will be used throughout the text-replacement process of processNetworkLinkQueryString. I don't think this will (ever) be a problem, unless some authentication token contains [bboxWest] or something.

I've also moved a function call out of an if block, so now the behavior is that proxyUrl is run for every URI. This is ok because if either proxy or query are undefined, proxyUrl doesn't do anything.

Ottavio

}
href = proxyUrl(href, proxy, query);
Copy link
Contributor

Choose a reason for hiding this comment

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

This still needs to be inside of an if (!hrefResolved) block, so adjust the original logic to handle that. Basically, if hrefResolved is true at this point, it means that the item is a data or blob uri, which means we can't/shouldn't append query parameters to it.

@mramato
Copy link
Contributor

mramato commented Jun 7, 2017

At first glance, this looks perfect and that was the only comment I had. Also update CHANGES (just edit the CZML line from your last PR).

I'll put this through its paces and take a deeper look and let you know if I find any problems.

Thanks @omh1280!

@mramato
Copy link
Contributor

mramato commented Jun 7, 2017

processBillboardIcon needs to be passed a copy of the query (which means it needs to be threaded through apply style as well. (it also means you have at least one missing test to cover that code.)

</IconStyle>\
</Style>\
</Placemark>';
debugger;
Copy link
Contributor

Choose a reason for hiding this comment

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

You forgot to take this out (always try and remember to npm run eslint before each commit/push)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks

@mramato
Copy link
Contributor

mramato commented Jun 7, 2017

Awesome work here @omh1280! Thanks.

@mramato mramato merged commit 94ecd9d into CesiumGS:master Jun 7, 2017
@ottaviohartman ottaviohartman deleted the kml_query branch June 8, 2017 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants