Yii Framework Forum: Google Map Api In Yii - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Google Map Api In Yii How to implement google map API in Yii style Rate Topic: -----

#1 User is offline   funthere 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 16-April 13

Posted 03 July 2014 - 11:16 PM

Anyone can help me?
Actually we have a project to make a Geographic Information System, and in this case we use Google Map API to do that. I wanna ask if there is an extension or way to do that? Because we find this project is hard to be implemented when combine Google map API and Yii style.

We have try to embed the example of google map tutorial into view file, but it's still not working.

Anyway I've try extension EGMap and that's great. But i honestly we need feature which can read data from kml or json to make polyline or polygon.

Can you help me or give some suggestions?
Am I missing something about the extension? Script or another convention in Yii?

Thank You and sorry for my bad English
Here is my email: suvander@gmail.com
0

#2 User is offline   skworden 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 174
  • Joined: 14-June 12
  • Location:Virginia, USA

Posted 07 July 2014 - 01:21 PM

View Postfunthere, on 03 July 2014 - 11:16 PM, said:

Anyway I've try extension EGMap and that's great. But i honestly we need feature which can read data from kml or json to make polyline or polygon.


egmap does allow for kml service read the how to in the docs they also have this egmapkmlfeed
0

#3 User is offline   Louis Gac 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 44
  • Joined: 13-June 14

Posted 07 July 2014 - 04:55 PM

View Postfunthere, on 03 July 2014 - 11:16 PM, said:

Because we find this project is hard to be implemented when combine Google map API and Yii style.


By Yii Style, do you mean yii views and css ?

You should give a try to Bootstrap for Yii :
http://yiibooster.clevertech.biz/
0

#4 User is offline   funthere 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 16-April 13

Posted 22 July 2014 - 12:17 AM

View PostLouis Gac, on 07 July 2014 - 04:55 PM, said:

By Yii Style, do you mean yii views and css ?

You should give a try to Bootstrap for Yii :
http://yiibooster.clevertech.biz/

Thanks, I will try this one :D

Quote

egmap does allow for kml service read the how to in the docs they also have this egmapkmlfeed

Ok, now I know that egmap support for kml.
But, I want to make my codes efficient, so i save the coordinates into database(MySql) and load it when the view opened.
Until this far, i success to make polygon by this way. But my problem now is to make the infoWindow appear.
How can i make it works?

I've try to make codes like these in the view:
 foreach($dataProvider as $record){
$info_window = new EGMapInfoWindow($record->name);
$info = new EGMapEvent('click', "function (event) { 
$.ajax({
                                            'type':'GET',
                                            'url':'".$this->createUrl('tabelpoly/view',array('id'=>$record->id))."',
                                            'data':({'lat': event.latLng.lat(), 'lng': event.latLng.lng()}),
                                            'cache':false,
                });}", false, EGMapEvent::TYPE_EVENT_DEFAULT);

			
			
			 
			$polygon->addEvent($info);
			$gMap->addPolygon($polygon);
}


And this code in TabelpolyController:
public function actionView($id)
	{
		$this->render('index',array(
			'dataProvider'=>$this->loadModel($id),
		));
	}


But nothing happen, Anyone can help me to make the scenario i mention before works?
Thank you
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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