This extension allows you to use google maps on your page. You just put address and widget does the rest. It also has an extensive client side, so you can later interact with the map using fairly simple API.
See the following code example:
$this->widget('application.extensions.gmap.GMap', array( 'id' => 'gmap',//id of the <div> container created 'key' => '...', //goole API key, should be obtained for each site,it's free 'label' => 'some company', //text written in the text bubble 'address' => array( 'address' => '1600 Amphitheatre Pky',//address of the place 'city' => 'Mountain View', //city 'state' => 'CA'//state //'country' => 'USA' - country //'zip' => 'XXXXX' - zip or postal code ) ));
This generates nearly the following
As you see, there is an object - m, it can be used in any JS scripts. It has the following methods:
If you use widget without specifying an address, you will get the same, but will have to m.setAddress and call m.show() manually. This may be used for showing user his place when hitting Refresh button.