-
Notifications
You must be signed in to change notification settings - Fork 9
Home
solidsnake edited this page Dec 21, 2010
·
12 revisions
Here you can read about the Google Maps module. I hope you'll find the examples here helpfull! Customizing-controls
So, you want to display a Google-Map on your Homepage or in your Kohana application. You can just echo an instance of the Gmap class... Simple, is it?
public function action_index()
{
$this->template->gmap = new Gmap();
} // function
So, you want to add a few markers? That's no problem - Keep in mind that the "marker-id" (first parameter) must always be unique. If not, you'll overwrite it.
public function action_index()
{
$map = new Gmap();
$map->add_marker('A brand new marker', 51.123, 6.987)
->add_marker('Another marker', 52.13, 6.87);
->add_marker('A third marker', 52.34, 6.23);
$this->template->gmap = $map;
} // function
But simply displaying markers is a bit boring - So we'll add some Content and maybe a custom icon?
public function action_index()
{
$map = new Gmap();
$marker_options = array(
'content' => '<p>Simply stuff some <b>HTML</b> here!</p>',
'icon' => Kohana::find_file('path/to/image', 'image');
);
$map->add_marker('A brand new marker', 51.123, 6.987, $marker_options)
->add_marker('Another marker', 52.13, 6.87);
$this->template->gmap = $map;
} // function