Skip to main content
added 114 characters in body; edited tags
Source Link
Boris Bachovski
  • 16.3k
  • 8
  • 50
  • 88

I have created visual force pages it's working fine. I need to spilt the selected address such as city, street, country and so on. Please find the VF page attachment of images.

<apex:page id="page" standardController="account" >

<apex:page id="page" standardController="account" >
 <script src="https://maps.googleapis.com/maps/api/js?language=en&sensor=false&libraries=places" type="text/javascript"></script>  
    <script type="text/javascript"> 
 
        function initializeField() {        
            var input = document.getElementById('page:form:field');           
            var autocomplete = new google.maps.places.Autocomplete(input); 
            
            
            var myLatlng = new google.maps.LatLng(latitude,longitude);
        map = new google.maps.Map(map_canvas, map_options);
        marker = new google.maps.Marker({
        position: myLatlng,
        map: map,
        draggable:true,
        title: address
        
       
        });
          
        }
        
        google.maps.event.addDomListener(window, 'load', initializeField);  
 
    </script> 
<apex:form id="form" ><b> <apex:outputLabel value="Global Address Search" for="field" /></b>&nbsp;
<apex:inputTextarea id="field" cols="25" rows="5" />
 </apex:form>   
</apex:page>

<apex:form id="form" > <apex:outputLabel value="Global Address Search" for="field" />  <apex:inputTextarea id="field" cols="25" rows="5" /> </apex:form>
</apex:page>

Images:

enter image description here

I have created visual force pages it's working fine. I need to spilt the selected address such as city, street, country and so on. Please find the VF page attachment of images.

<apex:page id="page" standardController="account" >

<script type="text/javascript"> 

    function initializeField() {        
        var input = document.getElementById('page:form:field');           
        var autocomplete = new google.maps.places.Autocomplete(input); 
        
        
        var myLatlng = new google.maps.LatLng(latitude,longitude);
    map = new google.maps.Map(map_canvas, map_options);
    marker = new google.maps.Marker({
    position: myLatlng,
    map: map,
    draggable:true,
    title: address
    
   
    });
      
    }
    
    google.maps.event.addDomListener(window, 'load', initializeField);  

</script> 

<apex:form id="form" > <apex:outputLabel value="Global Address Search" for="field" />  <apex:inputTextarea id="field" cols="25" rows="5" /> </apex:form>
</apex:page>

Images:

enter image description here

I have created visual force pages it's working fine. I need to spilt the selected address such as city, street, country and so on. Please find the VF page attachment of images.

<apex:page id="page" standardController="account" >
 <script src="https://maps.googleapis.com/maps/api/js?language=en&sensor=false&libraries=places" type="text/javascript"></script>  
    <script type="text/javascript"> 
 
        function initializeField() {        
            var input = document.getElementById('page:form:field');           
            var autocomplete = new google.maps.places.Autocomplete(input); 
            
            
            var myLatlng = new google.maps.LatLng(latitude,longitude);
        map = new google.maps.Map(map_canvas, map_options);
        marker = new google.maps.Marker({
        position: myLatlng,
        map: map,
        draggable:true,
        title: address
        
       
        });
          
        }
        
        google.maps.event.addDomListener(window, 'load', initializeField);  
 
    </script> 
<apex:form id="form" ><b> <apex:outputLabel value="Global Address Search" for="field" /></b>&nbsp;
<apex:inputTextarea id="field" cols="25" rows="5" />
 </apex:form>   
</apex:page>

Images:

enter image description here

Source Link
Nikitha
  • 171
  • 2
  • 7
  • 20

How to split the address in google map in search textbox?

I have created visual force pages it's working fine. I need to spilt the selected address such as city, street, country and so on. Please find the VF page attachment of images.

<apex:page id="page" standardController="account" >

<script type="text/javascript"> 

    function initializeField() {        
        var input = document.getElementById('page:form:field');           
        var autocomplete = new google.maps.places.Autocomplete(input); 
        
        
        var myLatlng = new google.maps.LatLng(latitude,longitude);
    map = new google.maps.Map(map_canvas, map_options);
    marker = new google.maps.Marker({
    position: myLatlng,
    map: map,
    draggable:true,
    title: address
    
   
    });
      
    }
    
    google.maps.event.addDomListener(window, 'load', initializeField);  

</script> 

<apex:form id="form" > <apex:outputLabel value="Global Address Search" for="field" />  <apex:inputTextarea id="field" cols="25" rows="5" /> </apex:form>
</apex:page>

Images:

enter image description here