<?php
/**
 * @package		Contact_Enhanced
 * @subpackage	views
 * @copyright	Copyright (C) 2006 - 2010 Ideal Custom Software Development
 * @author		Douglas Machado {@link http://ideal.fok.com.br}
 * @author		Created on 03-August-2010
 * @license		GNU/GPL, see license.txt
 * Contact Enhanced  is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses. 
 */
defined( '_JEXEC' ) or die( 'Restricted access' );

JHTML::_('behavior.mootools');
$doc =& JFactory::getDocument();
$doc->addStyleSheet(JURI::root(). 'components/com_contact_enhanced/assets/css/validate.css');
?>
<div id="component-contact-enhanced" 
	class="ce-container<?php echo $this->params->get( 'pageclass_sfx' ) 
		. (JRequest::getVar('tmpl') ? ' ce-modal-container' : ''); ?>">
<?php 

require_once (JPATH_COMPONENT.DS.'helper'.DS.'gmaps.php');
		
		$this->contact->image_path = $this->config->image_path;
		$map	= new GMaps($this->params);
		$map->set('lat',				(float)$this->contact->lat);
		$map->set('lng',				(float)$this->contact->lng);
		$map->set('zoom',				(int)$this->contact->zoom);
		$map->set('showCoordinates',	$this->params->get('gmaps_showCoordinates',true));
		$map->set('useDirections',		$this->params->get('gmaps_useDirections',true));
		$map->set('mapTitle',			$this->contact->name);
		$map->getInfoWindowContent(		$this->contact);
		
		$map->set('typeControl',		$this->params->get('gmap_mapTypeControl','true'));
		$map->set('typeId',				$this->params->get('gmaps_MapTypeId','ROADMAP'));
		$map->set('navigationControl',	$this->params->get('gmap_navigationControl','true'));
		$map->set('travelMode',			$this->params->get('gmaps_DirectionsTravelMode','DRIVING'));
		
		$map->set('input_tolls',		'dir_tolls');
		$map->set('input_highways',		'dir_highways');
		$map->set('input_address',		'dir_address');
		
		if( trim($this->params->get('gmaps_icon'))){
			$map->set('markerImage',	JURI::root().'components/com_contact_enhanced/assets/images/gmaps/marker/'.$this->params->get('gmaps_icon') );
		}
		if ($this->params->get('gmaps_icon_shadow') ) {
			$map->set('markerShadow',JURI::root().'components/com_contact_enhanced/assets/images/gmaps/shadow/'.$this->params->get('gmaps_icon_shadow'));
		}
		echo $map->create();
?>
</div>