distance between 2 places | WordPress.org

[ad_1]

Hello;
A question stuck in my head, actually I am logical, but I will succeed with this logic.

Now I am trying to calculate distance measurement between 3 places.

I created 2 dropdown fields. There are the same 3 places in both dropdowns.
1) 1st Place
2) 2nd Place
3) 3nd Place
shaped;

I found a method to write the distances between these 3 places in the result, but I think I’m making a small mistake..

(function() {
	var mesafe;
     var s1 = fieldname29;
     var s2 = fieldname30;
     var mesafe = aMesafe[s1][s2];

var aMesafe = [
[0,150,170],
[160,0,150],
[170,160,0],
];


    jQuery('#calculation-mesafe').html(mesafe);
    jQuery('.criter3-one').html('Mesafe: ');
    jQuery('.criter3-two').html(mesafe);

    return mesafe;
  })();

The code is exactly what it should do;
If s1 is selected;

If the 2nd value in the 1st dropdown field is selected
[160,0,150], this part will take into account..

If the 1st value in the 2nd dropdown field is selected
[0,150,170], this part will be considered

This is actually a calculation method between cities.. I couldn’t get it to work..

I’m leaving a codepen link for you, it’s a working Java version.

Where am I making a mistake in the coding part in this plugin..

Thanks a lot..

Codepen Link

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer