diff --git a/data/imagery.json b/data/imagery.json index 2055c1cf5..44d62cb97 100644 --- a/data/imagery.json +++ b/data/imagery.json @@ -2,6 +2,12 @@ { "name": "Bing aerial imagery", "url": "http://ecn.t0.tiles.virtualearth.net/tiles/a{q}uadkey.jpeg?g=587&mkt=en-gb&n=z", + "description": "Satellite imagery.", + "scaleExtent": [ + 0, + 20 + ], + "default": "yes", "sourcetag": "Bing", "logo": "bing_maps.png", "logo_url": "http://www.bing.com/maps", @@ -10,6 +16,11 @@ { "name": "MapBox Satellite", "url": "http://{t}.tiles.mapbox.com/v3/openstreetmap.map-4wvf9l0l/{z}/{x}/{y}.png", + "description": "Satellite and aerial imagery", + "scaleExtent": [ + 0, + 16 + ], "subdomains": [ "a", "b", @@ -17,26 +28,19 @@ ] }, { - "name": "MapQuest Open Aerial", - "url": "http://oatile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg" - }, - { - "name": "OSM - Mapnik", + "name": "OpenStreetMap", "url": "http://{t}.tile.openstreetmap.org/{z}/{x}/{y}.png", + "description": "The default OpenStreetMap layer.", + "scaleExtent": [ + 0, + 18 + ], "subdomains": [ "a", "b", "c" ] }, - { - "name": "OSM - OpenCycleMap", - "url": "http://tile.opencyclemap.org/cycle/{z}/{x}/{y}.png" - }, - { - "name": "OSM - MapQuest", - "url": "http://otile1.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.jpg" - }, { "name": "OSM - Tiger Edited Map", "url": "http://tiger-osm.mapquest.com/tiles/1.0.0/tiger/{z}/{x}/{y}.png", @@ -70,6 +74,11 @@ { "name": "OSM US TIGER 2012 Roads Overlay", "url": "http://{t}.tile.openstreetmap.us/tiger2012_roads_expanded/{z}/{x}/{y}.png", + "description": "Public domain road data from the US Government.", + "scaleExtent": [ + 0, + 17 + ], "subdomains": [ "a", "b", @@ -85,6 +94,11 @@ { "name": "OSM US TIGER 2012 Roads Overlay", "url": "http://{t}.tile.openstreetmap.us/tiger2012_roads_expanded/{z}/{x}/{y}.png", + "description": "Public domain road data from the US Government.", + "scaleExtent": [ + 0, + 17 + ], "subdomains": [ "a", "b", @@ -100,6 +114,11 @@ { "name": "OSM US TIGER 2012 Roads Overlay", "url": "http://{t}.tile.openstreetmap.us/tiger2012_roads_expanded/{z}/{x}/{y}.png", + "description": "Public domain road data from the US Government.", + "scaleExtent": [ + 0, + 17 + ], "subdomains": [ "a", "b", diff --git a/data/imagery_convert.js b/data/imagery_convert.js index 16cc23317..a7253aee4 100644 --- a/data/imagery_convert.js +++ b/data/imagery_convert.js @@ -5,6 +5,32 @@ $ = cheerio.load(fs.readFileSync('imagery.xml')); var imagery = []; +// CENSORSHIP! No, these are just layers that essentially duplicate other layers +// or which have no clear use case. +var censor = { + 'MapQuest Open Aerial': true, + 'OSM - OpenCycleMap': true, + 'OSM - MapQuest': true +}; + +var replace = { + 'OSM - Mapnik': 'OpenStreetMap' +}; + +var description = { + 'MapBox Satellite': 'Satellite and aerial imagery', + 'OpenStreetMap': 'The default OpenStreetMap layer.', + 'OSM US TIGER 2012 Roads Overlay': 'Public domain road data from the US Government.', + 'Bing aerial imagery': 'Satellite imagery.' +}; + +var scaleExtent = { + 'MapBox Satellite': [0, 16], + 'OpenStreetMap': [0, 18], + 'OSM US TIGER 2012 Roads Overlay': [0, 17], + 'Bing aerial imagery': [0, 20] +}; + $('set').each(function(i) { var elem = $(this); @@ -13,6 +39,14 @@ $('set').each(function(i) { url: $(this).find('url').first().text() }; + if (censor[im.name]) return; + + if (replace[im.name]) im.name = replace[im.name]; + + if (description[im.name]) im.description = description[im.name]; + + if (scaleExtent[im.name]) im.scaleExtent = scaleExtent[im.name]; + var subdomains = []; im.url = im.url @@ -34,7 +68,7 @@ $('set').each(function(i) { +elem.attr('maxlon')]; } - ['sourcetag', 'logo', 'logo_url', 'terms_url'].forEach(function(a) { + ['default', 'sourcetag', 'logo', 'logo_url', 'terms_url'].forEach(function(a) { if (elem.find(a).length) { im[a] = elem.find(a).first().text(); } @@ -43,3 +77,4 @@ $('set').each(function(i) { }); fs.writeFileSync('imagery.json', JSON.stringify(imagery, null, 4)); +fs.writeFileSync('imagery.js', 'iD.data.imagery = ' + JSON.stringify(imagery, null, 4) + ';'); diff --git a/index.html b/index.html index c03ac29ae..3be283a1f 100644 --- a/index.html +++ b/index.html @@ -32,12 +32,17 @@ + + + + + @@ -135,8 +140,6 @@ - -