1

私は geocoder.geocode( {'address': address enter code here}, method is not running and skipping to next method, following is my method.

私を助けてください、私は過去2日間苦労していますが、出力はありません。エラーは発生しませんが、geocoder.geocode()enter code hereは実行されず、単にスキップします

function VerifyLocation() {
    $('#verify').click(function () {
    alert("verification");
        $('#verifyLocationVerify').hide();
        var address=$("#address").val();
        var sutenumber=$("#sutenumber").val();
        var city=$("#city").val();
        var country=$("#country option:selected").text();
        var state=$("#state option:selected").text();
        var pincode=$("#pincode").val();
        var addressdata=address+","+sutenumber+","+city+","+state+","+country+","+pincode;
         geocoder = new google.maps.Geocoder();
         geocoder.geocode(
         {'address': addressdata },
        function(data, status) { 
        if(data.length==0)
        {
                alert("location not found");
                $('#verifyLocationVerify').show();
                $('#verifyLocationConfirm').hide();
                $('#verifyLocationVerifySuccess').hide();
            }
            else{
            glat=data[0].geometry.location.nb;
            glng=data[0].geometry.location.ob;
                setCookie("latitude1",glat);
                setCookie("langitude1",glng);
                var styles = [{
                    "featureType": "road",
                    "stylers": [
                    { "lightness": 40 },
                    { "saturation": -100 }
                    ]
                }];
            var styledMap = new google.maps.StyledMapType(styles, { name: "Styled Map" });
            var latlang = new google.maps.LatLng(glat, glng);
            var mapOptions = {
                zoom: 15,
                center: latlang,
                mapTypeId: google.maps.MapTypeId.ROADMAP
                };
            map =  new google.maps.Map(document.getElementById("new_location"), mapOptions);
            map.mapTypes.set('map_style', styledMap);
            map.setMapTypeId('map_style');
            var marker = new google.maps.Marker({
                position: latlang,
                map: map,
                title: 'Entered Address Location'
            });
            }
        });

        $('#verifyLocationConfirm').show(function () {
            $('#verifyNo').click(function () {
                $('#verifyLocationVerify').show();
                $('#verifyLocationConfirm').hide();
                $('#verifyLocationVerifySuccess').hide();

                setCookie("verificationstatus","no");
            });

            $('#verifyYes').click(function () {
                //$('#verifyLocation').empty().removeClass('secondary').addClass('success').html('<p>Your Location has been Verified</p>');
                //$('#saveNew , #saveCont').removeClass('disabled');
                $('#verifyLocationVerify').hide();
                $('#verifyLocationConfirm').hide();
                $('#verifyLocationVerifySuccess').show();
                setCookie("verificationstatus","yes");
            });

        });
    });
}

よろしくお願いいたします。 サティシュ・ガイ

4

1 に答える 1