i m using Yii1.1.6 ,Gmap2.0 extension
steps are as follows---------
1-extracted extension Gmap2.0 in protected/extension
2-in config main ,in import section------'ext.Gmap.*';
3-created new controller & view for gmap
4-written following code---
<script src="http://maps.google.com/maps?file=api&v=2&sensor=true_or_false& //------------- Google key-----------//
key=ABQIAAAAYHXQtSPuNO1uLC4kbOBvBxRAjXr0LoQBOfzx_bw-iZam2U2rpxSke4WPkIbVnzd-mC9m5OmUROjoTQ"
type="text/javascript"></script>
<?php
print_r("<pre>");
print_r($gMap);
print("</pre>");
Yii::import('ext.gmaps.*');
$gMap = new EGMap();
$gMap->setCenter(51.245475,6.821373);
$gMap->addMarker(new EGMapMarker(51.245475,6.821373));
$gMap->addMarker(new EGMapMarker(46.262248,6.115969));
//$gMap->setZoom(4); //-----------disabled setzoom () other wise giving error [b]Fatal error[/b]: Call to undefined method EGMap::setZoom()-----------
$gMap->renderMap();
?>Output
gray container is coming but map is not visible in that container?

Help

This topic is locked











