-
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 option to select which geocoder is used #12299
Conversation
Thank you for the pull request, @angrycat9000! ✅ We can confirm we have a CLA on file for you. |
Thanks @angrycat9000! We're hoping to take a review pass today. |
Thanks @ggetz . Two things that were still pending:
|
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.
This is looking really good @angrycat9000! All of my comments are just code and documentation cleanup.
/** | ||
* Provides geocoding through Google. | ||
* | ||
* @see {@link https://developers.google.com/maps/documentation/geocoding/policies|Google Geocoding Policies} |
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.
Great that you included the link! Can we call out explicitly the "TLDR"– that Google Geocoding should only be used when using Google data in the scene? And is there a similar disclaimer we should put in BingMapsGeocoderService
?
* | ||
* @enum {string} | ||
*/ | ||
const IonGeocodeProvider = { |
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.
const IonGeocodeProvider = { | |
const IonGeocodeProviderType = { |
This may be a bit nit-picky, but type
may help distinguish this from from the *GeocoderService
instance. I got a bit confused when looking through the specs which was which.
* @memberof IonGeocoderService.prototype | ||
* @type {IonGeocodeProvider} | ||
*/ | ||
geocodeProvider: { |
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.
geocodeProvider: { | |
geocodeProviderType: { |
This may be a bit nit-picky, but type
may help distinguish this from from the *GeocoderService
instance. I got a bit confused when looking through the specs which was which.
@@ -280,7 +281,7 @@ function enableVRUI(viewer, enabled) { | |||
* @property {boolean} [baseLayerPicker=true] If set to false, the BaseLayerPicker widget will not be created. | |||
* @property {boolean} [fullscreenButton=true] If set to false, the FullscreenButton widget will not be created. | |||
* @property {boolean} [vrButton=false] If set to true, the VRButton widget will be created. | |||
* @property {boolean|GeocoderService[]} [geocoder=true] If set to false, the Geocoder widget will not be created. | |||
* @property {boolean|IonGeocodeProvider|GeocoderService[]} [geocoder=IonGeocodeProvider.DEFAULT] If set to false, the Geocoder widget will not be created. |
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.
* @property {boolean|IonGeocodeProvider|GeocoderService[]} [geocoder=IonGeocodeProvider.DEFAULT] If set to false, the Geocoder widget will not be created. | |
* @property {boolean|IonGeocodeProvider|GeocoderService|GeocoderService[]} [geocoder=IonGeocodeProvider.DEFAULT] The geocoding service or services to use when searching with the Geocoder widget. If set to false, the Geocoder widget will not be created. |
Wow, this option was not well documented prior to this PR! Let's clean it up if it's not too much trouble.
Co-authored-by: Gabby Getz <[email protected]>
Hi @angrycat9000, I wanted to check in on the status of this PR as we are coming up on our next release soon.
|
Just the discussion of how assertive to make the one time warning discussion. Added a to-do for that. Will be ready once that is decided. |
This is updated and ready for review again @ggetz |
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.
This looks great @angrycat9000! Thanks!
Just two small comments and this should be good to merge.
The last step would be to open an issue to track removing the deprecated API in 1.126.
@@ -44,7 +44,10 @@ | |||
onselect: async () => { | |||
scene.primitives.remove(tileset); | |||
try { | |||
tileset = await Cesium.createGooglePhotorealistic3DTileset(); | |||
tileset = await Cesium.createGooglePhotorealistic3DTileset({ |
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.
Should the geocoder: false
viewer option be set for this example?
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 would say yes since it isn't valid for the non-georeferenced models.
The use with the Maxar data is more of a grey area so it is probably good to remove it on that account too.
options.geocodeProviderType, | ||
IonGeocodeProviderType.DEFAULT, | ||
); | ||
validateIonGeocodeProviderType(geocodeProviderType); |
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.
Since this function throws a developer error, we should surround it with the debug pragmas so it is stripped out in production builds.
validateIonGeocodeProviderType(geocodeProviderType); | |
//>>includeStart('debug', pragmas.debug); | |
validateIonGeocodeProviderType(geocodeProviderType); | |
//>>includeEnd('debug'); |
Thanks for the feedback @ggetz . Updated and ready for another look |
Fantastic! Thanks for contributing this @angrycat9000! |
Description
Adds the ability to change the geocoder used.
Both Bing and Google have legal requirements that their geocoders should not be used with other data. Eg. Using Bing geocode results while showing Google 3D Tiles is not allowed.
GoogleGeocoderService
for standalone usage of Google geocoderIonGeocodeProvider
enum to list the possible geocode providers when using Cesium ion.Viewer
constructor to also take anIonGeocoderProvider
valueTesting plan
npm run start
Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change