Loading First-class-function example ...

How to use the calculator:
1. Select City A and City B, or  
    enter the latitude & longitude manually.
2. Click the Distance button.  

Supported latitude & longitude formats:
Decimals or degrees-minutes-seconds 
In place of the degree sign ° you may type d.

Examples:
45.0000 -121.0000
47°36'11"N 122°19'22"W
47d36'12"N 122d19'34"W
47°36'N 122°19'W
47d36'N 122d19'W
1dN 25dE
1°N 25°E

Notes:
Flying distances are computed along great circles. 
The calculator assumes that: 

  • The Earth is a perfect sphere 
  • 1 kilometer = 1/40000 of the Earth's great circle 
  • 1 mile = 1.609344 km 
  • 1 nautical mile = 1 minute of arc on a great circle 
  • Driving distance  ≈  1.2 × flying distance 
       (shown only for cities within the same country)
  • ....
    var a = Number( dojo.byId("lat1").value );
    var b = Number( dojo.byId("lon1").value );
    var c = Number( dojo.byId("lat2").value );
    var d = Number( dojo.byId("lon2").value );
    reset();
    ....

    function reset () {
       // Reset HTML elements
       dojo.byId("content").innerHTML ="";
       dojo.byId("functions").innerHTML ="";
    }
    dojo.xhrPost({
       url: "data/object.json",
       handleAs: "json",
       load: function(data,ioargs){...}
    });
    function calculator (a, b, c, func){
       return func(a,b,c);
    };

    City Distance Calculator – Flying & Driving

    Latitude A:  Longitude A:
    Latitude B:  Longitude B:
     

    Homework 2:


    Dojo version selector:

    path:
    Load time:
    Here of css Load time:
    Here of dojo Load time:
    Parse time: