Use google map api v3 in yii


i want to create a web application for fleet management system with yii.For this purpose i use Yii framework and Google map api v3.I am newbie in Yii framework.I want to import google map to view file but when i use simple html code in view php code i can’t access google map in the browser because Yii generate head of html code that i can’t import google map api script!

How can i use google map api in my Yii application.

in this api i use google map polyline and bound apis.

please help me using google map api in my yii application!

I attached my map view php file!





	'Hello World'=>array('/helloWorld'),



and try again.

I remove but doesn’t work

when i view source code of view file in browser i see that structure of html file isn’t valid! i attached code that i use ctrl+u firefox to see code!

i can see 2 head tag in this file that html structure isn’t valid!

This looks like the standard layout file. By default yii uses its own layout file under protected/views/layouts/main.php.

You can overwrite which layout yii is supposed to use by setting

$this->layout="my layout";

in your action.

What you could do is the following:

  1. Create your own layout file and put the header in there including the JS.

  2. Tell your action to use this new layout file by using the above mentioned code snippet.

  3. Only have the body left in the map.php view.

Please read the fundamentals for more information.

Thanks for your help.

You’re welcome :)