Egmap

Hello Guys,

I’m creating an application that tracks users location and displaying them on the map. My problem is that i don’t know of a way to draw polylines between two tracks using Egmap (I couldn’t find an example). I would also like to know of a way to show the user’s tracks in realtime without manually reloading the page (preferrably using Yii) but jquery/ajax is welcome. Can any of you great programmers help me figure out this problem?

The Example for egmap

http://www.yiiframework.com/extension/egmap#add-comment

Directions Example

How to work with directions and waypoints

<style>

#map_canvas img {

max-width: none;

}

</style>

<div id="map_canvas">

<?php

Yii::import(‘application.extensions.EGMap.*’);

$gMap = new EGMap();

$gMap->setWidth(512);

// it can also be called $gMap->height = 400;

$gMap->setHeight(400);

$gMap->zoom = 8;

// set center to inca

$gMap->setCenter(39.719588117933185, 2.9087440013885635);

// my house when i was a kid

$home = new EGMapCoord(39.720991014764536, 2.911801719665541);

// my ex-school

$school = new EGMapCoord(39.719456079114956, 2.8979293346405166);

// some stops on the way

$santo_domingo = new EGMapCoord(39.72118906848983, 2.907628202438368);

$plaza_toros = new EGMapCoord(39.71945607911511, 2.9049245357513565);

$paso_del_tren = new EGMapCoord( 39.718762871171776, 2.903637075424208 );

// Waypoint samples

$waypoints = array(

  new EGMapDirectionWayPoint(&#036;santo_domingo),


  new EGMapDirectionWayPoint(&#036;plaza_toros, false),


  new EGMapDirectionWayPoint(&#036;paso_del_tren, false)


);

// Initialize GMapDirection

$direction = new EGMapDirection($home, $school, ‘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’=>’#FFAA00’));

$direction->setRenderer($renderer);

$gMap->addDirection($direction);

$gMap->renderMap();

?>

<div id="direction_pane"></div>

</div>