Esempio n. 1
0
$gMap->mapTypeControlOptions= $mapTypeControlOptions;
 
$gMap->setCenter(39.721089311812094, 2.91165944519042);
 
// Create GMapInfoWindows
$info_window_a = new EGMapInfoWindow('<div>I am a marker with custom image!</div>');
$info_window_b = new EGMapInfoWindow('Hey! I am a marker with label!');
 
$icon = new EGMapMarkerImage("http://google-maps-icons.googlecode.com/files/gazstation.png");
 
$icon->setSize(32, 37);
$icon->setAnchor(16, 16.5);
$icon->setOrigin(0, 0);
 
// Create marker
$marker = new EGMapMarker(39.721089311812094, 2.91165944519042, array('title' => 'Marker With Custom Image','icon'=>$icon));
$marker->addHtmlInfoWindow($info_window_a);
$gMap->addMarker($marker);
 
// Create marker with label
$marker = new EGMapMarkerWithLabel(39.821089311812094, 2.90165944519042, array('title' => 'Marker With Label'));
 
$label_options = array(
  'backgroundColor'=>'yellow',
  'opacity'=>'0.75',
  'width'=>'100px',
  'color'=>'blue'
);
 
/*
// Two ways of setting options
Esempio n. 2
0
 /**
  *
  * calculates the center of the markers linked to the map
  *
  * @return EGMapCoord
  * @since 2010-12-22 modified for Yii Antonio Ramirez
  */
 public function getMarkersCenterCoord()
 {
     if (null === $this->resources->itemAt('markers')) {
         throw new CException(Yii::t('EGMap', 'At least one more marker is necessary for getMarkersCenterCoord to work'));
     }
     //todo: check for markers existence
     return EGMapMarker::getCenterCoord($this->resources->itemAt('markers'));
 }
 /**
  * (non-PHPdoc)
  * @see EGMapMarker::setOptions()
  */
 public function setOptions($options)
 {
     parent::setOptions($this->encodeOptions($options));
 }
Esempio n. 4
0
    <?php 
Yii::import('application.extensions.EGMAP.*');
$gMap = new EGMap();
$gMap->setJsName('test_map');
$gMap->width = '100%';
$gMap->height = 300;
$gMap->zoom = 11;
$gMap->setCenter(39.737827146489174, 3.2830574338912477);
$info_box = new EGMapInfoBox('<div style="color:#fff;border: 1px solid black; margin-top: 8px; background: #000; padding: 5px;">I am a marker with info box!</div>');
$info_box->pixelOffset = new EGMapSize('0', '-140');
$info_box->maxWidth = 0;
$info_box->boxStyle = array('width' => '"280px"', 'height' => '"120px"', 'background' => '"url(http://google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.9/examples/tipbox.gif) no-repeat"');
$info_box->closeBoxMargin = '"10px 2px 2px 2px"';
$info_box->infoBoxClearance = new EGMapSize(1, 1);
$info_box->enableEventPropagation = '"floatPane"';
$marker = new EGMapMarker(39.721089311812094, 2.91165944519042, array('title' => 'Marker With Info Box'));
$marker->addHtmlInfoBox($info_box);
$gMap->addMarker($marker);
$gMap->renderMap();
?>
    </div>

<div class="col-md-6">
    Nuestras Fortalezas
    1.	Es el único Tour Operador que tiene Cuba, con receptivo propio en la isla y sin intermediarios.
    2.	Pertenecemos al Ministerio de Turismo de Cuba.
    3.	Experiencia de 30 años en el rubro turístico.
    4.	Presencia en más de 40 países.
    5.	Más de 80 agencias de viajes operan con Havanatur.
    6.	Moderna Flota de Omnibus.
    7.	Convenios con Hotelería.
Esempio n. 5
0
$this->activeTab = 'map';
// Map
Yii::import('application.extensions.egmap.*');
$map = new EGMap();
$map->setJsName('map');
$map->width = '100%';
$map->height = 470;
$map->zoom = 8;
$map->setCenter(39.737827146489174, 3.2830574338912477);
$map->mapTypeControl = false;
$map->panControl = false;
$map->streetViewControl = false;
$map->scrollwheel = false;
$fitBounds = "map.fitBounds(new google.maps.LatLngBounds(new google.maps.LatLng({$region->southwest_latitude}, {$region->southwest_longitude}), new google.maps.LatLng({$region->northeast_latitude}, {$region->northeast_longitude})));";
foreach ($region->locations as $location) {
    $marker = new EGMapMarker($location->latitude, $location->longitude);
    // the setter does not perform the special handling of 'title' that the constructor gets via setOptions().
    $marker->title = "'{$location->name}'";
    $marker->icon = new EGMapMarkerImage(Yii::app()->request->baseUrl . '/images/map-marker-blue.png');
    $marker->icon->setSize(59, 54);
    $marker->icon->setAnchor(59 / 2, 54);
    $infoBox = new EGMapInfoBox($this->renderPartial('_mapInfoBox', array('location' => $location), true));
    $infoBox->closeBoxMargin = '"17px 17px 2px 2px"';
    $infoBox->infoBoxClearance = new EGMapSize(1, 1);
    $infoBox->enableEventPropagation = '"floatPane"';
    $infoBox->pixelOffset = new EGMapSize('-10', '30');
    $marker->addHtmlInfoBox($infoBox);
    $map->addMarker($marker);
}
$map->renderMap(array($fitBounds));
// List