-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Open street map imagery provider #3146
Open street map imagery provider #3146
Conversation
Note: Two tests now fail -- one which seems to be a rounding error: Scene/OpenStreetMapImageryProvider rectangle passed to constructor does not affect tile numbering ^Should numbers off by such a small amount be equal? Also failing: Scene/OpenStreetMapImageryProvider requestImage returns a promise for an image and loads it for cross-origin use Finally: to pass the following test: Please let me know how I should handle these errors either by changing my code or the test code. Thanks! |
Test with an epsilon, for example, see #3151. |
We could either remove this test make a version of |
This is a breaking change since now @kring do you have another idea? |
That pattern doesn't actually work. You can chain constructors in JavaScript, but have to do it with e.g. in
You need:
Although you can probably change the entire implementation of
Right, that's the other problem with this approach. I don't think overriding the |
To slim down Cesium longer term, I'd definitely support deprecating |
I was thinking the same thing. Any reason not to do that now? |
No reason I can think of! |
@adamdavidcole let's go with @kring's suggestion:
See our Deprecation Guide. |
…eetMapImageryProviderGenerator function which creates an OpenMap imagery provider using a UrlTemplateImageryProvider
I updated the pull request by reverting and deprecating the original OpenStreetMapImageryProvider, however I wasn't sure how to decide which future version the deprecated API should be removed. I created a function that creates a UrlTemplateImageryProvider in the OpenStreetMapImageryProviderGenerator file -- but I feel like a better filename and/or instantiation method should be used. I also created the Spec for it which passes all tests except for this test which still fails: However, I feel like it should pass because UrlTemplateImageryProvider has a getTileCredits function (https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/UrlTemplateImageryProvider.js#L447). |
@adamdavidcole can you please merge master (from the Cesium repo) into this branch. There will be some, hopefully minor, merge conflicts. |
@kring do you want to review this? |
…tOpenStreetMapImageryProvider function
…esium into openStreetMapImageryProvider
I updated the pull request based on our conversation last week, specifically by making the new file 'getOpenStreetMapImageryProvider' a function with a sensible name, replacing all instances of OpenStreetMapImageryProvider with the new function in both the code and comments/code examples, and updating the CHANGES.md file. I wasn't sure if I should wait for this pull request to get merged before creating an issue to deprecate OpenStreetMapImageryProvider in Cesium 1.18. Also, still fails for some reason I can't figure out because UrlTemplateImageryProvider has a getTileCredits function defined: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/UrlTemplateImageryProvider.js#L447 |
It's fine to submit this issue now. |
This looks good to me. I made some tweaks, most notably in dc5e473 and 229cc57. Does anyone else want to review this? @adamdavidcole what are you working on next? |
Part of #2814. |
@adamdavidcole this looks good, but it has one test failure when all the tests are ran: Note that this test doesn't fail when just the OSM tests are ran: http://localhost:8080/Specs/SpecRunner.html?spec=Scene%2FgetOpenStreetMapImageryProvider I think this test use to pass. Perhaps a recent change in master that was merged in broke it? |
This looks good to me as well. One minor nitpick: maybe |
…etMapImageryProvider'
…apImageryProvider merge master
@pjcozzi -- thanks for those documentation and spec tweeks, they definitely make a lot of sense. Also, I'm not getting that test failure when I run all tests. I'll try to see if I can recreate those results somehow. Hi @kring, -- thanks that name change suggestion makes sense to me. I updated the pull request to reflect that. Thanks to both of you for reviewing the request! |
I restarted my browser and cleared the cache, and I don't get the test failure either. Awesome! Thanks again @adamdavidcole! |
Open street map imagery provider
I also submitted #3222 for the deprecation. |
|
It was accidentally added in #3146.
I took care of it. |
Good eye, thanks @mramato. |
Updated OpenStreetMapImageryProvider to return a configured UrlTemplateImageryProvider to reduce code redundancy.