Yii 1.1: google-static-maps

Widget for producing Google Static Maps
10 followers

A widget that quickly produces Google Static Maps.

Handles most features of the Static Maps API, with the exception of polylines

Resources

Documentation

Requirements

  • Yii 1.0 or above

Installation

  • Extract the release file under protected/components/widgets

Usage

See the following code example:

$this->widget('application.components.widgets.WGoogleStaticMap',array(
    'center'=>'52.3214,2.34403', // Or you can use text eg. Dundee, Scotland
    'alt'=>"Map for location of something", // Alt text for image (optional)
    'zoom'=>0, // Google map zoom level
    'width'=>250, // image width
    'height'=>250, // image Height
    'markers'=>array(
        array(
            'style'=>array('color'=>'green'),
            'locations'=>array('Dundee, UK','Sydney, Australia'), // Or use lat/long pairs
        ),
        array(
            'style'=>array('color'=>'blue','label'=>'X'),
            'locations'=>array('52.433432,-100.34322'),
        ),
    ),
    'linkUrl'=>array('location/view'), // Where the image should link (optional)
    'linkOptions'=>array('target'=>'_blank'), // HTML options for link tag (optional)
    'imageOptions'=>array('class'=>'map-image'), // HTML options for img tag (optional)
));

Result

Sample image

See Google Static Maps API documentation for more information.

Change Log

March 11, 2010

  • Initial release.

March 18, 2010

  • Added support for custom icons.

Total 2 comments

#510 report it
Zifius at 2010/05/10 08:12am
A+

Great widget with swift support from the developer. Thumbs up!

#699 report it
Koneko13 at 2010/03/16 04:52pm
Greate and very useful

Very good and useful widget.

Leave a comment

Please to leave your comment.

Create extension