/** * @inheritdoc */ public function run() { $coord = new LatLng(['lat' => $this->model->latitude, 'lng' => $this->model->longitude]); $this->mapOptions['center'] = $coord; $map = new Map($this->mapOptions); $marker = new Marker(array_merge($this->markerOptions, ['position' => $coord])); $map->addOverlay($marker); echo Html::tag('div', $map->display(), ['class' => 'map-canvas']); }
<div class="subhead"><?php echo \yii\timeago\TimeAgo::widget(['timestamp' => date('U')]); ?> </div> </div> <div class="subaction"> <?php echo \yii\timeago\TimeAgo::widget(['timestamp' => date('U')]); ?> </div> </div> <div class="media-area"> <div class="image"> <?php echo $map2->display(); ?> </div> </div> <div class="primary-context"> <div class="head">Heading</div> <div class="subhead">Lorem ipsum</div> </div> <div class="secondary-context cont"> <span><i class="fa fa-globe"></i> 7.345</span> <span> <i class="fa fa-users"></i> 468</span> <span> <i class="fa fa-rss fa-rotate-270"></i> 223</span> <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> </div>
${$report->idmain}->attachInfoWindow(new InfoWindow(['content' => '<p>' . $report->problem_prose . '</p>'])); // Add marker to the map $map->addOverlay(${$report->idmain}); } /* $js = "$(checkbox).onChange(function() {"; foreach($reports as $report) { $js .= "gmarker".$report->idmain.".setVisibility(false)"; } $js .= "}"; $map->appendScript($js); */ // Display the map -finally :) echo $map->display(); ?> <script> </script> <div id = "options"> Filter problems by: <form> <input type = "checkbox" name = "category" value="education" checked>Education <input type = "checkbox" name = "category" value="domestic" checked>Domestic <input type = "checkbox" name = "category" value="health" checked>Healthcare
$(this).closest('.hidden-content-container').find('div.hidden-content').toggleClass('hidden'); initialize(); });");*/ ?> <div class="card_container record-full" id="service-location" style="float:none;"> <?php /* time/loc */ ?> <div class="hidden-content-container"> <div class="header-context"> <div class="avatar center gray-color"> <i class="fa fa-map-marker fa-3x"></i> </div> <div class="title"> <div class="subhead"><?php echo Yii::t('app', 'Lokacija izvršenja usluge'); ?> </div> <div class="head second"><?php echo $model->loc->location_name; ?> </div> </div> </div> <div class="media-screen no-margin" id="gmap0-map-canvas"> <?php $map->display(); ?> </div> </div> </div>
public function run() { MapAsset::register($this->getView()); return $this->map->display(); }
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' => 16, 'lng' => 100]); $map = new Map(['center' => $coord, 'zoom' => 8]); // Lets add a marker now $marker = new Marker(['position' => new LatLng(['lat' => 16, 'lng' => 100]), 'title' => 'My Home Town', 'icon' => 'home.png']); // Provide a shared InfoWindow to the marker $marker->attachInfoWindow(new InfoWindow(['content' => '<p>This is my super cool content</p>'])); $map->addOverlay($marker); $marker = new Marker(['position' => new LatLng(['lat' => 15.97, 'lng' => 99.87]), 'title' => 'My Home Town', 'icon' => 'home.png']); // Provide a shared InfoWindow to the marker $marker->attachInfoWindow(new InfoWindow(['content' => '<p>This is my super cool content</p>'])); $map->addOverlay($marker); $marker = new Marker(['position' => new LatLng(['lat' => 16.1, 'lng' => 100.09]), 'title' => 'My Home Town', 'icon' => 'home.png']); // 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(['width' => '600px']);