Page 1 of 1

precise positioning of the maker

Posted: 14 Jun 2010, 18:26
by maxtrend
for precise positioning of the maker in Directions Requests
when if ((int)$countMarker == 1)

I edit in administrator\components\com_phocamaps\helpers\phocamapsmap.php

row 590

function setDirectionFunction($printIcon = 0, $mapId = '', $mapAlias = '', $lang = '') {
$js ='function setPhocaDir'.$this->_id.'(fromPMAddress'.$this->_id.', toPMAddress'.$this->_id.') {'."\n"
.' var request'.$this->_id.' = {'."\n"
.' origin: fromPMAddress'.$this->_id.', '."\n"
.' destination:toPMAddress'.$this->_id.','."\n"
.' travelMode:google.maps.DirectionsTravelMode.DRIVING'."\n"
.' };'."\n\n";

in:

function setDirectionFunction($printIcon = 0, $mapId = '', $mapAlias = '', $lang = '') {
$js ='function setPhocaDir'.$this->_id.'(fromPMAddress'.$this->_id.', toPMAddress'.$this->_id.') {'."\n"

//added for precise positioning of the maker
.' var varTo = toPMAddress'.$this->_id.';'."\n"
.' var posComma = varTo.indexOf(",");'."\n"
.' varLat = varTo.slice(0,posComma);'."\n"
.' varLong = varTo.substring(posComma+1);'."\n"
.' var fine = new google.maps.LatLng(varLat, varLong);'."\n"
//end for precise positioning of the maker

.' var request'.$this->_id.' = {'."\n"
.' origin: fromPMAddress'.$this->_id.', '."\n"

//for precise positioning of the maker
//.' destination:toPMAddress'.$this->_id.','."\n"
.' destination: fine,'."\n"
//end for precise positioning of the maker

.' travelMode:google.maps.DirectionsTravelMode.DRIVING'."\n"
.' };'."\n\n";

:?: I hope that someone can be useful

Re: precise positioning of the maker

Posted: 26 Jul 2011, 23:26
by Jan
Ok, thank you for this guide.

Jan