Closed sunnymui closed 5 years ago
Main question is how I can get that map display to update when the longitude/latitude is changed. I'm not exactly sure how to use useEffect
with the mapDisplay component
I did some super serial refactoring and issue resolving based on the notes taken during the last Code for San Jose Meeting. These changes were implemented in the latest 7 commits added to this PR.
process.env.REACT_APP_LOCATION_IQ_KEY
. this api key is contained in .env.local, which has been added to the .gitignore file so it isn't shared publicly. Instructions on getting an api key for lcoationiq and creating your own .env.local file to get the app running added to the .env file. Should update the readme with this info.
Adds a geocoder module to the create post form to grab the longitude and latitude automatically from the LocationIQ api based on the street address entered in the form.
utilities/api.js
compositions/PostMarkup.js
and markup integrated in editAddressMarkup. Some props added to AddressMarkup for the geocoding buttonAdminform.js
contains geocode interaction handler and an addition to the state, ApiLoading which tracks if the api is still loading the results. It disables the geocode button while results are still loading then reenables it when results have been loaded.Planning to also show a loading animation while ApiLoading = true in another update.
UPDATE Issues resolved, see latest post