Permalink
Browse files

make drawing manager global so it can be used in external js

  • Loading branch information...
BIOSTALL committed Feb 13, 2012
1 parent 816854b commit 2076ef4fd9199ad60c792cf4a31f8221d697e50a
Showing with 5 additions and 1 deletion.
  1. +5 −1 application/libraries/Googlemaps.php
@@ -1111,6 +1111,10 @@ function create_map()
$this->output_js_contents .= 'var adUnit;
';
}
+ if ($this->drawing) {
+ $this->output_js_contents .= 'var drawingManager;
+ ';
+ }
$this->output_js_contents .= 'function initialize() {
@@ -1416,7 +1420,7 @@ function create_map()
if ($this->drawingControlPosition=='') { $this->drawingControlPosition = 'TOP_CENTER'; }
- $this->output_js_contents .= 'var drawingManager = new google.maps.drawing.DrawingManager({
+ $this->output_js_contents .= 'drawingManager = new google.maps.drawing.DrawingManager({
drawingMode: google.maps.drawing.OverlayType.'.strtoupper($this->drawingDefaultMode).',
drawingControl: '.(!$this->drawingControl ? 'false' : 'true').',
drawingControlOptions: {

0 comments on commit 2076ef4

Please sign in to comment.