hlaw / codegrid-js Goto Github PK
View Code? Open in Web Editor NEWJavascript function to query country code
License: Other
Javascript function to query country code
License: Other
I saw on worldgrid.json all the country codes, but couldn't match to any specific descriptive country list.
I'd be happy to submit a PR/Wiki page with all country names (I'm assuming it is ISO 639-1 as the data is from OpenStreepMap. Could you please confirm that this link is correct as a source?
As far as I can tell, the JSON tile files aren't being cached. You have
if ((typeof jsonCache[cellx] !== 'undefined') &&
(typeof jsonCache[cellx][celly] !== 'undefined') &&
(typeof jsonCache[cellx][celly][zoom] !== 'undefined'))
{
// Cache hit
console.log('cache hit');
handleJson (x, y, jsonCache[cellx][celly][zoom], callback);
return;
}
But I don't see this getting set with a successfully loaded json file anywhere in the source. The closes it gets is this:
handleJson (x, y, json[zoom], callback);
if (typeof jsonCache[cellx] === 'undefined') {
jsonCache[cellx] = {};
}
jsonCache[cellx][celly] = json;
This is perhaps where the bug is - maybe it needs to be
handleJson (x, y, json[zoom], callback);
if (typeof jsonCache[cellx] === 'undefined') {
jsonCache[cellx] = {};
}
if (typeof jsonCache[cellx][celly] === 'undefined') {
jsonCache[cellx][celly] = {};
}
jsonCache[cellx][celly][zoom] = json;
I can't tell if this is intentional or not. Would be great if you could review.
When you take a look on tiles folder, I realize that it misses some tiles folder such as: 2, 12, 13; when using this library and resize browser screen at some levels, it makes the wrong result for detecting country code, so I think the reason is missing tiles as I mentioned before. So can you update them or guide me how to do that.
I see the last commit was 7 months ago, but most of files were updated 3 years ago. I am wondering how up to date is this dataset.
I found GeoNames dataset to be updated daily, perhpas that could be a source?
http://download.geonames.org/export/dump/
great stuff! any chance of getting the python scripts to recreate the utf-grid tile data?
readme suggest it's at http://github.com/hlaw/codegrid
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.