Hi,
I don't have a key and it seems google is becoming more restrictive on the number of updates.
To workaround this, I am having new members register with their city+country, this is enough for the sites purpose.
Then in geocoder I have set to only update if the coords are null but it is still making an API call.
For the next release can you update the geocodeUser function to this:
Code:
function geocodeUser($user,$cbUser)
{
if(JFactory::getUser()->id != $cbUser->user_id){
return;
}
$db = JFactory::getDbo();
$params = $this->params;
$mode = $params->get('mode',0);
if ( ($mode==1 && ($cbUser->cb_geolat == '' || $cbUser->cb_geolng == ''))||$mode==0 )
{
$place = $this->geocodeAddress($params , $cbUser);
$cbUser->cb_geolat = $place['latitude'] ? $place['latitude'] : $cbUser->cb_geolat;
$cbUser->cb_geolng = $place['longitude'] ? $place['longitude'] : $cbUser->cb_geolng;
$q ="UPDATE #__comprofiler
SET cb_geolat='".$cbUser->cb_geolat."',cb_geolng='".$cbUser->cb_geolng."'
WHERE id='".$cbUser->user_id."'";
$db->setQuery($q);
$db->execute();
}
}
All I have done is move the geocodeAddress call to inside the mode+empty coords check.
Thanks
David