GMapMultiplot gained inspiration from the Yii Gmap extension written by Konstantin Mirin. I rewrote the extension to plot multiple locations and upgraded the Javascript file to GMap API v3.
How it works:
While the class expects certain attributes, this can easily be edited to fit your needs.
You can view the extension in action by viewing a business profile on Rebates Hampton Roads
protected/extensionsThis extension was originally written to plot a businesses 1 or more locations, but can be easily modified for different scenarios.
If you run into any problems, please feel free to send me an email and I will correct any errors asap. You can find my email address within the class comments.
See the following code example:
$this->widget('application.extensions.gmapmultiplot.GMapMultiplot', array( 'id' => 'gmap',//id of the <div> container created 'label' => $label, //Title for bubble. Used if you are plotting multiple locations of same business 'address' => $array, //Array of AR objects ));
If passing the extension a single record, simply wrap the record in an array. This prevents an error while the extension attempts to loop through the records:
$this->widget('application.extensions.gmapmultiplot.GMapMultiplot', array( 'id' => 'gmap',//id of the <div> container created 'label' => $label, //Title for bubble. Used if you are plotting multiple locations of same business 'address' => array($array), //Array of AR objects ));
For more code examples, please visit the following link Code Sample on Pastebin.com
Total 1 comment
First of all thanks for providing such a great extension. Helps me a lot. But to make it work, I have to debug gmapmultiplot.js. I have to change this line at 106 in gmapmultiplot.js
to
to make it work.
Thanks
Leave a comment
Please login to leave your comment.