Widget:PlaceNamesNavigationMapEnglish: Difference between revisions
From International Robin Hood Bibliography
mNo edit summary |
mNo edit summary |
||
Line 30: | Line 30: | ||
d.counties = { | d.counties = { | ||
'Bedfordshire': { | 'Bedfordshire': { | ||
'path': | 'path': 1 | ||
}, | }, | ||
'Berkshire': { | 'Berkshire': { | ||
'path': | 'path': 2 | ||
}, | }, | ||
'Buckinghamshire': { | 'Buckinghamshire': { | ||
'path': | 'path': 3 | ||
}, | }, | ||
'Cambridgeshire': { | 'Cambridgeshire': { | ||
'path': | 'path': 4 | ||
}, | }, | ||
'Cheshire': { | 'Cheshire': { | ||
'path': | 'path': 5 | ||
}, | }, | ||
'Cornwall': { | 'Cornwall': { | ||
'path': | 'path': 6 | ||
}, | }, | ||
'Cumberland': { | 'Cumberland': { | ||
Line 51: | Line 51: | ||
}, | }, | ||
'Derbyshire': { | 'Derbyshire': { | ||
'path': | 'path': 7 | ||
}, | }, | ||
'Devon': { | 'Devon': { | ||
'path': | 'path': 8 | ||
}, | }, | ||
'Dorset': { | 'Dorset': { | ||
'path': | 'path': 9 | ||
}, | }, | ||
'Durham': { | 'Durham': { | ||
'path': | 'path': 10 | ||
}, | }, | ||
'Essex': { | 'Essex': { | ||
'path': | 'path': 11 | ||
}, | }, | ||
'Gloucestershire': { | 'Gloucestershire': { | ||
'path': | 'path': 12 | ||
}, | }, | ||
'Hampshire': { | 'Hampshire': { | ||
'path': | 'path': 13 | ||
}, | }, | ||
'Herefordshire': { | 'Herefordshire': { | ||
'path': | 'path': 14 | ||
}, | }, | ||
'Hertfordshire': { | 'Hertfordshire': { | ||
'path': | 'path': 15 | ||
}, | }, | ||
'Huntingdonshire': { | 'Huntingdonshire': { | ||
'path': | 'path': 16 | ||
}, | }, | ||
'Kent': { | 'Kent': { | ||
'path': | 'path': 17 | ||
}, | }, | ||
'Lancashire': { | 'Lancashire': { | ||
'path': | 'path': 18 | ||
}, | }, | ||
'Leicestershire': { | 'Leicestershire': { | ||
'path': | 'path': 19 | ||
}, | }, | ||
'Lincolnshire': { | 'Lincolnshire': { | ||
'path': | 'path': 20 | ||
}, | }, | ||
'Middlesex': { | 'Middlesex': { | ||
'path': | 'path': 21 | ||
}, | }, | ||
'Norfolk': { | 'Norfolk': { | ||
'path': | 'path': 22 | ||
}, | }, | ||
'Northamptonshire': { | 'Northamptonshire': { | ||
'path': | 'path': 23 | ||
}, | }, | ||
'Northumberland': { | 'Northumberland': { | ||
'path': | 'path': 24 | ||
}, | }, | ||
'Nottinghamshire': { | 'Nottinghamshire': { | ||
'path': | 'path': 25 | ||
}, | }, | ||
'Oxfordshire': { | 'Oxfordshire': { | ||
'path': | 'path': 38 | ||
}, | }, | ||
'Rutland': { | 'Rutland': { | ||
'path': | 'path': 26 | ||
}, | }, | ||
'Shropshire': { | 'Shropshire': { | ||
'path': | 'path': 27 | ||
}, | }, | ||
'Somerset': { | 'Somerset': { | ||
'path': | 'path': 28 | ||
}, | }, | ||
'Staffordshire': { | 'Staffordshire': { | ||
'path': | 'path': 29 | ||
}, | }, | ||
'Suffolk': { | 'Suffolk': { | ||
'path': | 'path': 30 | ||
}, | }, | ||
'Surrey': { | 'Surrey': { | ||
'path': | 'path': 31 | ||
}, | }, | ||
'Sussex': { | 'Sussex': { | ||
'path': | 'path': 32 | ||
}, | }, | ||
'Warwickshire': { | 'Warwickshire': { | ||
'path': | 'path': 33 | ||
}, | }, | ||
'Westmorland': { | 'Westmorland': { | ||
'path': | 'path': 34 | ||
}, | }, | ||
'Wiltshire': { | 'Wiltshire': { | ||
'path': | 'path': 35 | ||
}, | }, | ||
'Worcestershire': { | 'Worcestershire': { | ||
'path': | 'path': 36 | ||
}, | }, | ||
'Yorkshire': { | 'Yorkshire': { | ||
'path': | 'path': 37 | ||
} | } | ||
}; | }; | ||
Line 167: | Line 167: | ||
d.calcStats = function() { | d.calcStats = function() { | ||
var url = "https://www.irhb.org/wiki/api.php?action=ask&query=[[Concept:English%20counties%20with%20place-names]]|?Area|?Population&format=json"; | var url = "https://www.irhb.org/wiki/api.php?action=ask&query=[[Concept:English%20counties%20with%20place-names]]|?Area|?Population&format=json"; | ||
fetch(url).then(res => res.json()).then((jsnCty) => { | fetch(url).then(res => res.json()).then((jsnCty) => { | ||
calcCounties(jsnCty); | calcCounties(jsnCty); | ||
url = "https://www.irhb.org/wiki/api.php?action=ask&query=[[Concept:English%20place-names]]|?Pntype|?Pnadmdiv|sort=Pnadmdiv&format=json"; | url = "https://www.irhb.org/wiki/api.php?action=ask&query=[[Concept:English%20place-names]]|?Pntype|?Pnadmdiv|sort=Pnadmdiv&format=json"; | ||
fetch(url).then(res => res.json()).then((jsnPN) => { | fetch(url).then(res => res.json()).then((jsnPN) => { | ||
calcPlaceNames(jsnPN); | calcPlaceNames(jsnPN); | ||
console.log(d.counties); | console.log(d.counties); | ||
Line 202: | Line 198: | ||
var paths = u.get("choroMap").firstChild.firstChild.getElementsByTagName("path"); | var paths = u.get("choroMap").firstChild.firstChild.getElementsByTagName("path"); | ||
paths[d.counties.Cumberland.path].style.fill = "#000000"; | paths[d.counties.Cumberland.path].style.fill = "#000000"; | ||
d.calcStats(); | d.calcStats(); | ||
}; | }; |
Revision as of 17:13, 17 May 2019
This widget displays the navigation map on country and administrative division landing pages in the place-names section of IRHB. It takes no parameters.