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
precise positioning of the maker
-
- Phoca Member
- Posts: 11
- Joined: 12 Jun 2010, 08:52
- Location: alghero - sardinia
- Contact:
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: precise positioning of the maker
Ok, thank you for this guide.
Jan
Jan
If you find Phoca extensions useful, please support the project