Backdrop4Good / blm2020

Black Lives Matter Memphis 2020
0 stars 3 forks source link

Autopopulate the `lat`, `lon` fields on the `business` content type. #12

Closed serundeputy closed 6 years ago

serundeputy commented 6 years ago

Create a form_alter for the content add form that calls out to google API to get lat and lon from an address and pipe that info into the geofield lat, lon fields and save the buisiness.

Hide the lat, lon fields from the user or grey out? Perhaps based on role so that an admin could override lat, lon if necessary.

laryn commented 6 years ago

@serundeputy Something else to think through is that if Geocoding is set up on CiviCRM, these values will already be in process of being sent for by CiviCRM. So either we turn off CiviCRM's geocoding and push these values into the contact record as well (with Civi's api when syncing the contact/node), or pull from Civi's lat/long via Civi's API maybe?

serundeputy commented 6 years ago

I've opted to geocode on the business node content entry and will pipe over relevant info via civi api calls in backdrop hooks.

This issue is about getting the geocoding in place for the searchable map. I think we should open a separate issue about keeping the business nodes and CiviCRM business contacts in sync somehow.

serundeputy commented 6 years ago

ce8383f53953c1f00e41628ee7511364682b387d populates the lat and lng fields. closing.