From 2079fb4f9eed2d9c14a4b0ff0f1e9247fe10ff63 Mon Sep 17 00:00:00 2001 From: JamesKingdom Date: Sun, 24 Sep 2017 19:30:41 +0100 Subject: [PATCH 1/7] Adding playground presets --- data/presets.yaml | 61 +++++++ data/presets/fields.json | 5 + data/presets/fields/playground/baby.json | 5 + data/presets/presets.json | 164 ++++++++++++++++++ .../presets/playground/balance_beam.json | 11 ++ .../presets/playground/basket_spinner.json | 13 ++ .../presets/playground/basket_swing.json | 10 ++ .../presets/playground/climbing_frame.json | 11 ++ data/presets/presets/playground/cushion.json | 11 ++ .../presets/playground/horizontal_bar.json | 16 ++ data/presets/presets/playground/rocker.json | 10 ++ .../presets/playground/roundabout.json | 14 ++ data/presets/presets/playground/sandpit.json | 11 ++ data/presets/presets/playground/seesaw.json | 10 ++ data/presets/presets/playground/slide.json | 11 ++ .../presets/presets/playground/structure.json | 11 ++ data/presets/presets/playground/swing.json | 14 ++ data/presets/presets/playground/zipwire.json | 11 ++ data/taginfo.json | 56 ++++++ dist/locales/en.json | 59 +++++++ 20 files changed, 514 insertions(+) create mode 100644 data/presets/fields/playground/baby.json create mode 100644 data/presets/presets/playground/balance_beam.json create mode 100644 data/presets/presets/playground/basket_spinner.json create mode 100644 data/presets/presets/playground/basket_swing.json create mode 100644 data/presets/presets/playground/climbing_frame.json create mode 100644 data/presets/presets/playground/cushion.json create mode 100644 data/presets/presets/playground/horizontal_bar.json create mode 100644 data/presets/presets/playground/rocker.json create mode 100644 data/presets/presets/playground/roundabout.json create mode 100644 data/presets/presets/playground/sandpit.json create mode 100644 data/presets/presets/playground/seesaw.json create mode 100644 data/presets/presets/playground/slide.json create mode 100644 data/presets/presets/playground/structure.json create mode 100644 data/presets/presets/playground/swing.json create mode 100644 data/presets/presets/playground/zipwire.json diff --git a/data/presets.yaml b/data/presets.yaml index 0a1738669..aedc0fba6 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -1041,6 +1041,9 @@ en: label: Power Output # plant/output/electricity field placeholder placeholder: '500 MW, 1000 MW, 2000 MW...' + playground/baby: + # baby=* + label: Baby Seat population: # population=* label: Population @@ -3962,6 +3965,64 @@ en: # place=village name: Village terms: '' + playground/balance_beam: + # playground=balancebeam + name: Balance Beam + terms: '' + playground/basket_spinner: + # playground=basketrotator + name: Basket Spinner + # 'terms: basket rotator' + terms: '' + playground/basket_swing: + # playground=basketswing + name: Basket Swing + terms: '' + playground/climbing_frame: + # playground=climbingframe + name: Climbing Frame + terms: '' + playground/cushion: + # playground=cushion + name: Bouncy Cushion + terms: '' + playground/horizontal_bar: + # playground=horizontal_bar + name: Horizontal Bar + # 'terms: high bar' + terms: '' + playground/rocker: + # playground=springy + name: Springy Rocker + terms: '' + playground/roundabout: + # playground=roundabout + name: Play Roundabout + terms: '' + playground/sandpit: + # playground=sandpit + name: Sandpit + terms: '' + playground/seesaw: + # playground=seesaw + name: Seesaw + terms: '' + playground/slide: + # playground=slide + name: Slide + terms: '' + playground/structure: + # playground=structure + name: Play Structure + terms: '' + playground/swing: + # playground=swing + name: Swing + terms: '' + playground/zipwire: + # playground=zipwire + name: Zip Wire + terms: '' point: name: Point terms: '' diff --git a/data/presets/fields.json b/data/presets/fields.json index fdd38b0ed..937528856 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -1383,6 +1383,11 @@ "label": "Power Output", "placeholder": "500 MW, 1000 MW, 2000 MW..." }, + "playground/baby": { + "key": "baby", + "type": "check", + "label": "Baby Seat" + }, "population": { "key": "population", "type": "text", diff --git a/data/presets/fields/playground/baby.json b/data/presets/fields/playground/baby.json new file mode 100644 index 000000000..8af537ab2 --- /dev/null +++ b/data/presets/fields/playground/baby.json @@ -0,0 +1,5 @@ +{ + "key": "baby", + "type": "check", + "label": "Baby Seat" +} \ No newline at end of file diff --git a/data/presets/presets.json b/data/presets/presets.json index fa8cddbd6..83ac0ea53 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -11476,6 +11476,170 @@ }, "name": "Village" }, + "playground/balance_beam": { + "icon": "playground", + "geometry": [ + "point", + "line" + ], + "tags": { + "playground": "balancebeam" + }, + "name": "Balance Beam" + }, + "playground/basket_spinner": { + "icon": "playground", + "geometry": [ + "point" + ], + "terms": [ + "basket rotator" + ], + "tags": { + "playground": "basketrotator" + }, + "name": "Basket Spinner" + }, + "playground/basket_swing": { + "icon": "playground", + "geometry": [ + "point" + ], + "tags": { + "playground": "basketswing" + }, + "name": "Basket Swing" + }, + "playground/climbing_frame": { + "icon": "playground", + "geometry": [ + "point", + "area" + ], + "tags": { + "playground": "climbingframe" + }, + "name": "Climbing Frame" + }, + "playground/cushion": { + "icon": "playground", + "geometry": [ + "point", + "area" + ], + "tags": { + "playground": "cushion" + }, + "name": "Bouncy Cushion" + }, + "playground/horizontal_bar": { + "icon": "pitch", + "fields": [ + "height" + ], + "geometry": [ + "point" + ], + "terms": [ + "high bar" + ], + "tags": { + "playground": "horizontal_bar" + }, + "name": "Horizontal Bar" + }, + "playground/rocker": { + "icon": "playground", + "geometry": [ + "point" + ], + "tags": { + "playground": "springy" + }, + "name": "Springy Rocker" + }, + "playground/roundabout": { + "icon": "stadium", + "fields": [ + "bench" + ], + "geometry": [ + "point", + "area" + ], + "tags": { + "playground": "roundabout" + }, + "name": "Play Roundabout" + }, + "playground/sandpit": { + "icon": "playground", + "geometry": [ + "point", + "area" + ], + "tags": { + "playground": "sandpit" + }, + "name": "Sandpit" + }, + "playground/seesaw": { + "icon": "playground", + "geometry": [ + "point" + ], + "tags": { + "playground": "seesaw" + }, + "name": "Seesaw" + }, + "playground/slide": { + "icon": "entrance", + "geometry": [ + "point", + "line" + ], + "tags": { + "playground": "slide" + }, + "name": "Slide" + }, + "playground/structure": { + "icon": "pitch", + "geometry": [ + "point", + "area" + ], + "tags": { + "playground": "structure" + }, + "name": "Play Structure" + }, + "playground/swing": { + "icon": "playground", + "fields": [ + "playground/baby", + "wheelchair" + ], + "geometry": [ + "point" + ], + "tags": { + "playground": "swing" + }, + "name": "Swing" + }, + "playground/zipwire": { + "icon": "playground", + "geometry": [ + "point", + "line" + ], + "tags": { + "playground": "zipwire" + }, + "name": "Zip Wire" + }, "point": { "fields": [ "name" diff --git a/data/presets/presets/playground/balance_beam.json b/data/presets/presets/playground/balance_beam.json new file mode 100644 index 000000000..bacccbc0c --- /dev/null +++ b/data/presets/presets/playground/balance_beam.json @@ -0,0 +1,11 @@ +{ + "icon": "playground", + "geometry": [ + "point", + "line" + ], + "tags": { + "playground": "balancebeam" + }, + "name": "Balance Beam" +} diff --git a/data/presets/presets/playground/basket_spinner.json b/data/presets/presets/playground/basket_spinner.json new file mode 100644 index 000000000..5ecbab992 --- /dev/null +++ b/data/presets/presets/playground/basket_spinner.json @@ -0,0 +1,13 @@ +{ + "icon": "playground", + "geometry": [ + "point" + ], + "terms": [ + "basket rotator" + ], + "tags": { + "playground": "basketrotator" + }, + "name": "Basket Spinner" +} diff --git a/data/presets/presets/playground/basket_swing.json b/data/presets/presets/playground/basket_swing.json new file mode 100644 index 000000000..92dfdcfd0 --- /dev/null +++ b/data/presets/presets/playground/basket_swing.json @@ -0,0 +1,10 @@ +{ + "icon": "playground", + "geometry": [ + "point" + ], + "tags": { + "playground": "basketswing" + }, + "name": "Basket Swing" +} diff --git a/data/presets/presets/playground/climbing_frame.json b/data/presets/presets/playground/climbing_frame.json new file mode 100644 index 000000000..274c3af02 --- /dev/null +++ b/data/presets/presets/playground/climbing_frame.json @@ -0,0 +1,11 @@ +{ + "icon": "playground", + "geometry": [ + "point", + "area" + ], + "tags": { + "playground": "climbingframe" + }, + "name": "Climbing Frame" +} diff --git a/data/presets/presets/playground/cushion.json b/data/presets/presets/playground/cushion.json new file mode 100644 index 000000000..120519c94 --- /dev/null +++ b/data/presets/presets/playground/cushion.json @@ -0,0 +1,11 @@ +{ + "icon": "playground", + "geometry": [ + "point", + "area" + ], + "tags": { + "playground": "cushion" + }, + "name": "Bouncy Cushion" +} diff --git a/data/presets/presets/playground/horizontal_bar.json b/data/presets/presets/playground/horizontal_bar.json new file mode 100644 index 000000000..c481674c6 --- /dev/null +++ b/data/presets/presets/playground/horizontal_bar.json @@ -0,0 +1,16 @@ +{ + "icon": "pitch", + "fields": [ + "height" + ], + "geometry": [ + "point" + ], + "terms": [ + "high bar" + ], + "tags": { + "playground": "horizontal_bar" + }, + "name": "Horizontal Bar" +} diff --git a/data/presets/presets/playground/rocker.json b/data/presets/presets/playground/rocker.json new file mode 100644 index 000000000..9a677c034 --- /dev/null +++ b/data/presets/presets/playground/rocker.json @@ -0,0 +1,10 @@ +{ + "icon": "playground", + "geometry": [ + "point" + ], + "tags": { + "playground": "springy" + }, + "name": "Springy Rocker" +} diff --git a/data/presets/presets/playground/roundabout.json b/data/presets/presets/playground/roundabout.json new file mode 100644 index 000000000..11a002bf7 --- /dev/null +++ b/data/presets/presets/playground/roundabout.json @@ -0,0 +1,14 @@ +{ + "icon": "stadium", + "fields": [ + "bench" + ], + "geometry": [ + "point", + "area" + ], + "tags": { + "playground": "roundabout" + }, + "name": "Play Roundabout" +} diff --git a/data/presets/presets/playground/sandpit.json b/data/presets/presets/playground/sandpit.json new file mode 100644 index 000000000..3bc438afd --- /dev/null +++ b/data/presets/presets/playground/sandpit.json @@ -0,0 +1,11 @@ +{ + "icon": "playground", + "geometry": [ + "point", + "area" + ], + "tags": { + "playground": "sandpit" + }, + "name": "Sandpit" +} diff --git a/data/presets/presets/playground/seesaw.json b/data/presets/presets/playground/seesaw.json new file mode 100644 index 000000000..e0ce124b1 --- /dev/null +++ b/data/presets/presets/playground/seesaw.json @@ -0,0 +1,10 @@ +{ + "icon": "playground", + "geometry": [ + "point" + ], + "tags": { + "playground": "seesaw" + }, + "name": "Seesaw" +} diff --git a/data/presets/presets/playground/slide.json b/data/presets/presets/playground/slide.json new file mode 100644 index 000000000..4a5c30f59 --- /dev/null +++ b/data/presets/presets/playground/slide.json @@ -0,0 +1,11 @@ +{ + "icon": "entrance", + "geometry": [ + "point", + "line" + ], + "tags": { + "playground": "slide" + }, + "name": "Slide" +} diff --git a/data/presets/presets/playground/structure.json b/data/presets/presets/playground/structure.json new file mode 100644 index 000000000..bbd6e2b0c --- /dev/null +++ b/data/presets/presets/playground/structure.json @@ -0,0 +1,11 @@ +{ + "icon": "pitch", + "geometry": [ + "point", + "area" + ], + "tags": { + "playground": "structure" + }, + "name": "Play Structure" +} diff --git a/data/presets/presets/playground/swing.json b/data/presets/presets/playground/swing.json new file mode 100644 index 000000000..5f66d0428 --- /dev/null +++ b/data/presets/presets/playground/swing.json @@ -0,0 +1,14 @@ +{ + "icon": "playground", + "fields": [ + "playground/baby", + "wheelchair" + ], + "geometry": [ + "point" + ], + "tags": { + "playground": "swing" + }, + "name": "Swing" +} diff --git a/data/presets/presets/playground/zipwire.json b/data/presets/presets/playground/zipwire.json new file mode 100644 index 000000000..e3a9460db --- /dev/null +++ b/data/presets/presets/playground/zipwire.json @@ -0,0 +1,11 @@ +{ + "icon": "playground", + "geometry": [ + "point", + "line" + ], + "tags": { + "playground": "zipwire" + }, + "name": "Zip Wire" +} diff --git a/data/taginfo.json b/data/taginfo.json index 4b32bc5ae..e98af836f 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -2220,6 +2220,62 @@ "key": "place", "value": "village" }, + { + "key": "playground", + "value": "balancebeam" + }, + { + "key": "playground", + "value": "basketrotator" + }, + { + "key": "playground", + "value": "basketswing" + }, + { + "key": "playground", + "value": "climbingframe" + }, + { + "key": "playground", + "value": "cushion" + }, + { + "key": "playground", + "value": "horizontal_bar" + }, + { + "key": "playground", + "value": "springy" + }, + { + "key": "playground", + "value": "roundabout" + }, + { + "key": "playground", + "value": "sandpit" + }, + { + "key": "playground", + "value": "seesaw" + }, + { + "key": "playground", + "value": "slide" + }, + { + "key": "playground", + "value": "structure" + }, + { + "key": "playground", + "value": "swing" + }, + { + "key": "playground", + "value": "zipwire" + }, { "key": "power", "value": "sub_station" diff --git a/dist/locales/en.json b/dist/locales/en.json index b3033a55e..29f040329 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1955,6 +1955,9 @@ "label": "Power Output", "placeholder": "500 MW, 1000 MW, 2000 MW..." }, + "playground/baby": { + "label": "Baby Seat" + }, "population": { "label": "Population" }, @@ -4572,6 +4575,62 @@ "name": "Village", "terms": "" }, + "playground/balance_beam": { + "name": "Balance Beam", + "terms": "" + }, + "playground/basket_spinner": { + "name": "Basket Spinner", + "terms": "basket rotator" + }, + "playground/basket_swing": { + "name": "Basket Swing", + "terms": "" + }, + "playground/climbing_frame": { + "name": "Climbing Frame", + "terms": "" + }, + "playground/cushion": { + "name": "Bouncy Cushion", + "terms": "" + }, + "playground/horizontal_bar": { + "name": "Horizontal Bar", + "terms": "high bar" + }, + "playground/rocker": { + "name": "Springy Rocker", + "terms": "" + }, + "playground/roundabout": { + "name": "Play Roundabout", + "terms": "" + }, + "playground/sandpit": { + "name": "Sandpit", + "terms": "" + }, + "playground/seesaw": { + "name": "Seesaw", + "terms": "" + }, + "playground/slide": { + "name": "Slide", + "terms": "" + }, + "playground/structure": { + "name": "Play Structure", + "terms": "" + }, + "playground/swing": { + "name": "Swing", + "terms": "" + }, + "playground/zipwire": { + "name": "Zip Wire", + "terms": "" + }, "point": { "name": "Point", "terms": "" From be0853798e3c1bd69ce8580cfc89bdb4df0a91ee Mon Sep 17 00:00:00 2001 From: JamesKingdom Date: Sun, 24 Sep 2017 21:25:01 +0100 Subject: [PATCH 2/7] Adding some more fields to playground --- data/presets.yaml | 3 +++ data/presets/fields.json | 5 +++++ data/presets/fields/playground/max_age.json | 5 +++++ data/presets/presets.json | 21 ++++++++++++++++++++ data/presets/presets/leisure/playground.json | 7 +++++++ dist/locales/en.json | 3 +++ 6 files changed, 44 insertions(+) create mode 100644 data/presets/fields/playground/max_age.json diff --git a/data/presets.yaml b/data/presets.yaml index aedc0fba6..d7f5ac87d 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -1044,6 +1044,9 @@ en: playground/baby: # baby=* label: Baby Seat + playground/max_age: + # max_age=* + label: Maximum Age population: # population=* label: Population diff --git a/data/presets/fields.json b/data/presets/fields.json index 937528856..3361a0ee4 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -1388,6 +1388,11 @@ "type": "check", "label": "Baby Seat" }, + "playground/max_age": { + "key": "max_age", + "type": "text", + "label": "Maximum Age" + }, "population": { "key": "population", "type": "text", diff --git a/data/presets/fields/playground/max_age.json b/data/presets/fields/playground/max_age.json new file mode 100644 index 000000000..9b02f30f8 --- /dev/null +++ b/data/presets/fields/playground/max_age.json @@ -0,0 +1,5 @@ +{ + "key": "max_age", + "type": "text", + "label": "Maximum Age" +} diff --git a/data/presets/presets.json b/data/presets/presets.json index 83ac0ea53..68fe3a94d 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -9492,6 +9492,13 @@ }, "leisure/playground": { "icon": "playground", + "fields": [ + "name", + "operator", + "surface", + "playground/max_age", + "access_simple" + ], "geometry": [ "point", "area" @@ -56332,6 +56339,13 @@ "point", "area" ], + "fields": [ + "name", + "operator", + "surface", + "playground/max_age", + "access_simple" + ], "suggestion": true }, "leisure/playground/놀이터": { @@ -56345,6 +56359,13 @@ "point", "area" ], + "fields": [ + "name", + "operator", + "surface", + "playground/max_age", + "access_simple" + ], "suggestion": true }, "leisure/sports_centre/Anytime Fitness": { diff --git a/data/presets/presets/leisure/playground.json b/data/presets/presets/leisure/playground.json index d1d19f4de..bc10d7ceb 100644 --- a/data/presets/presets/leisure/playground.json +++ b/data/presets/presets/leisure/playground.json @@ -1,5 +1,12 @@ { "icon": "playground", + "fields": [ + "name", + "operator", + "surface", + "playground/max_age", + "access_simple" + ], "geometry": [ "point", "area" diff --git a/dist/locales/en.json b/dist/locales/en.json index 29f040329..4a7262499 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1958,6 +1958,9 @@ "playground/baby": { "label": "Baby Seat" }, + "playground/max_age": { + "label": "Maximum Age" + }, "population": { "label": "Population" }, From 24fef3cbac73067b431c3c8b5656d771ef835521 Mon Sep 17 00:00:00 2001 From: Kushan Joshi <0o3ko0@gmail.com> Date: Thu, 21 Sep 2017 17:53:25 +0530 Subject: [PATCH 3/7] build css in development --- development_server.js | 25 ++++++++++++++++++++++++- package.json | 8 ++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/development_server.js b/development_server.js index be608cac0..45a9613ea 100644 --- a/development_server.js +++ b/development_server.js @@ -8,11 +8,33 @@ var json = require('rollup-plugin-json'); var http = require('http'); var gaze = require('gaze'); var ecstatic = require('ecstatic'); +var glob = require('glob'); +var concat = require('concat-files'); + +function makeCSS() { + glob('css/**/*.css', function (er, files) { + if (er) console.error(er); + concat(files, 'dist/iD.css', function (err) { + if (err) console.error(err); + console.log('css built'); + }); + }); +} var building = false; var cache; -if (process.argv[2] === 'develop') { + +var isDevelopment = process.argv[2] === 'develop'; + +if (isDevelopment) { build(); + makeCSS(); + + gaze(['css/**/*.css'], function(err, watcher) { + watcher.on('all', function() { + makeCSS(); + }); + }); gaze(['modules/**/*.js', 'data/**/*.{js,json}'], function(err, watcher) { watcher.on('all', function() { @@ -28,6 +50,7 @@ if (process.argv[2] === 'develop') { } else { build(); + makeCSS(); } diff --git a/package.json b/package.json index c1a2f1993..77bb1c71c 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "build": "node build.js && node development_server.js", "clean": "shx rm -f dist/*.js dist/*.map dist/*.css dist/img/*.svg", "dist": "npm-run-all -p dist:**", - "dist:css": "shx cat css/*.css > dist/iD.css", "dist:mapillary": "shx mkdir -p dist/mapillary-js && shx cp -R node_modules/mapillary-js/dist/* dist/mapillary-js/", "dist:min": "uglifyjs dist/iD.js -c warnings=false -m -o dist/iD.min.js", "dist:svg:maki": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/maki-sprite.svg node_modules/@mapbox/maki/icons/*.svg", @@ -37,19 +36,20 @@ "wmf-sitematrix": "0.1.4" }, "devDependencies": { + "@mapbox/maki": "^4.0.0", "brfs": "1.4.3", "chai": "^4.1.0", + "concat-files": "^0.1.1", "d3": "4.10.2", "ecstatic": "^3.0.0", "editor-layer-index": "osmlab/editor-layer-index.git#gh-pages", - "gaze": "^1.1.1", "eslint": "^4.3.0", + "gaze": "^1.1.1", "glob": "^7.1.0", "happen": "^0.3.1", "js-yaml": "^3.9.0", - "jsonschema": "^1.1.0", "json-stable-stringify": "^1.0.1", - "@mapbox/maki": "^4.0.0", + "jsonschema": "^1.1.0", "mapillary-js": "2.8.0", "minimist": "^1.2.0", "mocha": "^3.4.0", From ddbc9df11339a218728d419229d0f2bd88a1fdac Mon Sep 17 00:00:00 2001 From: Kushan Joshi <0o3ko0@gmail.com> Date: Mon, 25 Sep 2017 18:20:30 +0530 Subject: [PATCH 4/7] =?UTF-8?q?Sort=20mapillary=E2=80=99s=20rbush=20result?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/services/mapillary.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/modules/services/mapillary.js b/modules/services/mapillary.js index 514e9d771..b5282c487 100644 --- a/modules/services/mapillary.js +++ b/modules/services/mapillary.js @@ -236,11 +236,32 @@ function searchLimited(psize, limit, projection, rtree) { limit = limit || 3; var partitions = partitionViewport(psize, projection); - return _.flatten(_.compact(_.map(partitions, function(extent) { + console.time('previous'); + + var x = _.flatten(_.map(partitions, function(extent) { return rtree.search(extent.bbox()) .slice(0, limit) .map(function(d) { return d.data; }); - }))); + })); + 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; + + 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; } From bf3fbd21d132961ac5bb714d4aaee801c8bea3dc Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 25 Sep 2017 11:56:50 -0400 Subject: [PATCH 5/7] Comment out debugging code from #4376 --- modules/services/mapillary.js | 37 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/modules/services/mapillary.js b/modules/services/mapillary.js index b5282c487..451cac575 100644 --- a/modules/services/mapillary.js +++ b/modules/services/mapillary.js @@ -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; } From 7748a2889d0dfa1bdce3c74dccbca367d8e09c5a Mon Sep 17 00:00:00 2001 From: JamesKingdom Date: Mon, 25 Sep 2017 17:52:44 +0100 Subject: [PATCH 6/7] Update slide icon --- data/presets/presets/playground/slide.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/presets/presets/playground/slide.json b/data/presets/presets/playground/slide.json index 4a5c30f59..7841138ca 100644 --- a/data/presets/presets/playground/slide.json +++ b/data/presets/presets/playground/slide.json @@ -1,5 +1,5 @@ { - "icon": "entrance", + "icon": "playground", "geometry": [ "point", "line" From fef0e8000c725cc772d167931d540d38ccd2f17c Mon Sep 17 00:00:00 2001 From: JamesKingdom Date: Mon, 25 Sep 2017 17:55:52 +0100 Subject: [PATCH 7/7] Update min+max age fields --- data/presets.yaml | 3 +++ data/presets/fields.json | 7 ++++++- data/presets/fields/playground/max_age.json | 2 +- data/presets/fields/playground/min_age.json | 5 +++++ data/presets/presets.json | 5 ++++- data/presets/presets/leisure/playground.json | 1 + dist/locales/en.json | 3 +++ 7 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 data/presets/fields/playground/min_age.json diff --git a/data/presets.yaml b/data/presets.yaml index d7f5ac87d..0513a6081 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -1047,6 +1047,9 @@ en: playground/max_age: # max_age=* label: Maximum Age + playground/min_age: + # max_age=* + label: Minimum Age population: # population=* label: Population diff --git a/data/presets/fields.json b/data/presets/fields.json index 3361a0ee4..178323b75 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -1390,9 +1390,14 @@ }, "playground/max_age": { "key": "max_age", - "type": "text", + "type": "number", "label": "Maximum Age" }, + "playground/min_age": { + "key": "max_age", + "type": "number", + "label": "Minimum Age" + }, "population": { "key": "population", "type": "text", diff --git a/data/presets/fields/playground/max_age.json b/data/presets/fields/playground/max_age.json index 9b02f30f8..53b0e9fe0 100644 --- a/data/presets/fields/playground/max_age.json +++ b/data/presets/fields/playground/max_age.json @@ -1,5 +1,5 @@ { "key": "max_age", - "type": "text", + "type": "number", "label": "Maximum Age" } diff --git a/data/presets/fields/playground/min_age.json b/data/presets/fields/playground/min_age.json new file mode 100644 index 000000000..4616635b6 --- /dev/null +++ b/data/presets/fields/playground/min_age.json @@ -0,0 +1,5 @@ +{ + "key": "max_age", + "type": "number", + "label": "Minimum Age" +} diff --git a/data/presets/presets.json b/data/presets/presets.json index 68fe3a94d..937fae801 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -9497,6 +9497,7 @@ "operator", "surface", "playground/max_age", + "playground/min_age", "access_simple" ], "geometry": [ @@ -11601,7 +11602,7 @@ "name": "Seesaw" }, "playground/slide": { - "icon": "entrance", + "icon": "playground", "geometry": [ "point", "line" @@ -56344,6 +56345,7 @@ "operator", "surface", "playground/max_age", + "playground/min_age", "access_simple" ], "suggestion": true @@ -56364,6 +56366,7 @@ "operator", "surface", "playground/max_age", + "playground/min_age", "access_simple" ], "suggestion": true diff --git a/data/presets/presets/leisure/playground.json b/data/presets/presets/leisure/playground.json index bc10d7ceb..7999c6051 100644 --- a/data/presets/presets/leisure/playground.json +++ b/data/presets/presets/leisure/playground.json @@ -5,6 +5,7 @@ "operator", "surface", "playground/max_age", + "playground/min_age", "access_simple" ], "geometry": [ diff --git a/dist/locales/en.json b/dist/locales/en.json index 4a7262499..e08defcf7 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1961,6 +1961,9 @@ "playground/max_age": { "label": "Maximum Age" }, + "playground/min_age": { + "label": "Minimum Age" + }, "population": { "label": "Population" },