Yii Framework Forum: gmap not coming on page???? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

gmap not coming on page???? gmap not coming on page???? Rate Topic: -----

#1 User is offline   Rohit.28f 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 11-August 11
  • Location:Bangalore,INDIA

Posted 21 August 2011 - 09:04 PM

hi guys m new to Yii trying to implement gmap using Gmap2 extension
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&amp;v=2&amp;sensor=true_or_false&amp;          //-------------       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??????PLZ Help me.............
0

#2 User is offline   mahen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 04-August 11

Posted 18 September 2011 - 05:40 AM

i have the same problem its not working...



View PostRohit.28f, on 21 August 2011 - 09:04 PM, said:

hi guys m new to Yii trying to implement gmap using Gmap2 extension
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&amp;v=2&amp;sensor=true_or_false&amp;          //-------------       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??????PLZ Help me.............

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users