mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
committed by
Kushan Joshi
parent
ddbc9df113
commit
2d583a9400
@@ -1,7 +1,5 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "4"
|
||||
- "6"
|
||||
- "8"
|
||||
sudo: required
|
||||
before_script:
|
||||
|
||||
42
.yarnclean
Normal file
42
.yarnclean
Normal file
@@ -0,0 +1,42 @@
|
||||
# test directories
|
||||
__tests__
|
||||
test
|
||||
tests
|
||||
powered-test
|
||||
|
||||
# asset directories
|
||||
docs
|
||||
doc
|
||||
website
|
||||
images
|
||||
assets
|
||||
|
||||
# examples
|
||||
example
|
||||
examples
|
||||
|
||||
# code coverage directories
|
||||
coverage
|
||||
.nyc_output
|
||||
|
||||
# build scripts
|
||||
Makefile
|
||||
Gulpfile.js
|
||||
Gruntfile.js
|
||||
|
||||
# configs
|
||||
.tern-project
|
||||
.gitattributes
|
||||
.editorconfig
|
||||
.*ignore
|
||||
.eslintrc
|
||||
.jshintrc
|
||||
.flowconfig
|
||||
.documentup.json
|
||||
.yarn-metadata.json
|
||||
.*.yml
|
||||
*.yml
|
||||
|
||||
# misc
|
||||
*.gz
|
||||
*.md
|
||||
2
build.js
2
build.js
@@ -70,7 +70,7 @@ var imagery = YAML.load(fs.readFileSync('node_modules/editor-layer-index/i18n/en
|
||||
var en = _.merge(core, { en: { presets: tstrings }}, imagery);
|
||||
fs.writeFileSync('dist/locales/en.json', JSON.stringify(en, null, 4));
|
||||
|
||||
process.exit();
|
||||
// process.exit();
|
||||
|
||||
|
||||
function read(f) {
|
||||
|
||||
@@ -36,6 +36,13 @@ if (isDevelopment) {
|
||||
});
|
||||
});
|
||||
|
||||
// gaze(['data/**/*.{js,json}'], function(err, watcher) {
|
||||
// watcher.on('all', function() {
|
||||
// build();
|
||||
// });
|
||||
// });
|
||||
|
||||
|
||||
gaze(['modules/**/*.js', 'data/**/*.{js,json}'], function(err, watcher) {
|
||||
watcher.on('all', function() {
|
||||
build();
|
||||
|
||||
@@ -236,32 +236,31 @@ function searchLimited(psize, limit, projection, rtree) {
|
||||
limit = limit || 3;
|
||||
|
||||
var partitions = partitionViewport(psize, projection);
|
||||
console.time('previous');
|
||||
var results;
|
||||
|
||||
var x = _.flatten(_.map(partitions, function(extent) {
|
||||
// console.time('previous');
|
||||
results = _.flatten(_.map(partitions, function(extent) {
|
||||
return rtree.search(extent.bbox())
|
||||
.slice(0, limit)
|
||||
.map(function(d) { return d.data; });
|
||||
}));
|
||||
console.timeEnd('previous');
|
||||
// console.timeEnd('previous');
|
||||
|
||||
console.time('new');
|
||||
var a = partitions.reduce(function(prev, curr) {
|
||||
var searchResult = rtree.search(curr.bbox());
|
||||
// searchResult will always be an array
|
||||
if (searchResult.length === 0) return prev;
|
||||
// console.time('new');
|
||||
// results = partitions.reduce(function(result, extent) {
|
||||
// var found = rtree.search(extent.bbox())
|
||||
// .map(function(d) { return d.data; })
|
||||
// .sort(function(a, b) {
|
||||
// return a.loc[1] - b.loc[1];
|
||||
// // return a.key.localeCompare(b.key);
|
||||
// })
|
||||
// .slice(0, limit);
|
||||
|
||||
return prev.concat(searchResult
|
||||
.slice(0, limit)
|
||||
.map(function(d) {
|
||||
return d.data;
|
||||
})
|
||||
.sort(function(a, b) {
|
||||
return a.key.localeCompare(b.key);
|
||||
}));
|
||||
}, []);
|
||||
console.timeEnd('new');
|
||||
return a;
|
||||
// return (found.length ? result.concat(found) : result);
|
||||
// }, []);
|
||||
// console.timeEnd('new');
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user