Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tile json not caching #5

Open
jamiechong opened this issue Jun 21, 2017 · 0 comments
Open

tile json not caching #5

jamiechong opened this issue Jun 21, 2017 · 0 comments

Comments

@jamiechong
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant