{"id":295,"date":"2019-10-26T23:02:38","date_gmt":"2019-10-26T23:02:38","guid":{"rendered":"http:\/\/bossakov.eu\/wpdemo\/?page_id=295"},"modified":"2024-04-25T10:14:59","modified_gmt":"2024-04-25T10:14:59","slug":"over-the-air-distance-calculator","status":"publish","type":"page","link":"https:\/\/bossakov.eu\/wpdemo\/pvb-cf7-calculator-pro\/over-the-air-distance-calculator\/","title":{"rendered":"Over-the-air distance calculator"},"content":{"rendered":"<p>This calculator connects with the Google Maps API in order to get geographic coordinates of two addresses and then calculate distance &#8220;as the crow flies&#8221; (in miles and kilometres)<\/p>\n<p>The calculator uses <a href=\"https:\/\/en.wikipedia.org\/wiki\/Vincenty%27s_formulae\">Vincenty&#8217;s formula<\/a>, which is extremely accurate and precise on the WGS-84 World Geodetic System.<\/p>\n\n<div class=\"wpcf7 no-js\" id=\"wpcf7-f292-o1\" lang=\"en-US\" dir=\"ltr\" data-wpcf7-id=\"292\">\n<div class=\"screen-reader-response\"><p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"><\/p> <ul><\/ul><\/div>\n<form action=\"\/wpdemo\/wp-json\/wp\/v2\/pages\/295#wpcf7-f292-o1\" method=\"post\" class=\"wpcf7-form init\" aria-label=\"Contact form\" novalidate=\"novalidate\" data-status=\"init\">\n<fieldset class=\"hidden-fields-container\"><input type=\"hidden\" name=\"_wpcf7\" value=\"292\" \/><input type=\"hidden\" name=\"_wpcf7_version\" value=\"6.1.7\" \/><input type=\"hidden\" name=\"_wpcf7_locale\" value=\"en_US\" \/><input type=\"hidden\" name=\"_wpcf7_unit_tag\" value=\"wpcf7-f292-o1\" \/><input type=\"hidden\" name=\"_wpcf7_container_post\" value=\"0\" \/><input type=\"hidden\" name=\"_wpcf7_posted_data_hash\" value=\"\" \/><input type=\"hidden\" name=\"_wpcf7cf_hidden_group_fields\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_hidden_groups\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_visible_groups\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_repeaters\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_steps\" value=\"{}\" \/><input type=\"hidden\" name=\"_wpcf7cf_options\" value=\"{&quot;form_id&quot;:292,&quot;conditions&quot;:[],&quot;settings&quot;:{&quot;animation&quot;:&quot;yes&quot;,&quot;animation_intime&quot;:200,&quot;animation_outtime&quot;:200,&quot;conditions_ui&quot;:&quot;normal&quot;,&quot;notice_dismissed&quot;:true,&quot;repeater_remove_button&quot;:&quot;bottom&quot;,&quot;wpcf7cf_settings_saved&quot;:1}}\" \/>\n<\/fieldset>\n<p><label>Starting address:<br \/>\n[address start]<\/label>\n<\/p>\n<p><label>Destination address:<br \/>\n[address finish]<\/label>\n<\/p>\n<p><input class=\"wpcf7-form-control wpcf7-calculate_button cf7-calculate_button\" type=\"button\" value=\"Calculate\" \/><br \/>\n<span class=\"wpcf7-form-control-wrap distance_m_direct\"><input size=\"40\" class=\"wpcf7-form-control wpcf7-calculation pvb-display-none cf7-calculation\" readonly=\"readonly\" aria-invalid=\"false\" value=\"0\" type=\"text\" name=\"distance_m_direct\" \/><\/span><br \/>\n<label>Distance &quot;as the crow flies&quot;:<\/label><br \/>\n km<br \/>\n miles<br \/>\n nautical miles\n<\/p><input type=\"hidden\" name=\"_pvb_ajax_calc_nonce\" value=\"b21ca03f62\"><div class=\"wpcf7-response-output\" aria-hidden=\"true\"><\/div>\n<\/form>\n<\/div>\n\n<h2>Source code for this form:<\/h2>\n<pre>&lt;label&gt;Starting address:\r\n[address start]&lt;\/label&gt;\r\n\r\n&lt;label&gt;Destination address:\r\n[address finish]&lt;\/label&gt;\r\n\r\n[calculate_button calculate_button-1 \"Calculate\"]\r\n[calculation distance_m_direct cf7-hide \"fn_php(return myDistanceCalc();)\"]\r\n&lt;label&gt;Distance \"as the crow flies\":&lt;\/label&gt;\r\n[calculation distance_km_direct precision:2 \"distance_m_direct \/ 1000\"] km&lt;\/label&gt;\r\n[calculation distance_mi_direct precision:2 \"distance_m_direct \/ 1609.34\"] miles\r\n[calculation distance_nm_direct precision:2 \"distance_m_direct \/ 1852\"] nautical miles\r\n<\/pre>\n<h2>Source code for the PHP helper function (using the third-party <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\" rel=\"noopener\" target=\"_blank\">Code Snippets<\/a> plugin):<\/h2>\n<p><iframe src=\"https:\/\/pastebin.com\/embed_iframe\/VAs5mQpc\" style=\"border:none;width:100%;height:1600px\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This calculator connects with the Google Maps API in order to get geographic coordinates of two addresses and then calculate distance &#8220;as the crow flies&#8221; (in miles and kilometres) The calculator uses Vincenty&#8217;s formula, which is extremely accurate and precise on the WGS-84 World Geodetic System. Source code for this form: &lt;label&gt;Starting address: [address start]&lt;\/label&gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-295","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/pages\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/comments?post=295"}],"version-history":[{"count":11,"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/pages\/295\/revisions"}],"predecessor-version":[{"id":584,"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/pages\/295\/revisions\/584"}],"up":[{"embeddable":true,"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/pages\/2"}],"wp:attachment":[{"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/media?parent=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}