-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
Rather than using the city endpoint for the autocomplete in the new project form and the lab header, we now use a Google geocoder, and make a separate AJAX call to the API to determine if that lat/lon has data. This will allow us to support a broader number of locations than we do currently. Closes #333 Closes #266 Closes #251
3b725ea
to
2b384fb
Compare
// invalid options. Google Places sets 'autocomplete="off"' regardless of | ||
// what was set on the <input> before, so we need to override that in JS | ||
this.input.nativeElement.autocomplete = 'forced-false'; | ||
this.input.nativeElement.removeEventListener('focus', forceAutocompleteOff); |
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.
It looks like this work-around is no longer working... I'm going to open an issue to address this - this will also be an issue on Temperate, which this was copied from.
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 basically works, but on the charts page, if I enter city for which we don't have data, but then ignore the warning message and click to a different chart section anyway, I get the loading "wave" icon forever until I type in a valid city, which I don't think should happen. The chart controls along the top continue to be clickable but they have no effect, which I also think should be addressed. I can think of a few potential ways to handle the case where someone has a location with no data but continues to click around, but I'm not sure which one is best -- happy to discuss.
I tackled the first half of this in eef265d by reverting to the last valid city when you change indicators. As we discussed, I'd like to push off any further changes for the controls to #243 |
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.
Looks good!
Overview
We've imported a large amount of data into the Climate Change API, but the new data does not have
City
objects associated with it.To accommodate that. rather than using the city endpoint for the autocomplete in the new project form and the lab header, we now use a Google geocoder, and make a separate AJAX call to the API to determine if that lat/lon has data.
This will allow us to support a broader number of locations than we do currrently.
Demo
Powered by Google:
No climate data message:
Notes
Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.
Testing Instructions
climate-change-api
with the changes in Don't require city id in project json schema climate-change-api#875src/app/constants.ts
file with the one saved in LastPass as "Climate lab dev config"yarn install
yarn run serve
Checklist
yarn run serve
clean?yarn run build:prod
clean?yarn run lint
clean?Closes #333
Closes #266
Closes #251