Google Map Api In Yii

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

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

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

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'<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/sad.gif' class='bbc_emoticon' alt=':(' />{'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