J-BusinessDirectory - SensorNotRequired Google Maps API Warning & Cluster Images

Support Forum

 
 

 

In the file siteincludesearch-map.php line 3:


JHtml::_('script', 'https://maps.googleapis.com/maps/api/js?sensor=false&language='.$lang );


sensor=false& seems to be causing an error in Googles eyes. Is there any reason you are keeping that in the API call?

I changed it to:

JHtml::_('script', 'https://maps.googleapis.com/maps/api/js?language='.$lang );

and the error has gone away.

On a side note:


When I updated to 4.4.5, the cluster images were not being loaded properly. I changed siteincludesearch-map.php line 291:


"<?php echo COMPONENT_IMAGE_PATH ?>mapcluster/m"


to

"/components/com_jbusinessdirectory/assets/images/mapcluster/m"

and it is working now.

 


Have you considered adding the option in the settings for an API key to get rid of the NoApiKeys warning? Or am I missing it?

4 replies

Hi,

 

In version 4.5.0 we have added google ao keys and also remove the sensor=false from loading the map api.

COMPONENT_IMAGE_PATH should point to /components/com_jbusinessdirectory/assets/images. We cannot have directly /components/com_jbusinessdirectory/assets/images since Joomla can be located in a sub folder.

Sounds good on fixing the API issues, looking forward to v4.5. Will PHP7 compatibility also be included in that release?


Leaving the COMPONENT_IMAGE_PATH line (291) as downloaded resulted in console errors saying it was unable to find the image showing  COMPONENT_IMAGE_PATH/mapcluster/m1.png as the address. Where does JDirectory look for "COMPONENT_IMAGE_PATH" value? Should in be in the lang file?

Hi,

 

Yes, the 4.5.0 version will be compatible with PHP 7.

COMPONENT_IMAGE_PATH is a contstant defined on JBD.

if( !defined('COMPONENT_IMAGE_PATH') )
    define("COMPONENT_IMAGE_PATH", JURI::base()."components/".JRequest::getVar('option')."/assets/images/");

On search map is should be used like
    mcOptions = {
                imagePath:
                "<?php echo COMPONENT_IMAGE_PATH ?>mapcluster/m"
                };

The defines.php located in \j-businessdirectory_4.4.5-no-pictures\site\assets didn't have 

if( !defined('COMPONENT_IMAGE_PATH') )
    define("COMPONENT_IMAGE_PATH", JURI::base()."components/".JRequest::getVar('option')."/assets/images/");

I downloaded the package on 5/17


I added those lines to file and got a 404 error: taxidermist(dot)directory/components//assets/images/mapcluster/m2.png

 

 

So I removed the / before assets/images/...  and the 404: taxidermist(dot)directory/components/assets/images/mapcluster/m2.png


Then I replaced the JRequest with the com_jbd/ and it now works. This is my current code.

 

if( !defined('COMPONENT_IMAGE_PATH') )
define("COMPONENT_IMAGE_PATH", JURI::base()."components/com_jbusinessdirectory/assets/images/");

 

 
 
 

5 Item(s)

Show per page