如何从Codeigniter中的给定地址获取纬度和经度

  • This is my jQuery code:

          $(document).ready(function(){
    
               $("#landmark").focusout(function(){
               var geocoder = new google.maps.Geocoder();
               var address = $("#landmark").val();
               if(address!="")
               {
               geocoder.geocode( { 'address': address}, function(results, 
               status) {
    
                 if (status == google.maps.GeocoderStatus.OK) {
                   var latitude = results[0].geometry.location.lat();
                   var longitude = results[0].geometry.location.lng();
                   $("#lat").val(latitude);
                   $("#longi").val(longitude); 
                   }   
               });
               }
             });
           });
    

    This doesn't work with Codeigniter - do I need to add some library files in Codeigniter?