This is the minimum unit delegation to vote ratio calculator, part of the Young Democrats of America (YDA) chartering and credentials process. It uses the Google Maps API to calculate the mileage between the site of the convention and the state capital or largest city (whichever is furthest) based on Section 370(b) of the YDA Charter (2016). If a state or territory is overseas, the maximum possible amount of votes will be accredited to that unit.
You will need a Google Maps Direction and Javascript APIs key
[$key] = Google Calendar API key
You can get the Google Developer APIs at https://console.developers.google.com/
Please note that this code is API intensive. Google Maps free API quota may be exceeded if used incorrectly.