Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: C:/svn/about-australia.com/protected/extensions/geocoder/libraries/Result.php
- ===================================================================
- --- C:/svn/about-australia.com/protected/extensions/geocoder/libraries/Result.php (revision 537)
- +++ C:/svn/about-australia.com/protected/extensions/geocoder/libraries/Result.php (revision 538)
- @@ -172,6 +172,7 @@
- // Register the javascript
- Yii::app()->getClientScript()->registerScript("{$type}_map_js".(self::$_map_count++), $map_script, CClientScript::POS_READY);
- +
- }
- // Render the map point
- @@ -206,6 +207,24 @@
- // Register the javascript
- Yii::app()->clientScript->registerScript("{$type}_point_js".(self::$_point_count++), $point_script, CClientScript::POS_READY);
- }
- +
- + public function renderAutoZoom($container_id)
- + {
- + // Validate the container
- + if (!isset(self::$_map_containers[$container_id]))
- + throw new GeoCode_Exception("Unknown map container '{$container_id}'");
- +
- + // Get our type
- + $type = self::$_map_containers[$container_id];
- +
- + // Render the view
- + $zoom_script = $this->render("{$type}/zoom", array(
- +
- + ), true);
- +
- + // Register the javascript
- + Yii::app()->clientScript->registerScript("{$type}_zoom_js".$container_id, $zoom_script, CClientScript::POS_READY);
- + }
- /**
- * Get the string associated with the accuracy constant
- Index: C:/svn/about-australia.com/protected/extensions/geocoder/views/google/point.php
- ===================================================================
- --- C:/svn/about-australia.com/protected/extensions/geocoder/views/google/point.php (revision 537)
- +++ C:/svn/about-australia.com/protected/extensions/geocoder/views/google/point.php (revision 538)
- @@ -22,6 +22,7 @@
- */
- ?>
- var point = new google.maps.LatLng(<?php echo $latitude; ?>, <?php echo $longitude; ?>);
- +points.push(point);
- var marker = new google.maps.Marker({
- position: point,
- map: gmap,
- Index: C:/svn/about-australia.com/protected/extensions/geocoder/views/google/map.php
- ===================================================================
- --- C:/svn/about-australia.com/protected/extensions/geocoder/views/google/map.php (revision 537)
- +++ C:/svn/about-australia.com/protected/extensions/geocoder/views/google/map.php (revision 538)
- @@ -29,6 +29,7 @@
- $options['mapTypeId'] = 'google.maps.MapTypeId.'.$options['mapTypeId'];
- ?>
- var point = new google.maps.LatLng(<?php echo $latitude; ?>, <?php echo $longitude; ?>);
- +var points = new Array(point);
- var gmap = new google.maps.Map(document.getElementById("<?php echo $container_id; ?>"), {
- <?php
- // Output the options. We don't use json_encode because it escapes the strings and
- Index: C:/svn/about-australia.com/protected/extensions/geocoder/views/google/zoom.php
- ===================================================================
- --- C:/svn/about-australia.com/protected/extensions/geocoder/views/google/zoom.php (revision 0)
- +++ C:/svn/about-australia.com/protected/extensions/geocoder/views/google/zoom.php (revision 538)
- @@ -0,0 +1,6 @@
- +var bounds = new google.maps.LatLngBounds();
- +for (var _marker in points) {
- + bounds.extend(points[_marker]);
- +}
- +gmap.setZoom(gmap.fitBounds(bounds));
- +gmap.setCenter(bounds.getCenter());
- \ No newline at end of file
Add Comment
Please, Sign In to add comment