Ejemplo n.º 1
0
    protected function renderPopupMap()
    {
        $gMap = new EGMap();
        $gMap->setJsName('hgeomap');
        $gMap->addGlobalVariable('hgmarker');
        $gMap->width = isset($this->popupOptions['mapWidth']) ? $this->popupOptions['mapWidth'] : '100%';
        $gMap->height = isset($this->popupOptions['mapHeight']) ? $this->popupOptions['mapHeight'] : '600px';
        $gMap->zoom = 6;
        $gMap->setCenter($this->latitude, $this->longitude);
        $gMap->addEvent(new EGMapEvent('click', 'function(e){panToMap(geomap,e.latLng,hgeomap);}', false));
        $gMap->appendMapTo('#popup-map');
        $this->popupOptions['width'] = isset($this->popupOptions['width']) ? $this->popupOptions['width'] : '800px';
        $afterInit = array('hgmarker = new google.maps.Marker({
				position: hgeomap.getCenter(),
				map: hgeomap,
				draggable: true
			});', 'google.maps.event.addListener(hgmarker, "dragend", function(e) {
				panToMap(geomap,e.latLng,hgeomap);
			});', '$("#open-big-map").click(function(e){
				e.preventDefault();
				$("#hgeomap").dialog({resizable:false,title:"Location",width:"' . $this->popupOptions['width'] . '"});
				google.maps.event.trigger(hgeomap, "resize");
				hgeomap.setCenter(geomap.getCenter());
				return false;
			});');
        echo CHtml::openTag('div', array('id' => 'hgeomap', 'style' => 'display:none'));
        if (isset($this->popupOptions['searchBox']) && $this->popupOptions['searchBox']) {
            $this->renderAddressSearchBox('hgeoaddress');
        }
        if (!is_array($this->afterInitEvents)) {
            $this->afterInitEvents = array($this->afterInitEvents);
        }
        $gMap->renderMap(array_merge($this->afterInitEvents, $afterInit));
        echo '<div id="popup-map" ></div>';
        echo CHtml::closeTag('div');
    }
Ejemplo n.º 2
0
        $info_box->maxWidth = 0;
        $info_box->boxStyle = array('width' => '"186px"', 'height' => '"107px"');
        $info_box->closeBoxUrl = '""';
        //$info_box->closeBoxMargin = '"10px 2px 2px 2px"';
        $info_box->infoBoxClearance = new EGMapSize(1, 1);
        $info_box->enableEventPropagation = '"floatPane"';
        // Create marker
        if ($city->lat && $city->lng) {
            $marker = new EGMapMarker($city->lat, $city->lng, array('title' => $city->city, 'icon' => $icon));
            //$marker->addHtmlInfoWindow($info_window_a);
            $marker->addHtmlInfoBox($info_box);
            $gMap->addMarker($marker);
        }
    }
}
$gMap->appendMapTo('#map_box');
$gMap->renderMap();
?>
<div id="map_box">
<div id="map_bg_bot"></div>
</div>	
	
</div>
<div class="row">



<div class="col-xs-12 col-sm-3" >	
<div class="block-left" style="margin-bottom:40px;">
	<?php 
$this->renderPartial('application.views.common.tags');
Ejemplo n.º 3
0
$gMap->zoomControl = true;
$gMap->zoomControlOptions = array('style' => 'google.maps.ZoomControlStyle.SMALL');
$gMap->styles = 2;
$gMap->setWidth(100, '%');
$gMap->setHeight(100, '%');
$gMap->setCenter(55.834324, 37.626285);
$icon = new EGMapMarkerImage("/img/map-icon.png");
$icon->setSize(28, 28);
$icon->setAnchor(14, 14);
$icon->setOrigin(0, 0);
$info_window_a = new EGMapInfoWindow('<div>ВДНХ, павильон №57</div>');
$marker = new EGMapMarker(55.834324, 37.626285, array('title' => 'ВДНХ, павильон №57', 'icon' => $icon));
$marker->addHtmlInfoWindow($info_window_a);
//$marker->addHtmlInfoBox($info_box);
$gMap->addMarker($marker);
$gMap->appendMapTo('#map_canvas');
$gMap->renderMap();
?>
<div id="con-vdnh" onclick="$('#map_canvas,#vdnh').toggleClass('vis-no');">
  ВДНХ, павильон №57
</div>
</div>
<section id="vdnh">
<div class="con-close" onclick="$('#vdnh,#map_canvas').toggleClass('vis-no');"></div>
<div class="container-fluid" style="margin-top:40px;">
<div class="row main_top_row">
<div class="col-xs-12 col-sm-2">
<div class="block-left" >
<?php 
$this->renderPartial('application.views.common.tags');
?>