diff --git a/Makefile b/Makefile index bbec2ef2a..91d98ed2b 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ all: \ dist/iD.css \ dist/iD.js \ dist/iD.min.js \ - dist/img/line-presets.png + dist/img/line-presets.png \ + dist/img/relation-presets.png DATA_FILES = $(shell find data -type f -name '*.json' -o -name '*.md') data/data.js: $(DATA_FILES) dist/locales/en.json dist/img/maki-sprite.png @@ -82,10 +83,13 @@ clean: translations: node data/update_locales -SPRITE = inkscape --export-area-page --export-png=dist/img/line-presets.png svg/line-presets.svg +SPRITE = inkscape --export-area-page dist/img/line-presets.png: svg/line-presets.svg - if [ `which inkscape` ]; then $(SPRITE); else echo "Inkscape is not installed"; fi; + if [ `which inkscape` ]; then $(SPRITE) --export-png=$@ $<; else echo "Inkscape is not installed"; fi; + +dist/img/relation-presets.png: svg/relation-presets.svg + if [ `which inkscape` ]; then $(SPRITE) --export-png=$@ $<; else echo "Inkscape is not installed"; fi; dist/img/maki-sprite.png: $(wildcard node_modules/maki/renders/*.png) node data/maki_sprite diff --git a/css/app.css b/css/app.css index 3d5e21323..b68c2c850 100644 --- a/css/app.css +++ b/css/app.css @@ -739,7 +739,8 @@ a:hover .icon.out-link { background-position: -500px -14px;} margin: auto; } -.preset-icon-line { +.preset-icon-line, +.preset-icon-relation { top: 0; left: 0; } diff --git a/css/feature-icons.css b/css/feature-icons.css index 8f238ce63..ce8166c8b 100644 --- a/css/feature-icons.css +++ b/css/feature-icons.css @@ -2,6 +2,7 @@ .preset-icon{background-image:url(img/maki-sprite.png);background-repeat:no-repeat;width:24px;height:24px;} .preset-icon-line{background-image:url(img/line-presets.png);background-repeat:no-repeat;width:60px;height:60px;} +.preset-icon-relation{background-image:url(img/relation-presets.png);background-repeat:no-repeat;width:60px;height:60px;} .feature-airfield{background-position:-0px -34px;} .feature-airport{background-position:-0px -94px;} .feature-alcohol-shop{background-position:-0px -154px;} @@ -132,3 +133,18 @@ .preset-icon-line.feature-category-rail{background-position:-2060px -25px;} .preset-icon-line.feature-category-path{background-position:-2120px -25px;} .preset-icon-line.feature-category-water{background-position:-2180px -25px;} +.preset-icon-relation.feature-relation{background-position:-20px -25px;} +.preset-icon-relation.feature-restriction{background-position:-80px -25px;} +.preset-icon-relation.feature-multipolygon{background-position:-140px -25px;} +.preset-icon-relation.feature-boundary{background-position:-200px -25px;} +.preset-icon-relation.feature-route{background-position:-260px -25px;} +.preset-icon-relation.feature-route-road{background-position:-320px -25px;} +.preset-icon-relation.feature-route-bicycle{background-position:-380px -25px;} +.preset-icon-relation.feature-route-foot{background-position:-440px -25px;} +.preset-icon-relation.feature-route-bus{background-position:-500px -25px;} +.preset-icon-relation.feature-route-train{background-position:-560px -25px;} +.preset-icon-relation.feature-route-detour{background-position:-620px -25px;} +.preset-icon-relation.feature-route-tram{background-position:-680px -25px;} +.preset-icon-relation.feature-route-ferry{background-position:-740px -25px;} +.preset-icon-relation.feature-route-power{background-position:-800px -25px;} +.preset-icon-relation.feature-route-pipeline{background-position:-860px -25px;} diff --git a/data/feature-icons.json b/data/feature-icons.json index d4df1d4e2..72c9cf7c5 100644 --- a/data/feature-icons.json +++ b/data/feature-icons.json @@ -1 +1 @@ -{"airfield":{"12":[0,0],"18":[0,14],"24":[0,34]},"airport":{"12":[0,60],"18":[0,74],"24":[0,94]},"alcohol-shop":{"12":[0,120],"18":[0,134],"24":[0,154]},"america-football":{"12":[0,180],"18":[0,194],"24":[0,214]},"art-gallery":{"12":[0,240],"18":[0,254],"24":[0,274]},"bank":{"12":[0,300],"18":[0,314],"24":[0,334]},"bar":{"12":[0,360],"18":[0,374],"24":[0,394]},"baseball":{"12":[0,420],"18":[0,434],"24":[0,454]},"basketball":{"12":[0,480],"18":[0,494],"24":[0,514]},"beer":{"12":[0,540],"18":[0,554],"24":[0,574]},"bicycle":{"12":[0,600],"18":[0,614],"24":[0,634]},"building":{"12":[0,660],"18":[0,674],"24":[0,694]},"bus":{"12":[0,720],"18":[0,734],"24":[0,754]},"cafe":{"12":[0,780],"18":[0,794],"24":[0,814]},"campsite":{"12":[0,840],"18":[0,854],"24":[0,874]},"cemetery":{"12":[0,900],"18":[0,914],"24":[0,934]},"cinema":{"12":[0,960],"18":[0,974],"24":[0,994]},"circle":{"12":[0,1020],"18":[0,1034],"24":[0,1054]},"circle-stroked":{"12":[0,1080],"18":[0,1094],"24":[0,1114]},"city":{"12":[0,1140],"18":[0,1154],"24":[0,1174]},"college":{"12":[0,1200],"18":[0,1214],"24":[0,1234]},"commercial":{"12":[0,1260],"18":[0,1274],"24":[0,1294]},"cricket":{"12":[0,1320],"18":[0,1334],"24":[0,1354]},"cross":{"12":[0,1380],"18":[0,1394],"24":[0,1414]},"dam":{"12":[0,1440],"18":[0,1454],"24":[0,1474]},"danger":{"12":[0,1500],"18":[0,1514],"24":[0,1534]},"disability":{"12":[0,1560],"18":[0,1574],"24":[0,1594]},"embassy":{"12":[0,1620],"18":[0,1634],"24":[0,1654]},"emergency-telephone":{"12":[0,1680],"18":[0,1694],"24":[0,1714]},"farm":{"12":[0,1740],"18":[0,1754],"24":[0,1774]},"fast-food":{"12":[0,1800],"18":[0,1814],"24":[0,1834]},"ferry":{"12":[0,1860],"18":[0,1874],"24":[0,1894]},"fire-station":{"12":[0,1920],"18":[0,1934],"24":[0,1954]},"fuel":{"12":[0,1980],"18":[0,1994],"24":[0,2014]},"garden":{"12":[0,2040],"18":[0,2054],"24":[0,2074]},"golf":{"12":[0,2100],"18":[0,2114],"24":[0,2134]},"grocery":{"12":[0,2160],"18":[0,2174],"24":[0,2194]},"harbor":{"12":[0,2220],"18":[0,2234],"24":[0,2254]},"heliport":{"12":[0,2280],"18":[0,2294],"24":[0,2314]},"hospital":{"12":[0,2340],"18":[0,2354],"24":[0,2374]},"industrial":{"12":[0,2400],"18":[0,2414],"24":[0,2434]},"land-use":{"12":[0,2460],"18":[0,2474],"24":[0,2494]},"library":{"12":[0,2520],"18":[0,2534],"24":[0,2554]},"lodging":{"12":[0,2580],"18":[0,2594],"24":[0,2614]},"logging":{"12":[0,2640],"18":[0,2654],"24":[0,2674]},"marker":{"12":[0,2700],"18":[0,2714],"24":[0,2734]},"marker-stroked":{"12":[0,2760],"18":[0,2774],"24":[0,2794]},"monument":{"12":[0,2820],"18":[0,2834],"24":[0,2854]},"museum":{"12":[0,2880],"18":[0,2894],"24":[0,2914]},"music":{"12":[0,2940],"18":[0,2954],"24":[0,2974]},"oil-well":{"12":[0,3000],"18":[0,3014],"24":[0,3034]},"park":{"12":[0,3060],"18":[0,3074],"24":[0,3094]},"park2":{"12":[0,3120],"18":[0,3134],"24":[0,3154]},"parking":{"12":[0,3180],"18":[0,3194],"24":[0,3214]},"parking-garage":{"12":[0,3240],"18":[0,3254],"24":[0,3274]},"pharmacy":{"12":[0,3300],"18":[0,3314],"24":[0,3334]},"pitch":{"12":[0,3360],"18":[0,3374],"24":[0,3394]},"place-of-worship":{"12":[0,3420],"18":[0,3434],"24":[0,3454]},"police":{"12":[0,3480],"18":[0,3494],"24":[0,3514]},"post":{"12":[0,3540],"18":[0,3554],"24":[0,3574]},"prison":{"12":[0,3600],"18":[0,3614],"24":[0,3634]},"rail":{"12":[0,3660],"18":[0,3674],"24":[0,3694]},"rail-above":{"12":[0,3720],"18":[0,3734],"24":[0,3754]},"rail-underground":{"12":[0,3780],"18":[0,3794],"24":[0,3814]},"religious-christian":{"12":[0,3840],"18":[0,3854],"24":[0,3874]},"religious-jewish":{"12":[0,3900],"18":[0,3914],"24":[0,3934]},"religious-muslim":{"12":[0,3960],"18":[0,3974],"24":[0,3994]},"restaurant":{"12":[0,4020],"18":[0,4034],"24":[0,4054]},"roadblock":{"12":[0,4080],"18":[0,4094],"24":[0,4114]},"school":{"12":[0,4140],"18":[0,4154],"24":[0,4174]},"shop":{"12":[0,4200],"18":[0,4214],"24":[0,4234]},"skiing":{"12":[0,4260],"18":[0,4274],"24":[0,4294]},"slaughterhouse":{"12":[0,4320],"18":[0,4334],"24":[0,4354]},"soccer":{"12":[0,4380],"18":[0,4394],"24":[0,4414]},"square":{"12":[0,4440],"18":[0,4454],"24":[0,4474]},"square-stroked":{"12":[0,4500],"18":[0,4514],"24":[0,4534]},"star":{"12":[0,4560],"18":[0,4574],"24":[0,4594]},"star-stroked":{"12":[0,4620],"18":[0,4634],"24":[0,4654]},"swimming":{"12":[0,4680],"18":[0,4694],"24":[0,4714]},"telephone":{"12":[0,4740],"18":[0,4754],"24":[0,4774]},"tennis":{"12":[0,4800],"18":[0,4814],"24":[0,4834]},"theatre":{"12":[0,4860],"18":[0,4874],"24":[0,4894]},"toilets":{"12":[0,4920],"18":[0,4934],"24":[0,4954]},"town":{"12":[0,4980],"18":[0,4994],"24":[0,5014]},"town-hall":{"12":[0,5040],"18":[0,5054],"24":[0,5074]},"triangle":{"12":[0,5100],"18":[0,5114],"24":[0,5134]},"triangle-stroked":{"12":[0,5160],"18":[0,5174],"24":[0,5194]},"village":{"12":[0,5220],"18":[0,5234],"24":[0,5254]},"warehouse":{"12":[0,5280],"18":[0,5294],"24":[0,5314]},"waste-basket":{"12":[0,5340],"18":[0,5354],"24":[0,5374]},"water":{"12":[0,5400],"18":[0,5414],"24":[0,5434]},"wetland":{"12":[0,5460],"18":[0,5474],"24":[0,5494]},"zoo":{"12":[0,5520],"18":[0,5534],"24":[0,5554]},"highway-motorway":{"line":[20,25]},"highway-trunk":{"line":[80,25]},"highway-primary":{"line":[140,25]},"highway-secondary":{"line":[200,25]},"highway-tertiary":{"line":[260,25]},"highway-motorway-link":{"line":[320,25]},"highway-trunk-link":{"line":[380,25]},"highway-primary-link":{"line":[440,25]},"highway-secondary-link":{"line":[500,25]},"highway-tertiary-link":{"line":[560,25]},"highway-residential":{"line":[620,25]},"highway-unclassified":{"line":[680,25]},"highway-service":{"line":[740,25]},"highway-road":{"line":[800,25]},"highway-track":{"line":[860,25]},"highway-living-street":{"line":[920,25]},"highway-path":{"line":[980,25]},"highway-cycleway":{"line":[1040,25]},"highway-footway":{"line":[1100,25]},"highway-bridleway":{"line":[1160,25]},"highway-steps":{"line":[1220,25]},"railway-rail":{"line":[1280,25]},"railway-disused":{"line":[1340,25]},"railway-abandoned":{"line":[1400,25]},"railway-subway":{"line":[1460,25]},"railway-light-rail":{"line":[1520,25]},"railway-monorail":{"line":[1580,25]},"waterway-river":{"line":[1640,25]},"waterway-stream":{"line":[1700,25]},"waterway-canal":{"line":[1760,25]},"waterway-ditch":{"line":[1820,25]},"power-line":{"line":[1880,25]},"other-line":{"line":[1940,25]},"category-roads":{"line":[2000,25]},"category-rail":{"line":[2060,25]},"category-path":{"line":[2120,25]},"category-water":{"line":[2180,25]}} \ No newline at end of file +{"airfield":{"12":[0,0],"18":[0,14],"24":[0,34]},"airport":{"12":[0,60],"18":[0,74],"24":[0,94]},"alcohol-shop":{"12":[0,120],"18":[0,134],"24":[0,154]},"america-football":{"12":[0,180],"18":[0,194],"24":[0,214]},"art-gallery":{"12":[0,240],"18":[0,254],"24":[0,274]},"bank":{"12":[0,300],"18":[0,314],"24":[0,334]},"bar":{"12":[0,360],"18":[0,374],"24":[0,394]},"baseball":{"12":[0,420],"18":[0,434],"24":[0,454]},"basketball":{"12":[0,480],"18":[0,494],"24":[0,514]},"beer":{"12":[0,540],"18":[0,554],"24":[0,574]},"bicycle":{"12":[0,600],"18":[0,614],"24":[0,634]},"building":{"12":[0,660],"18":[0,674],"24":[0,694]},"bus":{"12":[0,720],"18":[0,734],"24":[0,754]},"cafe":{"12":[0,780],"18":[0,794],"24":[0,814]},"campsite":{"12":[0,840],"18":[0,854],"24":[0,874]},"cemetery":{"12":[0,900],"18":[0,914],"24":[0,934]},"cinema":{"12":[0,960],"18":[0,974],"24":[0,994]},"circle":{"12":[0,1020],"18":[0,1034],"24":[0,1054]},"circle-stroked":{"12":[0,1080],"18":[0,1094],"24":[0,1114]},"city":{"12":[0,1140],"18":[0,1154],"24":[0,1174]},"college":{"12":[0,1200],"18":[0,1214],"24":[0,1234]},"commercial":{"12":[0,1260],"18":[0,1274],"24":[0,1294]},"cricket":{"12":[0,1320],"18":[0,1334],"24":[0,1354]},"cross":{"12":[0,1380],"18":[0,1394],"24":[0,1414]},"dam":{"12":[0,1440],"18":[0,1454],"24":[0,1474]},"danger":{"12":[0,1500],"18":[0,1514],"24":[0,1534]},"disability":{"12":[0,1560],"18":[0,1574],"24":[0,1594]},"embassy":{"12":[0,1620],"18":[0,1634],"24":[0,1654]},"emergency-telephone":{"12":[0,1680],"18":[0,1694],"24":[0,1714]},"farm":{"12":[0,1740],"18":[0,1754],"24":[0,1774]},"fast-food":{"12":[0,1800],"18":[0,1814],"24":[0,1834]},"ferry":{"12":[0,1860],"18":[0,1874],"24":[0,1894]},"fire-station":{"12":[0,1920],"18":[0,1934],"24":[0,1954]},"fuel":{"12":[0,1980],"18":[0,1994],"24":[0,2014]},"garden":{"12":[0,2040],"18":[0,2054],"24":[0,2074]},"golf":{"12":[0,2100],"18":[0,2114],"24":[0,2134]},"grocery":{"12":[0,2160],"18":[0,2174],"24":[0,2194]},"harbor":{"12":[0,2220],"18":[0,2234],"24":[0,2254]},"heliport":{"12":[0,2280],"18":[0,2294],"24":[0,2314]},"hospital":{"12":[0,2340],"18":[0,2354],"24":[0,2374]},"industrial":{"12":[0,2400],"18":[0,2414],"24":[0,2434]},"land-use":{"12":[0,2460],"18":[0,2474],"24":[0,2494]},"library":{"12":[0,2520],"18":[0,2534],"24":[0,2554]},"lodging":{"12":[0,2580],"18":[0,2594],"24":[0,2614]},"logging":{"12":[0,2640],"18":[0,2654],"24":[0,2674]},"marker":{"12":[0,2700],"18":[0,2714],"24":[0,2734]},"marker-stroked":{"12":[0,2760],"18":[0,2774],"24":[0,2794]},"monument":{"12":[0,2820],"18":[0,2834],"24":[0,2854]},"museum":{"12":[0,2880],"18":[0,2894],"24":[0,2914]},"music":{"12":[0,2940],"18":[0,2954],"24":[0,2974]},"oil-well":{"12":[0,3000],"18":[0,3014],"24":[0,3034]},"park":{"12":[0,3060],"18":[0,3074],"24":[0,3094]},"park2":{"12":[0,3120],"18":[0,3134],"24":[0,3154]},"parking":{"12":[0,3180],"18":[0,3194],"24":[0,3214]},"parking-garage":{"12":[0,3240],"18":[0,3254],"24":[0,3274]},"pharmacy":{"12":[0,3300],"18":[0,3314],"24":[0,3334]},"pitch":{"12":[0,3360],"18":[0,3374],"24":[0,3394]},"place-of-worship":{"12":[0,3420],"18":[0,3434],"24":[0,3454]},"police":{"12":[0,3480],"18":[0,3494],"24":[0,3514]},"post":{"12":[0,3540],"18":[0,3554],"24":[0,3574]},"prison":{"12":[0,3600],"18":[0,3614],"24":[0,3634]},"rail":{"12":[0,3660],"18":[0,3674],"24":[0,3694]},"rail-above":{"12":[0,3720],"18":[0,3734],"24":[0,3754]},"rail-underground":{"12":[0,3780],"18":[0,3794],"24":[0,3814]},"religious-christian":{"12":[0,3840],"18":[0,3854],"24":[0,3874]},"religious-jewish":{"12":[0,3900],"18":[0,3914],"24":[0,3934]},"religious-muslim":{"12":[0,3960],"18":[0,3974],"24":[0,3994]},"restaurant":{"12":[0,4020],"18":[0,4034],"24":[0,4054]},"roadblock":{"12":[0,4080],"18":[0,4094],"24":[0,4114]},"school":{"12":[0,4140],"18":[0,4154],"24":[0,4174]},"shop":{"12":[0,4200],"18":[0,4214],"24":[0,4234]},"skiing":{"12":[0,4260],"18":[0,4274],"24":[0,4294]},"slaughterhouse":{"12":[0,4320],"18":[0,4334],"24":[0,4354]},"soccer":{"12":[0,4380],"18":[0,4394],"24":[0,4414]},"square":{"12":[0,4440],"18":[0,4454],"24":[0,4474]},"square-stroked":{"12":[0,4500],"18":[0,4514],"24":[0,4534]},"star":{"12":[0,4560],"18":[0,4574],"24":[0,4594]},"star-stroked":{"12":[0,4620],"18":[0,4634],"24":[0,4654]},"swimming":{"12":[0,4680],"18":[0,4694],"24":[0,4714]},"telephone":{"12":[0,4740],"18":[0,4754],"24":[0,4774]},"tennis":{"12":[0,4800],"18":[0,4814],"24":[0,4834]},"theatre":{"12":[0,4860],"18":[0,4874],"24":[0,4894]},"toilets":{"12":[0,4920],"18":[0,4934],"24":[0,4954]},"town":{"12":[0,4980],"18":[0,4994],"24":[0,5014]},"town-hall":{"12":[0,5040],"18":[0,5054],"24":[0,5074]},"triangle":{"12":[0,5100],"18":[0,5114],"24":[0,5134]},"triangle-stroked":{"12":[0,5160],"18":[0,5174],"24":[0,5194]},"village":{"12":[0,5220],"18":[0,5234],"24":[0,5254]},"warehouse":{"12":[0,5280],"18":[0,5294],"24":[0,5314]},"waste-basket":{"12":[0,5340],"18":[0,5354],"24":[0,5374]},"water":{"12":[0,5400],"18":[0,5414],"24":[0,5434]},"wetland":{"12":[0,5460],"18":[0,5474],"24":[0,5494]},"zoo":{"12":[0,5520],"18":[0,5534],"24":[0,5554]},"highway-motorway":{"line":[20,25]},"highway-trunk":{"line":[80,25]},"highway-primary":{"line":[140,25]},"highway-secondary":{"line":[200,25]},"highway-tertiary":{"line":[260,25]},"highway-motorway-link":{"line":[320,25]},"highway-trunk-link":{"line":[380,25]},"highway-primary-link":{"line":[440,25]},"highway-secondary-link":{"line":[500,25]},"highway-tertiary-link":{"line":[560,25]},"highway-residential":{"line":[620,25]},"highway-unclassified":{"line":[680,25]},"highway-service":{"line":[740,25]},"highway-road":{"line":[800,25]},"highway-track":{"line":[860,25]},"highway-living-street":{"line":[920,25]},"highway-path":{"line":[980,25]},"highway-cycleway":{"line":[1040,25]},"highway-footway":{"line":[1100,25]},"highway-bridleway":{"line":[1160,25]},"highway-steps":{"line":[1220,25]},"railway-rail":{"line":[1280,25]},"railway-disused":{"line":[1340,25]},"railway-abandoned":{"line":[1400,25]},"railway-subway":{"line":[1460,25]},"railway-light-rail":{"line":[1520,25]},"railway-monorail":{"line":[1580,25]},"waterway-river":{"line":[1640,25]},"waterway-stream":{"line":[1700,25]},"waterway-canal":{"line":[1760,25]},"waterway-ditch":{"line":[1820,25]},"power-line":{"line":[1880,25]},"other-line":{"line":[1940,25]},"category-roads":{"line":[2000,25]},"category-rail":{"line":[2060,25]},"category-path":{"line":[2120,25]},"category-water":{"line":[2180,25]},"relation":{"relation":[20,25]},"restriction":{"relation":[80,25]},"multipolygon":{"relation":[140,25]},"boundary":{"relation":[200,25]},"route":{"relation":[260,25]},"route-road":{"relation":[320,25]},"route-bicycle":{"relation":[380,25]},"route-foot":{"relation":[440,25]},"route-bus":{"relation":[500,25]},"route-train":{"relation":[560,25]},"route-detour":{"relation":[620,25]},"route-tram":{"relation":[680,25]},"route-ferry":{"relation":[740,25]},"route-power":{"relation":[800,25]},"route-pipeline":{"relation":[860,25]}} \ No newline at end of file diff --git a/data/maki_sprite.js b/data/maki_sprite.js index f597a649c..f459a69b4 100644 --- a/data/maki_sprite.js +++ b/data/maki_sprite.js @@ -5,6 +5,7 @@ var _ = require('../js/lib/lodash'); var makipath = './node_modules/maki'; var lineIcons = require('./line-icons.json'); +var relationIcons = require('./relation-icons.json'); sprite.sprite('renders', { path: makipath }, function(err, makiSprite) { if (err) process.exit(1); @@ -17,6 +18,7 @@ sprite.sprite('renders', { path: makipath }, function(err, makiSprite) { var css = "/* This file is generated by make. Do NOT edit manually. */\n\n"; css += ".preset-icon{background-image:url(img/maki-sprite.png);background-repeat:no-repeat;width:24px;height:24px;}\n"; css += ".preset-icon-line{background-image:url(img/line-presets.png);background-repeat:no-repeat;width:60px;height:60px;}\n"; + css += ".preset-icon-relation{background-image:url(img/relation-presets.png);background-repeat:no-repeat;width:60px;height:60px;}\n"; var images = {}; @@ -45,6 +47,17 @@ sprite.sprite('renders', { path: makipath }, function(err, makiSprite) { images[name].line = position; }); + template = '.preset-icon-relation.feature-{name}{background-position:-{x}px -{y}px;}\n'; + + _.forEach(relationIcons, function(position, name) { + css += template.replace('{name}', name) + .replace('{x}', position[0]) + .replace('{y}', position[1]); + + images[name] = images[name] || {}; + images[name].relation = position; + }); + fs.writeFileSync('./css/feature-icons.css', css); fs.writeFileSync('./data/feature-icons.json', JSON.stringify(images)); }); diff --git a/data/presets.yaml b/data/presets.yaml index e0124c22b..69fafb1dd 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -1057,12 +1057,45 @@ en: type/boundary: name: Boundary terms: "" + type/multipolygon: + name: Multipolygon + terms: "" type/restriction: name: Restriction terms: "" type/route: name: Route terms: "" + type/route/bicycle: + name: Cycle Route + terms: "" + type/route/bus: + name: Bus Route + terms: "" + type/route/detour: + name: Detour Route + terms: "" + type/route/ferry: + name: Ferry Route + terms: "" + type/route/foot: + name: Foot Route + terms: "" + type/route/pipeline: + name: Pipeline Route + terms: "" + type/route/power: + name: Power Route + terms: "" + type/route/road: + name: Road Route + terms: "" + type/route/train: + name: Train Route + terms: "" + type/route/tram: + name: Tram Route + terms: "" waterway: name: Waterway terms: "" diff --git a/data/presets/presets.json b/data/presets/presets.json index c328f26e2..7ac820fbf 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -4477,7 +4477,18 @@ "tags": { "type": "boundary" }, - "name": "Boundary" + "name": "Boundary", + "icon": "boundary" + }, + "type/multipolygon": { + "geometry": [ + "relation" + ], + "tags": { + "type": "multipolygon" + }, + "name": "Multipolygon", + "icon": "multipolygon" }, "type/restriction": { "geometry": [ @@ -4486,7 +4497,8 @@ "tags": { "type": "restriction" }, - "name": "Restriction" + "name": "Restriction", + "icon": "restriction" }, "type/route": { "geometry": [ @@ -4495,7 +4507,118 @@ "tags": { "type": "route" }, - "name": "Route" + "name": "Route", + "icon": "route" + }, + "type/route/bicycle": { + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "bicycle" + }, + "name": "Cycle Route", + "icon": "route-bicycle" + }, + "type/route/bus": { + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "bus" + }, + "name": "Bus Route", + "icon": "route-bus" + }, + "type/route/detour": { + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "detour" + }, + "name": "Detour Route", + "icon": "route-detour" + }, + "type/route/ferry": { + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "ferry" + }, + "name": "Ferry Route", + "icon": "route-ferry" + }, + "type/route/foot": { + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "foot" + }, + "name": "Foot Route", + "icon": "route-foot" + }, + "type/route/pipeline": { + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "pipeline" + }, + "name": "Pipeline Route", + "icon": "route-pipeline" + }, + "type/route/power": { + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "power" + }, + "name": "Power Route", + "icon": "route-power" + }, + "type/route/road": { + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "road" + }, + "name": "Road Route", + "icon": "route-road" + }, + "type/route/train": { + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "train" + }, + "name": "Train Route", + "icon": "route-train" + }, + "type/route/tram": { + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "tram" + }, + "name": "Tram Route", + "icon": "route-tram" }, "waterway": { "fields": [ diff --git a/data/presets/presets/type/boundary.json b/data/presets/presets/type/boundary.json index 030a71667..8fa2f1894 100644 --- a/data/presets/presets/type/boundary.json +++ b/data/presets/presets/type/boundary.json @@ -5,5 +5,6 @@ "tags": { "type": "boundary" }, - "name": "Boundary" + "name": "Boundary", + "icon": "boundary" } \ No newline at end of file diff --git a/data/presets/presets/type/multipolygon.json b/data/presets/presets/type/multipolygon.json new file mode 100644 index 000000000..f5220bb8c --- /dev/null +++ b/data/presets/presets/type/multipolygon.json @@ -0,0 +1,10 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "multipolygon" + }, + "name": "Multipolygon", + "icon": "multipolygon" +} \ No newline at end of file diff --git a/data/presets/presets/type/restriction.json b/data/presets/presets/type/restriction.json index f758772ad..1c3ebc5a7 100644 --- a/data/presets/presets/type/restriction.json +++ b/data/presets/presets/type/restriction.json @@ -5,5 +5,6 @@ "tags": { "type": "restriction" }, - "name": "Restriction" + "name": "Restriction", + "icon": "restriction" } \ No newline at end of file diff --git a/data/presets/presets/type/route.json b/data/presets/presets/type/route.json index 45bbbea6f..4adc4b98d 100644 --- a/data/presets/presets/type/route.json +++ b/data/presets/presets/type/route.json @@ -5,5 +5,6 @@ "tags": { "type": "route" }, - "name": "Route" + "name": "Route", + "icon": "route" } \ No newline at end of file diff --git a/data/presets/presets/type/route/bicycle.json b/data/presets/presets/type/route/bicycle.json new file mode 100644 index 000000000..60ab30361 --- /dev/null +++ b/data/presets/presets/type/route/bicycle.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "bicycle" + }, + "name": "Cycle Route", + "icon": "route-bicycle" +} \ No newline at end of file diff --git a/data/presets/presets/type/route/bus.json b/data/presets/presets/type/route/bus.json new file mode 100644 index 000000000..472fa057a --- /dev/null +++ b/data/presets/presets/type/route/bus.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "bus" + }, + "name": "Bus Route", + "icon": "route-bus" +} \ No newline at end of file diff --git a/data/presets/presets/type/route/detour.json b/data/presets/presets/type/route/detour.json new file mode 100644 index 000000000..395a7d750 --- /dev/null +++ b/data/presets/presets/type/route/detour.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "detour" + }, + "name": "Detour Route", + "icon": "route-detour" +} \ No newline at end of file diff --git a/data/presets/presets/type/route/ferry.json b/data/presets/presets/type/route/ferry.json new file mode 100644 index 000000000..505833ddb --- /dev/null +++ b/data/presets/presets/type/route/ferry.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "ferry" + }, + "name": "Ferry Route", + "icon": "route-ferry" +} \ No newline at end of file diff --git a/data/presets/presets/type/route/foot.json b/data/presets/presets/type/route/foot.json new file mode 100644 index 000000000..133fcd0de --- /dev/null +++ b/data/presets/presets/type/route/foot.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "foot" + }, + "name": "Foot Route", + "icon": "route-foot" +} \ No newline at end of file diff --git a/data/presets/presets/type/route/pipeline.json b/data/presets/presets/type/route/pipeline.json new file mode 100644 index 000000000..91c161bb4 --- /dev/null +++ b/data/presets/presets/type/route/pipeline.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "pipeline" + }, + "name": "Pipeline Route", + "icon": "route-pipeline" +} \ No newline at end of file diff --git a/data/presets/presets/type/route/power.json b/data/presets/presets/type/route/power.json new file mode 100644 index 000000000..99b078068 --- /dev/null +++ b/data/presets/presets/type/route/power.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "power" + }, + "name": "Power Route", + "icon": "route-power" +} \ No newline at end of file diff --git a/data/presets/presets/type/route/road.json b/data/presets/presets/type/route/road.json new file mode 100644 index 000000000..66a3fed54 --- /dev/null +++ b/data/presets/presets/type/route/road.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "road" + }, + "name": "Road Route", + "icon": "route-road" +} \ No newline at end of file diff --git a/data/presets/presets/type/route/train.json b/data/presets/presets/type/route/train.json new file mode 100644 index 000000000..e5a3e1971 --- /dev/null +++ b/data/presets/presets/type/route/train.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "train" + }, + "name": "Train Route", + "icon": "route-train" +} \ No newline at end of file diff --git a/data/presets/presets/type/route/tram.json b/data/presets/presets/type/route/tram.json new file mode 100644 index 000000000..523212be2 --- /dev/null +++ b/data/presets/presets/type/route/tram.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "relation" + ], + "tags": { + "type": "route", + "route": "tram" + }, + "name": "Tram Route", + "icon": "route-tram" +} \ No newline at end of file diff --git a/data/relation-icons.json b/data/relation-icons.json new file mode 100644 index 000000000..2e6ad65de --- /dev/null +++ b/data/relation-icons.json @@ -0,0 +1,17 @@ +{ + "relation": [20, 25], + "restriction": [80, 25], + "multipolygon": [140, 25], + "boundary": [200, 25], + "route": [260, 25], + "route-road": [320, 25], + "route-bicycle": [380, 25], + "route-foot": [440, 25], + "route-bus": [500, 25], + "route-train": [560, 25], + "route-detour": [620, 25], + "route-tram": [680, 25], + "route-ferry": [740, 25], + "route-power": [800, 25], + "route-pipeline": [860, 25] +} diff --git a/dist/img/relation-presets.png b/dist/img/relation-presets.png new file mode 100644 index 000000000..6619ea916 Binary files /dev/null and b/dist/img/relation-presets.png differ diff --git a/dist/locales/en.json b/dist/locales/en.json index 051b6eaa5..270b9a78b 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1787,6 +1787,10 @@ "name": "Boundary", "terms": "" }, + "type/multipolygon": { + "name": "Multipolygon", + "terms": "" + }, "type/restriction": { "name": "Restriction", "terms": "" @@ -1795,6 +1799,46 @@ "name": "Route", "terms": "" }, + "type/route/bicycle": { + "name": "Cycle Route", + "terms": "" + }, + "type/route/bus": { + "name": "Bus Route", + "terms": "" + }, + "type/route/detour": { + "name": "Detour Route", + "terms": "" + }, + "type/route/ferry": { + "name": "Ferry Route", + "terms": "" + }, + "type/route/foot": { + "name": "Foot Route", + "terms": "" + }, + "type/route/pipeline": { + "name": "Pipeline Route", + "terms": "" + }, + "type/route/power": { + "name": "Power Route", + "terms": "" + }, + "type/route/road": { + "name": "Road Route", + "terms": "" + }, + "type/route/train": { + "name": "Train Route", + "terms": "" + }, + "type/route/tram": { + "name": "Tram Route", + "terms": "" + }, "waterway": { "name": "Waterway", "terms": "" diff --git a/js/id/ui/preset_icon.js b/js/id/ui/preset_icon.js index 37409e121..668049971 100644 --- a/js/id/ui/preset_icon.js +++ b/js/id/ui/preset_icon.js @@ -17,8 +17,8 @@ iD.ui.PresetIcon = function(geometry) { klass = 'feature-' + icon + ' preset-icon'; icon = iD.data.featureIcons[icon]; - if (geometry === 'line' && icon && icon.line) { - klass += ' preset-icon-line'; + if (icon && icon[geometry]) { + klass += ' preset-icon-' + geometry; } return klass;