• Resolved Setsuna.16

    (@setsuna16)


    Hi, I’ve been trying to use the code in the FAQ section to update my map’s info. ( Lat and Lng ).

    I did this to see the available function that I can use but I think I’m not using the correct method here.

    $j('.cf7-google-map-container.banner-coverage-area').on('drag.cf7-google-map update.cf7-google-map', function(e){
             //the event has 5 address fields, e.address.line, e.address.city, e.address.pin, e.address.state, e.address.country.
             //some fields may be empty.
             $j('#search-covarage-area').val( e.address.line + e.address.city + e.address.pin + e.address.state + e.address.country ); 
            e.gmap3.map({
                center: center,
                zoom: 18,
                mapTypeId : google.maps.MapTypeId.ROADMAP
            });
            
            console.log(e);
        });

    I want to do it vice versa. When I drag the marker the data attributes should change to the correct location, same with the address field too.

    I tried .marker .map but the parameters seems incorrect.

    https://prnt.sc/13perqc
    Thank you!

    • This topic was modified 3 years, 6 months ago by Setsuna.16.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Setsuna.16

    (@setsuna16)

    Hi, so I was able to play around and get the function that I needed. Thanks for the FAQs you provided. I’m now encountering this strange issue I think that I can call.

    I have a main location. What I am doing is to get the lat() and lng() value then when I move the marker or search a new location I will gather the lat() and lng() of that new location. I combined those values (lat1(), lng1(), lat2(), lng2()) to get its distance. The issue is the distance in Meters and Kilometers seems not accurate. I’m always getting a value of 7.(what number comes). Even if the new location is far from the main location the meters and km value is incorrect.

    https://prnt.sc/13q5rfu

    Thanks!

    Plugin Author Aurovrata Venet

    (@aurovrata)

    it’s not clear what you are trying to achieve.

    .on('drag.cf7-google-map update.cf7-google-map',

    you’re triggering your script on 2 events that exposes different type of map properties, so it is bound to fail.

    You need to understand how javascript events exposes the various map properties and objects. (see FAQ #11)

    Plugin Author Aurovrata Venet

    (@aurovrata)

    The issue is the distance in Meters and Kilometers seems not accurate. I’m always getting a value of 7

    well this is really beyond the scope of support for this plugin. I would help you if I knew the answer, but I have never tried working out distances. You should post your question on Stackoverflow for help ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Initiate Map upon changing Address’ is closed to new replies.