• Anna
    November 24, 2014 at 11:42 am #100854

    Google maps address details are assigned to auto-complete in a JS file.

    Documentation – 

    Google documentation moved to https://developers.google.com/maps/articles/geocodestrat

    and for the types used

    https://developers.google.com/maps/documentation/geocoding/

    If you are confident to modify the fields, you can edit the assignment of the fields in FILE:

    js/google_js/google_maps_submit.js

    Default code:

    function fillInAddress(place) {
            $('#property_area').val('');
            $('#property_zip').val('');
            $('#property_county').val('');
            $('#property_city_submit').val('');
            
            for (var i = 0; i < place.address_components.length; i++) {
              var addressType = place.address_components[i].types[0];
           
                var temp='';
                var val = place.address_components[i][componentForm[addressType]];
               
          
                    
                if(addressType=== 'street_number' || addressType=== 'route'){
                  //  document.getElementById('property_address').value =  document.getElementById('property_address').value +', '+ val;
                }else if(addressType=== 'neighborhood'){
                     $('#property_area').val(val);
                }else if(addressType=== 'postal_code_prefix'){
                   // temp = $('#property_zip').val();
                    $('#property_zip').val(val);
                }else if(addressType=== 'postal_code'){
                   // temp = $('#property_zip').val();
                    $('#property_zip').val(val);
                }else if(addressType=== 'administrative_area_level_2'){
                    $('#property_county').val(val);
                }else if(addressType=== 'administrative_area_level_1'){
                    $('#property_county').val(val);
                }else if(addressType=== 'locality'){
                    $('#property_city_submit').val(val);
                }else if(addressType=== 'country'){
                    $('#property_country').val(val);
                }else{
                   
                }
                
              
            }
            
        }
    • This topic was modified 2 years, 6 months ago by  Anna.
    • This topic was modified 2 years, 2 months ago by  Anna.
    • This topic was modified 1 year, 9 months ago by  Anna.
    lexuspro
    February 26, 2015 at 3:43 pm #103769

    Sorry, Anna!
    This code is designed to address are automatically clipped to the street?
    Could you write this code again in the tag /CODE

    Greatone
    March 12, 2015 at 11:26 pm #104332

    https://www.google.com/maps/place/Peninsula+Rd,+Kelvin+Heights,+Queenstown+9300,+New+Zealand/@-45.0354441,168.7038649,17z/data=!4m2!3m1!1s0xa9d51e030d9eb623:0x5376ee763169f01e

    Can you tell me what type is use for kelvin heights?

    like peninsula = street address

    queenstown = city address

    9300 = postal code

    New Nealand = country

    kelvin heights = ?

    because i used neighbourhood, sublocality, and so on but nothing get the kelvin heights from address, though everything else is getting like country, locality/city, postal code, and so on.

    mitchoo
    June 3, 2015 at 9:39 am #110111

    Google documentation moved to https://developers.google.com/maps/articles/geocodestrat

    and for the types used

    https://developers.google.com/maps/documentation/geocoding/

    • This reply was modified 1 year, 11 months ago by  mitchoo.

You must be logged in to reply to this topic.

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.