I am using Praytimes JS source(http://praytimes.org/code/v2/js/PrayTimes.js) to display Muslim prayer times but for each location I have to manually add latitude & longitude of that location.
how can I get latitude & longitude and time zone (example: +4) values using API key or to add places in so just to type place name to get prayer time for that place, so
I want to know 1- how do I add cities manually 2- how to link the program to API places for below codes:
<script type="text/javascript">
prayTimes.setMethod('MWL');
var date = new Date();
var times = prayTimes.getTimes(date, [23.022505, 72.5713621]);
var list = ['Fajr', 'Sunrise', 'Dhuhr', 'Asr', 'Maghrib', 'Isha', 'Midnight'];
var html = '<table id="timetable">';
html += '<tr><th colspan="2">'+ date.toLocaleDateString()+ '</th></tr>';
for(var i in list) {
html += '<tr><td>'+ list[i]+ '</td>';
html += '<td>'+ times[list[i].toLowerCase()]+ '</td></tr>';
}
html += '</table>';
document.getElementById('table').innerHTML = html;
What I have tried:
<select id="cities" size="1" style="font-size: 12px;" onchange="getValues()">
<option value="52.379189:4.899431:+2" selected="selected">Amsterdam</option>
<option value="33.45:-112.06:-2">Phoenix</option>
<option value="40.748817:-73.985428:+4">New York</option>
</select>