Skip to content

Instantly share code, notes, and snippets.

@vbugarsk
Created May 2, 2012 21:30
Show Gist options
  • Save vbugarsk/2580663 to your computer and use it in GitHub Desktop.
Save vbugarsk/2580663 to your computer and use it in GitHub Desktop.
view.php of route model
<?php
$this->breadcrumbs=array(
'Routes'=>array('index'),
$model->title,
);
$this->menu=array(
array('label'=>'List Route', 'url'=>array('index')),
array('label'=>'Create Route', 'url'=>array('create')),
array('label'=>'Update Route', 'url'=>array('update', 'id'=>$model->id)),
array('label'=>'Delete Route', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
array('label'=>'Manage Route', 'url'=>array('admin')),
);
?>
<div class="portlet-decoration">
<div class="portlet-title"><?php echo 'ROUTE '.$model->id.' : '.$model->title ?></div>
</div>
</br>
<div style="float:left;width:50%;">
<?php
Yii::import('ext.gmaps.*');
$gMap = new EGMap();
$gMap->width = '100%';
$gMap->height = 300;
$gMap->mapTypeId = EGMap::TYPE_TERRAIN;
//$gMap->zoom = 10;
//$gMap->setCenter(45,15);
$start = new EGMapCoord($model->points[0]->lat, $model->points[0]->lon);
$finish = new EGMapCoord($model->points[sizeof($model->points)-1]->lat, $model->points[sizeof($model->points)-1]->lon);
for($i=1; $i<sizeof($model->points)-1; $i++) {
$point = $model->points[$i];
$wpt = new EGMapCoord($point->lat, $point->lon);
$waypoints[] = new EGMapDirectionWayPoint($wpt,false);
}
$direction = new EGMapDirection($start, $finish, 'direction_sample', array('waypoints' => $waypoints));
$direction->optimizeWaypoints = true;
$direction->provideRouteAlternatives = true;
$renderer = new EGMapDirectionRenderer();
$renderer->draggable = true;
$renderer->panel = "direction_pane";
$renderer->setPolylineOptions(array('strokeColor'=>'#FF0000'));
$direction->setRenderer($renderer);
$gMap->addDirection($direction);
$gMap->renderMap();
?>
</div>
<div style="float:right;width:49%;">
<?php
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'userId',
'user.username',
'user.password',
'user.salt',
'title',
'description',
),
));
?>
</div>
<div class="clear"></div>
</br>
<div>
<h4 style="color:#3B5998;border-top:1px solid #cacaca;">Srijeda 24.12.2012.</h4>
</div>
<div style="font-family: 'lucida grande',tahoma,verdana,arial,sans-serif;color: #555; line-height: 1.5em;">
<p>Blog your location while you travel with this free, simple, but powerful app. Travel Blog is a FREE, open-sourced, advert-free, Android application. It is a manual travel logger perfect for any traveller.</p>
<a href="http://www.flickr.com/photos/50906404@N02/6983898858/" title="P1010939 (160x120) by vbugarsk, on Flickr"><img src="http://farm8.staticflickr.com/7092/6983898858_b544da1770_q.jpg" width="100" height="100" alt="P1010939 (160x120)"></a>
<a href="http://www.flickr.com/photos/50906404@N02/7129981553/" title="P1010937 (160x120) by vbugarsk, on Flickr"><img src="http://farm9.staticflickr.com/8013/7129981553_12318a9907_q.jpg" width="100" height="100" alt="P1010937 (160x120)"></a>
<a href="http://www.flickr.com/photos/50906404@N02/7129981553/" title="P1010937 (160x120) by vbugarsk, on Flickr"><img src="http://farm9.staticflickr.com/8013/7129981553_12318a9907_q.jpg" width="100" height="100" alt="P1010937 (160x120)"></a>
<a href="http://www.flickr.com/photos/50906404@N02/7129981553/" title="P1010937 (160x120) by vbugarsk, on Flickr"><img src="http://farm9.staticflickr.com/8013/7129981553_12318a9907_q.jpg" width="100" height="100" alt="P1010937 (160x120)"></a>
<a href="http://www.flickr.com/photos/50906404@N02/6983898858/" title="P1010939 (160x120) by vbugarsk, on Flickr"><img src="http://farm8.staticflickr.com/7092/6983898858_b544da1770_q.jpg" width="100" height="100" alt="P1010939 (160x120)"></a>
<a href="http://www.flickr.com/photos/50906404@N02/7129981553/" title="P1010937 (160x120) by vbugarsk, on Flickr"><img src="http://farm9.staticflickr.com/8013/7129981553_12318a9907_q.jpg" width="100" height="100" alt="P1010937 (160x120)"></a>
<p>Blog your location while you travel with this free, simple, but powerful app
Travel Blog is a FREE, open-sourced, advert-free, Android application. It is a manual travel logger perfect for any traveller.
It can:</p>
<li>Log your location from GPS, Wifi or cell-id (tells you how accurate the fix is).</li>
<li>GPS turns off automatically after 15 seconds, or if it finds a GPS fix - a battery saver!</li>
<li>Attach a name and description with current timestamp.</li>
<li>Log multiple trips.</li>
<li>Edit or delete old posts.</li>
<li>Save as KML file to SD card:</li>
<li>KML file can then be Sent via email, or anything else you have installed like Dropbox.</li>
<li>KML files can be imported to Google Earth and other similar applications.</li>
<li>Time-stamp of each post saved so Google Earth animations and timelines can be used.</li>
<li>View trip on Google Maps.</li>
<p>It is not a battery hogger as it doesn't continually log your location, perfect for travelling in remote parts of the world, or long periods away from power. It also doesn't need internet (unless you want to view trip in google maps, or send it via email etc), perfect for travel abroad where data roaming costs plenty.</p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment