precise positioning of the maker
Posted: 14 Jun 2010, 18:26
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
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