MikeNGarrett / rcm

Provide a way for volunteers to create and update rescue cases.
Other
5 stars 7 forks source link

Convert imported location data to lat/long #30

Closed MikeNGarrett closed 10 years ago

MikeNGarrett commented 10 years ago

Once the import has been completed the location data will be in a variety of formats, but it will all be in one field. I think we can run that data through the google geocoding api because we need to be able to get lat/long for the location/proximity functionality to work.

There might even be a function in the wp-geo-posts plugin we could make use of.

In the future we'll either need to take care of this on import or through some sort of scheduled task or cron job.

markbasmayor commented 10 years ago

Currently, when there is no lat/lng data associated to a case, the javascript in the single case page breaks. I wrapped the entire map div in an if statement for now to prevent this from happening. We can take it out later if we can guarantee that cases will always have lat/lng data.

c55a928f5a6f894fece7c5bdb1822812042e90d9

MikeNGarrett commented 10 years ago

I think this is good to keep in as there might be a time where new or imported cases won't have the lat/long. Thanks for pointing this out.

MikeNGarrett commented 10 years ago

Done. Also added a scheduled task to functions.php that will convert over any new or imported data. I had to extend wp-geo-posts to get it done, but it's there.