easymap The easiest way to add and style google map in your application.

  1. Requirements
  2. Usage

Add google map in your application and change the color scheme to match your theme. This is the easiest way to implement google map. The extension is just a wrapper for google's latest javascript map API to make it more easier.

Requirements

Yii 1.1 or above

PHP 5 above

Google Map API key. If you dont have API key, you can obtain it from here.

Usage

Extract the folder into protected/extension/easymap.

Insert following widget in view for simple map integration:

$this->widget('ext.easymap.EasyMap', array(
    'key' => '', /*Insert your developer API key for google map*/
	'id' => 'newmap', /*This is the id of the map wrapper div*/
	'latitude' => '22.572646000000000000', /*Place Latitude*/
	'longitude' => '88.363894999999950000', /*Place Longitude*/
	'maptype' => 'ROADMAP', /*ROADMAP, SATELITE, HYBRID, TERRAIN*/
	'zoom' => '10', /*Zoom level. Default is 7*/
	'width' => '400', /*Map height*/
	'height' => '200', /*Map width*/
	'markertitle' => '', /*Title of the place marker*/
));

Following is the example of styled map:

$this->widget('ext.easymap.EasyMap', array(
    'key' => '',
	'id' => 'newmap',
	'latitude' => '22.572646000000000000',
	'longitude' => '88.363894999999950000',
	'maptype' => 'ROADMAP', /*ROADMAP, SATELITE, HYBRID, TERRAIN*/
	'zoom' => '10',
	'width' => '400',
	'height' => '200',
	'markertitle' => '',
	'style' => array(
					array(
					
					'stylers'=>   array(array(
	             		 'hue'=>'#00ffe6', /*an RGB hex string*/
				 		 'saturation'=>'20', /*a floating point value between -100 and 100*/
				 		 ),),
						),
						
						array(
					'featureType'=>'road', /*road, road.local, landscape, landscape.natural*/
					'elementType'=>'geometry', /*all, geometry, geometry.fill, geometry.stroke, labels, labels.icon, labels.text, labels.text.fill,    	labels.text.stroke*/
					'stylers'=>   array(array(
	             		 'lightness'=>'100', /*a floating point value between -100 and 100*/
				 		 'visibility'=>'simplified', /*on, off, or simplified*/
						  ),),
						),
						
						array(
					'featureType'=>'road', 
					'elementType'=>'labels', 
					   'stylers'=>   array(array(
	             		                 'visibility'=>'off', 
						 
	            		  ),),
						),
						
						),
						
						
		
    ));

Here is the full list of option available for stylers array:

'stylers'=>   array(array(
                   'hue'=>'', /*an RGB hex string*/
		   'saturation'=>'', /*a floating point value between -100 and 100*/
	           'lightness'=>'', /*a floating point value between -100 and 100*/
	           'visibility'=>'', /*on, off, or simplified*/
                   'gamma'=>'', /*a floating point value between 0.01 and 10.0, where 1.0 applies no correction*/
                   'inverse-lightness'=>'', /*(if true) simply inverts the existing lightness*/
                   'color'=>'', /*(an RGB hex string) sets the color of the feature*/
                   'weight'=>'', /*an integer value, greater than or equal to zero*/
		         ),
                      ),

For more style option visit this google map API site.

2 0
10 followers
701 downloads
Yii Version: Unknown
License: BSD-2-Clause
Category: Web Service
Developed by: Robiul
Created on: Jun 1, 2013
Last updated: 11 years ago

Downloads

show all

Related Extensions