Advertisement
Guest User

Untitled

a guest
Nov 28th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1.     $jsAdressLookup='js:function(request, response) {
  2.         $("#test").gmap3({action:"getAddress", address: request.term, callback:function(results){
  3.        if (!results) return;
  4.        response($.map(results, function(item) {
  5.          return {
  6.            label:  item.formatted_address,
  7.            value: item.formatted_address,
  8.            latLng: item.geometry.location
  9.          }
  10.        }));
  11.      }
  12.    });
  13.  }';
  14.  
  15.     $jsAdressAddMarker='js:function(event, ui) {
  16.              $("#test").gmap3(
  17.                {action:"clear", name:"marker"},
  18.                {action:"addMarker",
  19.                  latLng:ui.item.latLng,
  20.                  map:{center:true}
  21.                }
  22.              );
  23.            }';
  24.     $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
  25.     'name'=>'city',
  26.     'source'=>$jsAdressLookup,
  27.     'options'=>array('select'=>$jsAdressAddMarker),
  28.     'htmlOptions'=>array(
  29.         'size'=>'40'
  30.     ),
  31. ));
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement