public function getMarker(Record $model, $key, $index) { $marker = null; if ($this->validateMarker($model, $key, $index)) { $LatLng = new LatLng(['lat' => $model[$this->markerConfig['lat']], 'lng' => $model[$this->markerConfig['lng']]]); $marker = new Marker(['position' => $LatLng, 'title' => $model->__toString()]); $marker->attachInfoWindow(new InfoWindow(['content' => $this->renderItem($model, $key, $index)])); } return $marker; }
<!--div class="top-menu-item shake-scroll cursor" data-el="#map"> контакты <div class="underline"></div></div> <a href="http://stat.vgg.ru" target="_blank" class="no-decoration color-w stat">статистика</a--> <?php $this->beginBody(); ?> <!-- main body, remove div for height compability --> <?php echo $content; ?> <div id="map"> <?php $coord = new LatLng(['lat' => 48.751678, 'lng' => 44.478525]); $marker = new Marker(['position' => $coord, 'title' => 'My Home Town', 'icon' => '/img/map-pin.png']); $marker->attachInfoWindow(new InfoWindow(['content' => '<div>' . '<h2>Унико</h2>' . '<b>Адрес</b>: г.Волгоград, ул. Землячки 30а, 5 подъезд, код домофона 42<br>' . '<b>Унико</b> – интернет ‐ провайдер и оператор связи в Волгоградской области.' . '</div>'])); $map = new Map(['width' => '100%', 'height' => '100%', 'center' => $coord, 'zoom' => 17, 'scrollwheel' => false, 'panControl' => false, 'mapTypeControl' => false, 'streetViewControl' => false, 'styles' => '[{"stylers":[{"saturation":-100},{"gamma":1}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"off"}]},{"featureType":"poi.business","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"poi.business","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi.place_of_worship","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"poi.place_of_worship","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"visibility":"simplified"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"saturation":50},{"gamma":0},{"hue":"#50a5d1"}]},{"featureType":"administrative.neighborhood","elementType":"labels.text.fill","stylers":[{"color":"#333333"}]},{"featureType":"road.local","elementType":"labels.text","stylers":[{"weight":0.5},{"color":"#333333"}]},{"featureType":"transit.station","elementType":"labels.icon","stylers":[{"gamma":1},{"saturation":50}]}]']); $map->addOverlay($marker); echo $map->display(); ?> </div> <footer class="main-footer"> <div> <div class="row"> <div class="col-lg-5"> <h3>О нас</h3> <p> Компания УНИКО является <strong>интернет-провайдером в Волгоградской области</strong>. На базе собственной волоконно-оптической и широкополосной беспроводной сети мы предлагаем интегрированные телекоммуникационные решения для разных категорий клиентов. </p>
$santo_domingo = new LatLng(['lat' => 39.72118906848983, 'lng' => 2.907628202438368]); // setup just one waypoint (Google allows a max of 8) $waypoints = [new DirectionsWayPoint(['location' => $santo_domingo])]; $directionsRequest = new DirectionsRequest(['origin' => $home, 'destination' => $school, 'waypoints' => $waypoints, 'travelMode' => TravelMode::DRIVING]); // Lets configure the polyline that renders the direction $polylineOptions = new PolylineOptions(['strokeColor' => '#FFAA00', 'draggable' => true]); // Now the renderer $directionsRenderer = new DirectionsRenderer(['map' => $map->getName(), 'polylineOptions' => $polylineOptions]); // Finally the directions service $directionsService = new DirectionsService(['directionsRenderer' => $directionsRenderer, 'directionsRequest' => $directionsRequest]); // Thats it, append the resulting script to the map $map->appendScript($directionsService->getJs()); // Lets add a marker now $marker = new Marker(['position' => $coord, 'title' => 'My Home Town']); // Provide a shared InfoWindow to the marker $marker->attachInfoWindow(new InfoWindow(['content' => '<p>ทดสอบ</p>'])); // Add marker to the map $map->addOverlay($marker); // Now lets write a polygon $coords = [new LatLng(['lat' => 25.774252, 'lng' => -80.190262]), new LatLng(['lat' => 18.466465, 'lng' => -66.118292]), new LatLng(['lat' => 32.321384, 'lng' => -64.75736999999999]), new LatLng(['lat' => 25.774252, 'lng' => -80.190262])]; $polygon = new Polygon(['paths' => $coords]); // Add a shared info window $polygon->attachInfoWindow(new InfoWindow(['content' => '<p>This is my super cool Polygon</p>'])); // Add it now to the map $map->addOverlay($polygon); // Lets show the BicyclingLayer :) $bikeLayer = new BicyclingLayer(['map' => $map->getName()]); // Append its resulting script $map->appendScript($bikeLayer->getJs()); $map->height = 450; $map->width = 800;
use dosamigos\google\maps\overlays\InfoWindow; use dosamigos\google\maps\overlays\Marker; use frontend\utilities\FrontEndHelper; use pavlinter\display\DisplayImage; $this->title = $menuContent->title; $this->params['menuContent'] = $menuContent; $page = $menuContent->content; /** @noinspection PhpUndefinedFieldInspection */ $this->context->layout = 'pool-position-content'; $data = [['title' => Yii::t('front', 'Aquapark of Dačice'), 'lat' => 49.083191, 'lng' => 15.422774]]; $center = new LatLng(['lat' => 49.083191, 'lng' => 15.422774]); $map = new Map(['width' => '100%', 'height' => 400, 'center' => $center, 'zoom' => 16]); foreach ($data as $item) { $coord = new LatLng(['lat' => $item['lat'], 'lng' => $item['lng']]); $marker = new Marker(['position' => $coord, 'title' => $item['title']]); $marker->attachInfoWindow(new InfoWindow(['content' => $item['title']])); $map->addOverlay($marker); } echo '<div class="row"><div class="col s12">'; echo $map->display(); echo '</div></div>'; if ($page->image) { echo DisplayImage::widget(['options' => ['class' => 'responsive-img', 'title' => $menuContent->title], 'category' => 'all', 'image' => $page->image->filename]); } if ($page->perex) { echo '<div class="perex">' . $page->perex . '</div>'; } if ($page->description) { echo '<div class="description">'; echo FrontEndHelper::parseContent($page->description); echo '</div>';
use frontend\utilities\MaterializeActiveForm; use yii\helpers\Html; use yii\captcha\Captcha; use yii\helpers\Url; use yii\widgets\Breadcrumbs; BasicContentAsset::register($this); $this->title = Yii::t('front', 'our contacts'); $breadcrumbs = [['label' => $this->title]]; $template = "\n{input}\n{label}\n{hint}\n{error}"; $data = [['title' => 'Technické služby Dačice s.r.o.', 'lat' => 49.08716, 'lng' => 15.434929, 'url' => 'http://www.tsdacice.cz']]; $center = new LatLng(['lat' => $data[0]['lat'], 'lng' => $data[0]['lng']]); $map = new Map(['width' => '100%', 'height' => 400, 'center' => $center, 'zoom' => 16]); foreach ($data as $item) { $coord = new LatLng(['lat' => $item['lat'], 'lng' => $item['lng']]); $marker = new Marker(['position' => $coord, 'title' => $item['title']]); $marker->attachInfoWindow(new InfoWindow(['content' => Html::a($item['title'], $item['url'])])); $map->addOverlay($marker); } ?> <section> <div class="container"> <div class="page-title"> <h2> <?php echo Breadcrumbs::widget(['homeLink' => ['label' => Yii::t('front', 'home'), 'url' => Yii::$app->homeUrl], 'activeItemTemplate' => "<span>{link}</span>", 'itemTemplate' => "<span>{link}</span>", 'links' => $breadcrumbs, 'tag' => 'div', 'options' => ['class' => 'breadcrumbs']]); ?> <?php echo ucfirst($this->title); ?> </h2>
<span id="kontakt"></span> <h2 class="font-effect-emboss" style="color: #7f7f7f;font-family: 'Francois One', sans-serif;margin-left:21%;padding-top:50px;font-size:2.9em">KONTAKT</h2><br /> <div id="nen-contact" style="margin-bottom:10px;border:none"> <div class="container"> <div class="row"> <div class="col-md-8 location"> <div class="contact-map" id="map-canvas" style="border: 1px solid #a3a3a3;"> <?php $coord = new LatLng(['lat' => 44.834209, 'lng' => 20.414084]); $map = new Map(['center' => $coord, 'zoom' => 16, 'width' => 'auto', 'height' => 430]); $home = new LatLng(['lat' => 44.833513, 'lng' => 20.40916]); // $map->appendScript($directionsService->getJs()); $marker = new Marker(['position' => $coord, 'title' => 'Life Fitnes Centar']); $marker->attachInfoWindow(new InfoWindow(['content' => '<img border="0" align="center" src="/images/objekat.jpg" width="222">'])); $map->addOverlay($marker); ?> <?php echo $map->display(); ?> </div> <div class="clearfix"></div> </div> <div class="col-md-4 contact_right" style="margin-top: 10px"> <div class="row" style="margin-top: -20px;margin-left: 8px"> <br /> <p style="float: left"><strong>Adresa : </strong><img src="/images/icon1.png" alt="icon 1" width="25px" />Džona Kenedija 10G, 11080 Srbija Zemun</p> <p style="float: left"><strong>Telefon : </strong><img src="/images/icon2.png" alt="icon 2" width="25px" />011/319-45-81</p><br /> </div>
$i++; } ?> </div> <div class="col-md-8"> <?php $coord = new LatLng(['lat' => 39.720089311812096, 'lng' => 2.91165944519042]); $map = new Map(['center' => $coord, 'zoom' => 14]); foreach ($addressDataProvider->models as $address) { if (!is_null($address['latitude'])) { $latitude = $address['latitude']; $longitude = $address['longitude']; $coord = new LatLng(['lat' => $latitude, 'lng' => $longitude]); $marker = new Marker(['position' => $coord, 'title' => $model->name]); $marker->attachInfoWindow(new InfoWindow(['content' => '<p>' . $address['address1'] . '</p>'])); $map->addOverlay($marker); } } echo $map->display(); ?> </div> </div> </div> </div> </div> <div class="organization-job-view col-md-3 col-md-offset-half"> <?php echo is_null($jobDataProvider) ? 'No tasks posted.' : ListView::widget(['dataProvider' => $jobDataProvider, 'itemView' => '_job_item', 'summary' => '', 'layout' => "{items}\n{summary}\n{pager}"]);
use frontend\models\MenuContent; use frontend\utilities\FrontEndHelper; use pavlinter\display\DisplayImage; use yii\helpers\Html; $this->title = $menuContent->title; $this->params['menuContent'] = $menuContent; $page = $menuContent->content; /** @noinspection PhpUndefinedFieldInspection */ $this->context->layout = 'page-content'; $data = [['title' => Yii::t('front', 'Aquapark of Dačice'), 'lat' => 49.083191, 'lng' => 15.422774, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['poolMenuId'])], ['title' => Yii::t('front', 'Sports Hall'), 'lat' => 49.082224, 'lng' => 15.433216, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['hallMenuId'])], ['title' => Yii::t('front', 'Town Stadium'), 'lat' => 49.084096, 'lng' => 15.434793, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['stadiumMenuId'])], ['title' => Yii::t('front', 'Skittle-alley'), 'lat' => 49.081995, 'lng' => 15.433613, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['skittleMenuId'])], ['title' => Yii::t('front', 'Playground in the Boženy Němcové Street'), 'lat' => 49.083391, 'lng' => 15.426961, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundTownMenuId'])], ['title' => Yii::t('front', 'Playground in the Bratrská Street'), 'lat' => 49.082153, 'lng' => 15.434847, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundTownMenuId'])], ['title' => Yii::t('front', 'Playground in the Dlouhá Street'), 'lat' => 49.082818, 'lng' => 15.423321, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundTownMenuId'])], ['title' => Yii::t('front', 'Playground Nivy'), 'lat' => 49.080432, 'lng' => 15.419617, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundTownMenuId'])], ['title' => Yii::t('front', 'Playground in the Vápovská Street'), 'lat' => 49.079634, 'lng' => 15.441433, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundTownMenuId'])], ['title' => Yii::t('front', 'Playground Za školou'), 'lat' => 49.074403, 'lng' => 15.442875, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundTownMenuId'])], ['title' => Yii::t('front', 'Playground in the Chateau park'), 'lat' => 49.077979, 'lng' => 15.430677, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundTownMenuId'])], ['title' => Yii::t('front', 'Playground in the Bílkov Village'), 'lat' => 49.084297, 'lng' => 15.478046, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundPlacesMenuId'])], ['title' => Yii::t('front', 'Playground in the Borek Village'), 'lat' => 49.074553, 'lng' => 15.460972, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundPlacesMenuId'])], ['title' => Yii::t('front', 'Playground in the Dolní Němčice Village'), 'lat' => 49.093647, 'lng' => 15.395012, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundPlacesMenuId'])], ['title' => Yii::t('front', 'Playground in the Hostkovice Village'), 'lat' => 49.081998, 'lng' => 15.383993, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundPlacesMenuId'])], ['title' => Yii::t('front', 'Playground in the Hradišťko Village'), 'lat' => 49.059376, 'lng' => 15.43991, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundPlacesMenuId'])], ['title' => Yii::t('front', 'Playground in the Chlumec Village'), 'lat' => 49.051084, 'lng' => 15.462888, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundPlacesMenuId'])], ['title' => Yii::t('front', 'Playground in the Lipolec Village'), 'lat' => 49.086869, 'lng' => 15.357986, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundPlacesMenuId'])], ['title' => Yii::t('front', 'Playground in the Malý Pěčín Village'), 'lat' => 49.107628, 'lng' => 15.458102, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundPlacesMenuId'])], ['title' => Yii::t('front', 'Playground in the Prostřední Vydří Village'), 'lat' => 49.123202, 'lng' => 15.41228, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundPlacesMenuId'])], ['title' => Yii::t('front', 'Playground in the Velký Pěčín Village'), 'lat' => 49.119018, 'lng' => 15.450244, 'url' => MenuContent::getMenuUrlFromId(Yii::$app->params[Yii::$app->language]['playgroundPlacesMenuId'])]]; $center = new LatLng(['lat' => 49.091067, 'lng' => 15.421259]); $map = new Map(['width' => '100%', 'height' => 800, 'center' => $center, 'zoom' => 13]); foreach ($data as $item) { $coord = new LatLng(['lat' => $item['lat'], 'lng' => $item['lng']]); $marker = new Marker(['position' => $coord, 'title' => $item['title']]); $marker->attachInfoWindow(new InfoWindow(['content' => isset($item['url']) ? Html::a($item['title'], $item['url']) : $item['title']])); $map->addOverlay($marker); } echo '<div class="row"><div class="col s12">'; echo $map->display(); echo '</div></div>'; if ($page->image) { echo DisplayImage::widget(['options' => ['class' => 'responsive-img', 'title' => $menuContent->title], 'category' => 'all', 'image' => $page->image->filename]); } if ($page->perex) { echo '<div class="perex">' . $page->perex . '</div>'; } if ($page->description) { echo '<div class="description">'; echo FrontEndHelper::parseContent($page->description); echo '</div>';
use dosamigos\google\maps\overlays\Marker; use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $locations common\models\Location[] */ /* @var $tickets [][] */ $this->title = 'Ticket Map'; $this->params['breadcrumbs'][] = ['label' => 'Tickets', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; $markers = []; foreach ($locations as $location) { $marker = new Marker(['title' => $location->fullName, 'position' => new LatLng(['lat' => $location->lat, 'lng' => $location->lng])]); $content = '<h4>' . Html::a($location->fullName, ['/location/view', 'id' => $location->id]) . '</h4><hr>'; foreach ($tickets[$location->id] as $id => $title) { $content .= Html::a($title, ['view', 'id' => $id], ['class' => 'showModalButton']) . '<br>'; } $marker->attachInfoWindow(new InfoWindow(['content' => $content])); $markers[] = $marker; } $bounds = LatLngBounds::getBoundsOfMarkers($markers); $map = new Map(['center' => $bounds->getCenterCoordinates(), 'zoom' => $bounds->getZoom(250), 'width' => '100%', 'height' => '100%']); foreach ($markers as $marker) { $map->addOverlay($marker); } ?> <div class="ticket-map"> <p class="pull-right"> <?php echo Html::a('<span class="glyphicon glyphicon-list"></span> List', ['index'], ['class' => 'btn btn-default btn-xs']); ?> <?php
use yii\helpers\Html; use yii\helpers\Url; use app\widgets\ActionsDropdown; use app\widgets\grid\GridView; $this->title = Yii::t('app', 'Partners on map'); $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Partners'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; use dosamigos\google\maps\LatLng; use dosamigos\google\maps\services\DirectionsWayPoint; use dosamigos\google\maps\services\TravelMode; use dosamigos\google\maps\overlays\PolylineOptions; use dosamigos\google\maps\services\DirectionsRenderer; use dosamigos\google\maps\services\DirectionsService; use dosamigos\google\maps\overlays\InfoWindow; use dosamigos\google\maps\overlays\Marker; use dosamigos\google\maps\Map; use dosamigos\google\maps\services\DirectionsRequest; use dosamigos\google\maps\overlays\Polygon; use dosamigos\google\maps\layers\BicyclingLayer; $coord = new LatLng(['lat' => 39.720089311812096, 'lng' => 2.91165944519042]); $map = new Map(['center' => $coord, 'zoom' => 14, 'width' => 1140, 'height' => 600]); // pd($map); // Lets add a marker now $marker = new Marker(['position' => $coord, 'title' => 'My Home Town']); // Provide a shared InfoWindow to the marker $marker->attachInfoWindow(new InfoWindow(['content' => '<p>This is my super cool content</p>'])); // Add marker to the map $map->addOverlay($marker); // Display the map -finally :) echo $map->display();
$marker->attachInfoWindow( new InfoWindow([ 'content'=>' <h4>'.$c->firstname.' '.$c->lastname.'</h4> <table class="table table-striped table-bordered table-hover"> <tr> <td>ที่อยู่</td> <td>'.$c->address.'</td> </tr> <tr> <td>ตำบล</td> <td>'.$c->tambon->tambon_name.'</td> </tr> <tr> <td>อำเภอ</td> <td>'.$c->tambon->district->district_name.'</td> </tr> <tr> <td>จังหวัด</td> <td>'.$c->tambon->province->province_name.'</td> </tr> <tr> <td>อีเมลล์</td> <td>'.$c->email.'</td> </tr> </table> ' ]) );
use dosamigos\google\maps\overlays\Polygon; use dosamigos\google\maps\overlays\InfoWindow; $this->title = $model->ALAMAT; $this->params['breadcrumbs'][] = ['label' => 'Customerskats', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <h1><?php echo Html::encode($this->title); ?> </h1> <div class="col-sm-12"> <?php if (!$model->MAP_LNG == NULL) { $coord = new LatLng(['lat' => $model->MAP_LAT, 'lng' => $model->MAP_LNG]); $map = new Map(['center' => $coord, 'zoom' => 20, 'width' => 1000, 'height' => 500]); $marker = new Marker(['position' => $coord, 'title' => $model->CUST_NM]); // Add marker to the map $marker->attachInfoWindow(new InfoWindow(['content' => $model->CUST_NM])); $map->addOverlay($marker); echo $map->display(); } else { echo 'No location coordinates for this place could be found.'; } ?> </div> <!-- end second col --> <?php echo Html::a('Back', ['index'], ['class' => 'btn btn-primary']); ?>