Git Product home page Git Product logo

kohana-google-maps-module's Introduction

Kohana Google Maps Module V1.3

With this module you can easily add a Google Map to your Kohana installation!

The Google Map module has NO dependency to other modules!

Features

  • Display a Google-Map by just echo'ing an instance of the "Gmap" class
  • Setting several map-types (road, satellite, hybrid and terrain)
  • Setting sensor-parameter (for mobile devices)
  • Adding markers to the map (including custom icon and Google Maps popups)
  • Adding polylines to the map
  • Adding polygons to the map
  • Setting the positions and types for the map-controls

Features to come

The following features shall be implemented during development:

  • Cleaning up the Google Map-view (Maybe moving the javascript to a sub-views?)

Usage

The usage of this module is as easy as it could be! Simply activate the module in your bootstrap.php

/**
 * Enable modules. Modules are referenced by a relative or absolute path.
 */
Kohana::modules(array(
	// ...
	'gmap'       => MODPATH.'gmap',       // A simple google-maps module
));

Then you'll just echo an instance of the gmap class in your action... For example:

public function action_index()
{
	$this->template->map = Gmap::factory();
} // function

This is a more advanced example with usage of various options...

public function action_index()
{
	$gmap = Gmap::factory(
			array(
				'zoom' => 4,
				'sensor' => FALSE,
			))
		->add_marker('Marker A', 51.15, 6.83)
		->add_marker('Marker B', 51.15, 6.93,
			array(
				'content' => '<p>Put HTML here. "Quotes" and \'singlequotes\'</p>',
				'icon' => '/path/to/your.icon'
			))
		->set_gmap_size('100%', 500); // Will output "width: 100%; height: 500px"

	// This will render the Google Map.
	$this->template->map = $gmap;

	// Or...
	$this->template->map = $gmap->render();

	// Or rendering a own Google Map view.
	$this->template->map = $gmap->render('gmap_view_2');
} // function

Yes, it's that easy ;)

More!

For more information look up the wiki!

kohana-google-maps-module's People

Contributors

sunchaser avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.