diff --git a/data/presets.yaml b/data/presets.yaml index 0a1738669..0513a6081 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -1041,6 +1041,15 @@ en: label: Power Output # plant/output/electricity field placeholder placeholder: '500 MW, 1000 MW, 2000 MW...' + playground/baby: + # baby=* + label: Baby Seat + playground/max_age: + # max_age=* + label: Maximum Age + playground/min_age: + # max_age=* + label: Minimum Age population: # population=* label: Population @@ -3962,6 +3971,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..178323b75 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -1383,6 +1383,21 @@ "label": "Power Output", "placeholder": "500 MW, 1000 MW, 2000 MW..." }, + "playground/baby": { + "key": "baby", + "type": "check", + "label": "Baby Seat" + }, + "playground/max_age": { + "key": "max_age", + "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/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/fields/playground/max_age.json b/data/presets/fields/playground/max_age.json new file mode 100644 index 000000000..53b0e9fe0 --- /dev/null +++ b/data/presets/fields/playground/max_age.json @@ -0,0 +1,5 @@ +{ + "key": "max_age", + "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 fa8cddbd6..937fae801 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -9492,6 +9492,14 @@ }, "leisure/playground": { "icon": "playground", + "fields": [ + "name", + "operator", + "surface", + "playground/max_age", + "playground/min_age", + "access_simple" + ], "geometry": [ "point", "area" @@ -11476,6 +11484,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": "playground", + "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" @@ -56168,6 +56340,14 @@ "point", "area" ], + "fields": [ + "name", + "operator", + "surface", + "playground/max_age", + "playground/min_age", + "access_simple" + ], "suggestion": true }, "leisure/playground/놀이터": { @@ -56181,6 +56361,14 @@ "point", "area" ], + "fields": [ + "name", + "operator", + "surface", + "playground/max_age", + "playground/min_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..7999c6051 100644 --- a/data/presets/presets/leisure/playground.json +++ b/data/presets/presets/leisure/playground.json @@ -1,5 +1,13 @@ { "icon": "playground", + "fields": [ + "name", + "operator", + "surface", + "playground/max_age", + "playground/min_age", + "access_simple" + ], "geometry": [ "point", "area" 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..7841138ca --- /dev/null +++ b/data/presets/presets/playground/slide.json @@ -0,0 +1,11 @@ +{ + "icon": "playground", + "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/development_server.js b/development_server.js index 694b59948..d31d66bc4 100644 --- a/development_server.js +++ b/development_server.js @@ -9,11 +9,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() { @@ -29,6 +51,7 @@ if (process.argv[2] === 'develop') { } else { build(); + makeCSS(); } diff --git a/dist/locales/en.json b/dist/locales/en.json index b3033a55e..e08defcf7 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1955,6 +1955,15 @@ "label": "Power Output", "placeholder": "500 MW, 1000 MW, 2000 MW..." }, + "playground/baby": { + "label": "Baby Seat" + }, + "playground/max_age": { + "label": "Maximum Age" + }, + "playground/min_age": { + "label": "Minimum Age" + }, "population": { "label": "Population" }, @@ -4572,6 +4581,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": "" diff --git a/modules/services/mapillary.js b/modules/services/mapillary.js index 695f9a1ed..bc0c5d425 100644 --- a/modules/services/mapillary.js +++ b/modules/services/mapillary.js @@ -1,5 +1,4 @@ /* global Mapillary:false */ -import _compact from 'lodash-es/compact'; import _filter from 'lodash-es/filter'; import _find from 'lodash-es/find'; import _flatten from 'lodash-es/flatten'; @@ -256,11 +255,31 @@ function searchLimited(psize, limit, projection, rtree) { limit = limit || 3; var partitions = partitionViewport(psize, projection); - return _flatten(_compact(_map(partitions, function(extent) { + var results; + + // 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.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 (found.length ? result.concat(found) : result); + // }, []); + // console.timeEnd('new'); + + return results; } diff --git a/package.json b/package.json index 9d8aac564..cbfc1394b 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,20 +36,21 @@ "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", "lodash": "^4.17.0", - "@mapbox/maki": "^4.0.0", + "jsonschema": "^1.1.0", "mapillary-js": "2.8.0", "minimist": "^1.2.0", "mocha": "^3.4.0",