Beispiel #1
0
	<?php 
Yii::import('ext.gmap.*');
$gMap = new EGMap();
$gMap->zoom = 3;
$gMap->disableDefaultUI = true;
$gMap->scrollwheel = false;
$gMap->scaleControl = false;
$gMap->navigationControl = false;
$gMap->streetViewControl = false;
$gMap->overviewMapControl = false;
$gMap->panControl = false;
$gMap->zoomControl = true;
$gMap->zoomControlOptions = array('style' => 'google.maps.ZoomControlStyle.SMALL');
$gMap->styles = 1;
$gMap->setWidth(100, '%');
$gMap->setHeight(390);
$mapTypeControlOptions = array();
// $gMap->mapTypeControlOptions= $mapTypeControlOptions;
$gMap->setCenter(58.0201, 55.954);
$icon = new EGMapMarkerImage("/img/map-icon.png");
$icon->setSize(28, 28);
$icon->setAnchor(14, 14);
$icon->setOrigin(0, 0);
// Create GMapInfoWindows
//$info_window_a = new EGMapInfoWindow('<div>Москва</div>');
$cities = Cities::model()->findAll();
if ($cities) {
    foreach ($cities as $city) {
        $info_box = new EGMapInfoBox('<div class="infoBox"><div class="infoBoxInner"><span>' . $city->city . '</span></div></div>');
        // set the properties
        $info_box->pixelOffset = new EGMapSize('-55', '15');
Beispiel #2
0
	    geocoder.geocode( { 'address': country}, function(results, status) {
	      if (status == google.maps.GeocoderStatus.OK) {
		    lat = results[0].geometry.location;
	        return results[0].geometry.location;	        
	      } else {
	        return ;
	      }
	    });
	  }	  
</script> <?php 
Yii::import('ext.gmaps.*');
?>
 <?php 
$gMap = new EGMap();
$gMap->setWidth(625);
$gMap->setHeight(350);
$gMap->zoom = 14;
$gMap->setOptions(array('zoomControl' => true, 'scaleControl' => true, 'disableDefaultUI' => true, 'panControl' => true, 'draggable' => true, 'scrollwheel' => true));
if ($property->latitude && $property->longitude) {
    $marker = new EGMapMarker($property->latitude, $property->longitude);
    $gMap->addMarker($marker);
    $gMap->setCenter($property->latitude, $property->longitude);
} elseif ($propertyAddress['country']) {
    $country = $gMap->geocode($propertyAddress['city'] . "," . $propertyAddress['state'] . "," . $propertyAddress['country']);
    if ($country) {
        if ($country->getLat() && $country->getLng()) {
            $marker = new EGMapMarker($country->getLat(), $country->getLng());
            $gMap->addMarker($marker);
            $gMap->setCenter($country->getLat(), $country->getLng());
        }
    }
Beispiel #3
0
<?php 
Yii::import('ext.gmap.*');
$gMap = new EGMap();
$gMap->zoom = 17;
$gMap->disableDefaultUI = true;
$gMap->scrollwheel = false;
$gMap->scaleControl = false;
$gMap->navigationControl = false;
$gMap->streetViewControl = false;
$gMap->overviewMapControl = false;
$gMap->panControl = false;
$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