<?php echo CHtml::link("tes","#data", array('id'=>'inline')); ?>
<div style="display:none"><div id="data" >
<?php
/**
* EGmap3 Yii extension example view file.
*
* You can copy this file or its contents into your Yii
* application for testing.
*
*/
Yii::import('ext.jquery-gmap.*');
$gmap = new EGmap3Widget();
$gmap->setSize(638, 498);
// base options
$options = array(
'scaleControl' => true,
'streetViewControl' => true,
'zoom' => 15,
'center' => array(0, 0),
'mapTypeId' => EGmap3MapTypeId::ROADMAP,
'mapTypeControlOptions' => array(
'style' => EGmap3MapTypeControlStyle::DROPDOWN_MENU,
'position' => EGmap3ControlPosition::TOP_CENTER,
),
);
$gmap->setOptions($options);
// marker with custom icon
$marker = new EGmap3Marker(array(
'title' => 'hello',
'icon' => array(
'url' => 'http://google-maps-icons.googlecode.com/files/dolphins.png',
'anchor' => array('x' => 1, 'y' => 36),
//'anchor' => new EGmap3Point(5,5),
)
));
// set marker position by address
//$marker->address = 'C/Duque de Rivas 5L Madrid 28012';
$marker->address = $taller->dondedireccion . "," . $taller->dondeciudad;
// data associated with the marker
$marker->data = $taller->dondenombre . "<br>" . $taller->dondedireccion . "<br>" . $taller->dondeciudad ;
// add a Javascript event on marker click
$js = "function(marker, event, data){
var map = $(this).gmap3('get'),
infowindow = $(this).gmap3({action:'get', name:'infowindow'});
if (infowindow){
infowindow.open(map, marker);
infowindow.setContent(data);
} else {
$(this).gmap3({action:'addinfowindow', anchor:marker, options:{content: data}});
}
}";
$marker->addEvent('click', $js);
// center the map on the marker
$marker->centerOnMap();
$gmap->add($marker);
$gmap->renderMap();
?>
</div></div>
<?php $this->widget('application.extensions.fancybox.EFancyBox', array(
'target'=>'a#inline',
'config'=>array(
'scrolling' => 'yes',
'titleShow' => true,
'autoCenter' => true,
'autoResize' => true,
'autoSize' => true,
'iframe' =>array(scrolling => 'auto',preload => true),
),
)
);
?>