Skip to content
This repository has been archived by the owner on Nov 8, 2017. It is now read-only.

clicking on the auto suggested address is populating different address #317

Open
vivin1990 opened this issue Mar 6, 2017 · 0 comments
Open

Comments

@vivin1990
Copy link

Hi

I am using the geocomplete in the my project to search the address , when am trying in the address the auto suggest showing me proper address , if am using the keyboard to select then its working fine , proper address is getting populated , but if am using the mouse to click on the auto suggested address some ramdom address is getting populated . Let me know if there is any solution for resolve this .
below is the javascript . am using this plugin to add address in my project , map and form is in bootstrap model.

$(function(){
//lat long to point bangalore in india
var lat=12.9609468;
var lng=77.6356706;

            var center = new google.maps.LatLng(lat,lng);

            $("#geocomplete").geocomplete({
                map: ".map_canvas",
                types: ['establishment'],
                country: 'IN',
                details: "form",
                blur: true,
                geocodeAfterResult: true,
                markerOptions: {
                    draggable: true
                }
            });

            $("#geocomplete").bind("geocode:dragged", function(event, latLng){
                $("input[name=lat]").val(latLng.lat());
                $("input[name=lng]").val(latLng.lng());
                $("#reset").show();
            });


            $("#reset").click(function(){
                $("#geocomplete").geocomplete("resetMarker");
                $("#reset").hide();
                return false;
            });

            var modalMap =  $("#geocomplete").geocomplete("map");



            modalMap.setCenter(center);


            $('#addNewAddress').on('shown.bs.modal', function() {
                console.log("triggering resizex"+modalMap);
                google.maps.event.trigger(modalMap, 'resize');
                modalMap.setCenter(center);

// modalMap.setZoom(20);
});

        });
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant