Jeremy Webb

Route from any location to any location. [SOLVED]

2 posts in this topic

Hi there,

For anyone who might want to use the Route feature (that allows you to get directions from A to B), you might find this modification useful.

The normal routing feature only allows you to find routes from any point A to a point B which you have defined in the Maps Pro Component. 

We thought it would be useful if you could route to a point B that was either a pre-set location or any location you type in. Therefore we added a "combo" box to the Route finder, so you can select a pre-set point and type in any location. 

The modification is pretty straightforward, but bear in mind that if you update the component you'll need to re-apply this fix, or maybe BT could introduce it in an update?

Edit /modules/mod_bt_googlemap_pro/helper.php

Find this code around line 106:

$html[] = '<select class="end inputbox">';
                $html[] = '<option value="">' . JText::_('COM_BT_GOOGLEMAPS_PRO_SELECT_PLACE') . '</option>';
                foreach ($places as $place) {
                    $html[] = '<option value="' . $place->address . '">' . $place->title . '</option>';

                $html[] = '</select><br/>';

and replace with:

$html[]= '<input type=text list=end class="end inputbox"><datalist id=end >';
                foreach ($places as $place) {
                    $html[] = '<option>' . $place->title . '</option>';
                $html[]= '</datalist>';


Hope you find that useful.





Tam Pham likes this

Share this post

Link to post
Share on other sites