Problems With Route Directions Egmap

I have a map on which I combine points in the route.

For some reason, if I add more than 10 points MAP NOT DISPLAYED.

10 points shown, 11 is not displayed.

I would also like to make a point on the map displayed by way of turn, rather than an alternative route.

Screen 10 points:

Screen 11 points (if i add just one point, map not work):

Here is my code. Thank you.

$gMap = new EGMap();


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


$gMap->zoom = 7;

// Create geocoded address

$city_of_departure = new EGMapGeocodedAddress($model->city_of_departure);


$city_of_departure = new EGMapCoord($city_of_departure->getLat(), $city_of_departure->getLng());

$city_of_destination = new EGMapGeocodedAddress($model->city_of_destination);


// Add marker on geocoded address

$city_of_destination = new EGMapCoord($city_of_destination->getLat(), $city_of_destination->getLng());

// Waypoint samples

$waypoints = array();

foreach ($allcitypoints as $point) {

    $poinblank = new EGMapCoord($point->destination_cord_x, $point->destination_cord_y, true);

    $waypoints[] = new EGMapDirectionWayPoint($poinblank);


// Initialize GMapDirection

$direction = new EGMapDirection($city_of_departure, $city_of_destination, 'direction_sample', array('waypoints' => $waypoints));

$direction->optimizeWaypoints = true;

$direction->provideRouteAlternatives = true;


$renderer = new EGMapDirectionRenderer();

$renderer->draggable = true;

$renderer->panel = "direction_pane";





echo CHtml::hiddenField('searchTextField');

P.S "

Just after connecting EGmap error began to appear.

Does not appear often.

Unable to allocate memory for pool.

Screen APC



It is strange… I have attached a widget I created for more or less the same thing you are doing. Please, have a look at it, even though it uses pure JS inside.

How to use it (place it on the EGMap folder):

$this->widget('EGMapDirectionsTool', array(

	'directionsTitle' => 'Directions',

	'printControlText' => 'Print',

	'extraInfo' => $info,

	'endAddress' => $address,

	'centerLatitude' => $model->lat,

	'centerLongitude' => $model->lon,

	'htmlOptions' => array('class' => 'directions-tool-wrapper'),

	'controlsHtmlOptions' => array('class' => 'directions-tool-controls'),

	'buttonHtmlOptions' => array('class' => 'directions-tool-button')


On another note, I believe there is a Javascript Error… Have you checked the console ?

Sorry but i dont understand where i need a place this code.

Check the documentation:

(Using Waypoints in Routes)

Wow! I didn’t know that information… Is that new policy? To tell you the truth, I moved away totally from Google on Yii2, thats why I developed:

Thanks for the info Argent.

Dear sir Ramirez,

Should we no longer use egmap?

I mean, we have a new project coming in, and your extension seems quite handy for the job, however, if some core updates are necessary, (due to google API changes) I assume I can’t dig in as quick as if it was you.

Using Yii 1.1.14 not Yii 2.0 atm.

Please advice

I made an effort and built a totally new Yii2 google extension for API V3. If there are changes on the library (that I have already found out), I highly recommend you to use github. To tell you the truth I do not have much time atm, so I am sure that your speed on digging into the code would be fine.

We have a github repo where you can suggest changes to the library

Just FYI: