diff --git a/data/imagery.js b/data/imagery.js new file mode 100644 index 000000000..fb6f3f020 --- /dev/null +++ b/data/imagery.js @@ -0,0 +1,657 @@ +iD.data.imagery = [ + { + "name": "Bing aerial imagery", + "template": "http://ecn.t0.tiles.virtualearth.net/tiles/a{u}.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", + "terms_url": "http://opengeodata.org/microsoft-imagery-details" + }, + { + "name": "MapBox Satellite", + "template": "http://{t}.tiles.mapbox.com/v3/openstreetmap.map-4wvf9l0l/{z}/{x}/{y}.png", + "description": "Satellite and aerial imagery", + "scaleExtent": [ + 0, + 16 + ], + "subdomains": [ + "a", + "b", + "c" + ] + }, + { + "name": "OpenStreetMap", + "template": "http://{t}.tile.openstreetmap.org/{z}/{x}/{y}.png", + "description": "The default OpenStreetMap layer.", + "scaleExtent": [ + 0, + 18 + ], + "subdomains": [ + "a", + "b", + "c" + ] + }, + { + "name": "OSM - Tiger Edited Map", + "template": "http://tiger-osm.mapquest.com/tiles/1.0.0/tiger/{z}/{x}/{y}.png", + "extent": [ + [ + -124.81, + 24.055 + ], + [ + -66.865, + 49.386 + ] + ] + }, + { + "name": "OSM - Tiger Edited Map", + "template": "http://tiger-osm.mapquest.com/tiles/1.0.0/tiger/{z}/{x}/{y}.png", + "extent": [ + [ + -179.754, + 50.858 + ], + [ + -129.899, + 71.463 + ] + ] + }, + { + "name": "OSM - Tiger Edited Map", + "template": "http://tiger-osm.mapquest.com/tiles/1.0.0/tiger/{z}/{x}/{y}.png", + "extent": [ + [ + -174.46, + 18.702 + ], + [ + -154.516, + 26.501 + ] + ] + }, + { + "name": "OSM US TIGER 2012 Roads Overlay", + "template": "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", + "c" + ], + "extent": [ + [ + -124.81, + 24.055 + ], + [ + -66.865, + 49.386 + ] + ] + }, + { + "name": "OSM US TIGER 2012 Roads Overlay", + "template": "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", + "c" + ], + "extent": [ + [ + -179.754, + 50.858 + ], + [ + -129.899, + 71.463 + ] + ] + }, + { + "name": "OSM US TIGER 2012 Roads Overlay", + "template": "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", + "c" + ], + "extent": [ + [ + -174.46, + 18.702 + ], + [ + -154.516, + 26.501 + ] + ] + }, + { + "name": "OSM US USGS Topographic Maps", + "template": "http://{t}.tile.openstreetmap.us/usgs_scanned_topos/{z}/{x}/{y}.png", + "subdomains": [ + "a", + "b", + "c" + ], + "extent": [ + [ + -125.991, + 24.005 + ], + [ + -65.988, + 50.009 + ] + ] + }, + { + "name": "OSM US USGS Topographic Maps", + "template": "http://{t}.tile.openstreetmap.us/usgs_scanned_topos/{z}/{x}/{y}.png", + "subdomains": [ + "a", + "b", + "c" + ], + "extent": [ + [ + -160.579, + 18.902 + ], + [ + -154.793, + 22.508 + ] + ] + }, + { + "name": "OSM US USGS Topographic Maps", + "template": "http://{t}.tile.openstreetmap.us/usgs_scanned_topos/{z}/{x}/{y}.png", + "subdomains": [ + "a", + "b", + "c" + ], + "extent": [ + [ + -178.001, + 51.255 + ], + [ + -130.004, + 71.999 + ] + ] + }, + { + "name": "OSM US USGS Large Scale Aerial Imagery", + "template": "http://{t}.tile.openstreetmap.us/usgs_large_scale/{z}/{x}/{y}.jpg", + "subdomains": [ + "a", + "b", + "c" + ], + "extent": [ + [ + -124.819, + 24.496 + ], + [ + -66.931, + 49.443 + ] + ] + }, + { + "name": "British Columbia bc_mosaic", + "template": "http://{t}.imagery.paulnorman.ca/tiles/bc_mosaic/{z}/{x}/{y}.png", + "subdomains": [ + "a", + "b", + "c", + "d" + ], + "extent": [ + [ + -123.441, + 48.995 + ], + [ + -121.346, + 50.426 + ] + ], + "sourcetag": "bc_mosaic", + "terms_url": "http://imagery.paulnorman.ca/tiles/about.html" + }, + { + "name": "OS OpenData Streetview", + "template": "http://os.openstreetmap.org/sv/{z}/{x}/{y}.png", + "extent": [ + [ + -8.72, + 49.86 + ], + [ + 1.84, + 60.92 + ] + ], + "sourcetag": "OS_OpenData_StreetView" + }, + { + "name": "OS OpenData Locator", + "template": "http://tiles.itoworld.com/os_locator/{z}/{x}/{y}.png", + "extent": [ + [ + -9, + 49.8 + ], + [ + 1.9, + 61.1 + ] + ], + "sourcetag": "OS_OpenData_Locator" + }, + { + "name": "OS 1:25k historic (OSM)", + "template": "http://ooc.openstreetmap.org/os1/{z}/{x}/{y}.jpg", + "extent": [ + [ + -9, + 49.8 + ], + [ + 1.9, + 61.1 + ] + ], + "sourcetag": "OS 1:25k" + }, + { + "name": "OS 1:25k historic (NLS)", + "template": "http://geo.nls.uk/mapdata2/os/25000/{z}/{x}/{y}.png", + "extent": [ + [ + -9, + 49.8 + ], + [ + 1.9, + 61.1 + ] + ], + "sourcetag": "OS 1:25k", + "logo": "icons/logo_nls70-nq8.png", + "logo_url": "http://geo.nls.uk/maps/" + }, + { + "name": "OS 7th Series historic (OSM)", + "template": "http://ooc.openstreetmap.org/os7/{z}/{x}/{y}.jpg", + "extent": [ + [ + -9, + 49.8 + ], + [ + 1.9, + 61.1 + ] + ], + "sourcetag": "OS7" + }, + { + "name": "OS 7th Series historic (NLS)", + "template": "http://geo.nls.uk/mapdata2/os/seventh/{z}/{x}/{y}.png", + "extent": [ + [ + -9, + 49.8 + ], + [ + 1.9, + 61.1 + ] + ], + "sourcetag": "OS7", + "logo": "icons/logo_nls70-nq8.png", + "logo_url": "http://geo.nls.uk/maps/" + }, + { + "name": "OS New Popular Edition historic", + "template": "http://ooc.openstreetmap.org/npe/{z}/{x}/{y}.png", + "extent": [ + [ + -5.8, + 49.8 + ], + [ + 1.9, + 55.8 + ] + ], + "sourcetag": "NPE" + }, + { + "name": "OS Scottish Popular historic", + "template": "http://ooc.openstreetmap.org/npescotland/tiles/{z}/{x}/{y}.jpg", + "extent": [ + [ + -7.8, + 54.5 + ], + [ + -1.1, + 61.1 + ] + ], + "sourcetag": "NPE" + }, + { + "name": "Surrey aerial", + "template": "http://gravitystorm.dev.openstreetmap.org/surrey/{z}/{x}/{y}.png", + "extent": [ + [ + -0.856, + 51.071 + ], + [ + 0.062, + 51.473 + ] + ], + "sourcetag": "Surrey aerial" + }, + { + "name": "Haiti - GeoEye Jan 13", + "template": "http://gravitystorm.dev.openstreetmap.org/imagery/haiti/{z}/{x}/{y}.jpg", + "extent": [ + [ + -74.5, + 17.95 + ], + [ + -71.58, + 20.12 + ] + ], + "sourcetag": "Haiti GeoEye" + }, + { + "name": "Haiti - GeoEye Jan 13+", + "template": "http://maps.nypl.org/tilecache/1/geoeye/{z}/{x}/{y}.jpg", + "extent": [ + [ + -74.5, + 17.95 + ], + [ + -71.58, + 20.12 + ] + ], + "sourcetag": "Haiti GeoEye" + }, + { + "name": "Haiti - DigitalGlobe", + "template": "http://maps.nypl.org/tilecache/1/dg_crisis/{z}/{x}/{y}.jpg", + "extent": [ + [ + -74.5, + 17.95 + ], + [ + -71.58, + 20.12 + ] + ], + "sourcetag": "Haiti DigitalGlobe" + }, + { + "name": "Haiti - Street names", + "template": "http://hypercube.telascience.org/tiles/1.0.0/haiti-city/{z}/{x}/{y}.jpg", + "extent": [ + [ + -74.5, + 17.95 + ], + [ + -71.58, + 20.12 + ] + ], + "sourcetag": "Haiti streetnames" + }, + { + "name": "National Agriculture Imagery Program", + "template": "http://cube.telascience.org/tilecache/tilecache.py/NAIP_ALL/{z}/{x}/{y}.png", + "extent": [ + [ + -125.8, + 24.2 + ], + [ + -62.3, + 49.5 + ] + ], + "sourcetag": "NAIP" + }, + { + "name": "National Agriculture Imagery Program", + "template": "http://cube.telascience.org/tilecache/tilecache.py/NAIP_ALL/{z}/{x}/{y}.png", + "extent": [ + [ + -168.5, + 55.3 + ], + [ + -140, + 71.5 + ] + ], + "sourcetag": "NAIP" + }, + { + "name": "Ireland - NLS Historic Maps", + "template": "http://geo.nls.uk/maps/ireland/gsgs4136/{z}/{x}/{y}.png", + "extent": [ + [ + -10.71, + 51.32 + ], + [ + -5.37, + 55.46 + ] + ], + "sourcetag": "NLS Historic Maps", + "logo": "icons/logo_nls70-nq8.png", + "logo_url": "http://geo.nls.uk/maps/" + }, + { + "name": "Denmark - Fugro Aerial Imagery", + "template": "http://tile.openstreetmap.dk/fugro2005/{z}/{x}/{y}.jpg", + "extent": [ + [ + 7.81, + 54.44 + ], + [ + 15.49, + 57.86 + ] + ], + "sourcetag": "Fugro (2005)" + }, + { + "name": "Denmark - Stevns Kommune", + "template": "http://tile.openstreetmap.dk/stevns/2009/{z}/{x}/{y}.jpg", + "extent": [ + [ + 12.09144, + 55.23403 + ], + [ + 12.47712, + 55.43647 + ] + ], + "sourcetag": "Stevns Kommune (2009)" + }, + { + "name": "Austria - geoimage.at", + "template": "http://geoimage.openstreetmap.at/4d80de696cd562a63ce463a58a61488d/{z}/{x}/{y}.jpg", + "extent": [ + [ + 9.36, + 46.33 + ], + [ + 17.28, + 49.09 + ] + ], + "sourcetag": "geoimage.at" + }, + { + "name": "Russia - Kosmosnimki.ru IRS Satellite", + "template": "http://irs.gis-lab.info/?layers=irs&request=GetTile&z={z}&x={x}&y={y}", + "extent": [ + [ + 19.02, + 40.96 + ], + [ + 77.34, + 70.48 + ] + ], + "sourcetag": "Kosmosnimki.ru IRS" + }, + { + "name": "Belarus - Kosmosnimki.ru SPOT4 Satellite", + "template": "http://irs.gis-lab.info/?layers=spot&request=GetTile&z={z}&x={x}&y={y}", + "extent": [ + [ + 23.16, + 51.25 + ], + [ + 32.83, + 56.19 + ] + ], + "sourcetag": "Kosmosnimki.ru SPOT4" + }, + { + "name": "Australia - Geographic Reference Image", + "template": "http://agri.openstreetmap.org/{z}/{x}/{y}.png", + "extent": [ + [ + 96, + -44 + ], + [ + 168, + -9 + ] + ], + "sourcetag": "AGRI" + }, + { + "name": "Switzerland - Canton Aargau - AGIS 25cm 2011", + "template": "http://tiles.poole.ch/AGIS/OF2011/{z}/{x}/{y}.png", + "extent": [ + [ + 7.69, + 47.13 + ], + [ + 8.48, + 47.63 + ] + ], + "sourcetag": "AGIS OF2011" + }, + { + "name": "Switzerland - Canton Solothurn - SOGIS 2007", + "template": "http://mapproxy.sosm.ch:8080/tiles/sogis2007/EPSG900913/{z}/{x}/{y}.png?origin=nw", + "extent": [ + [ + 7.33, + 47.06 + ], + [ + 8.04, + 47.5 + ] + ], + "sourcetag": "Orthofoto 2007 WMS Solothurn" + }, + { + "name": "Poland - Media-Lab fleet GPS masstracks", + "template": "http://masstracks.media-lab.com.pl/{z}/{x}/{y}.png", + "extent": [ + [ + 14, + 48.9 + ], + [ + 24.2, + 55 + ] + ], + "sourcetag": "masstracks" + }, + { + "name": "South Africa - CD:NGI Aerial", + "template": "http://{t}.aerial.openstreetmap.org.za/ngi-aerial/{z}/{x}/{y}.jpg", + "subdomains": [ + "a", + "b", + "c" + ], + "extent": [ + [ + 17.64, + -34.95 + ], + [ + 32.87, + -22.05 + ] + ], + "sourcetag": "ngi-aerial" + } +]; \ No newline at end of file diff --git a/data/imagery.json b/data/imagery.json index 44d62cb97..e4497fc9d 100644 --- a/data/imagery.json +++ b/data/imagery.json @@ -1,7 +1,7 @@ [ { "name": "Bing aerial imagery", - "url": "http://ecn.t0.tiles.virtualearth.net/tiles/a{q}uadkey.jpeg?g=587&mkt=en-gb&n=z", + "template": "http://ecn.t0.tiles.virtualearth.net/tiles/a{u}.jpeg?g=587&mkt=en-gb&n=z", "description": "Satellite imagery.", "scaleExtent": [ 0, @@ -15,7 +15,7 @@ }, { "name": "MapBox Satellite", - "url": "http://{t}.tiles.mapbox.com/v3/openstreetmap.map-4wvf9l0l/{z}/{x}/{y}.png", + "template": "http://{t}.tiles.mapbox.com/v3/openstreetmap.map-4wvf9l0l/{z}/{x}/{y}.png", "description": "Satellite and aerial imagery", "scaleExtent": [ 0, @@ -29,7 +29,7 @@ }, { "name": "OpenStreetMap", - "url": "http://{t}.tile.openstreetmap.org/{z}/{x}/{y}.png", + "template": "http://{t}.tile.openstreetmap.org/{z}/{x}/{y}.png", "description": "The default OpenStreetMap layer.", "scaleExtent": [ 0, @@ -43,37 +43,49 @@ }, { "name": "OSM - Tiger Edited Map", - "url": "http://tiger-osm.mapquest.com/tiles/1.0.0/tiger/{z}/{x}/{y}.png", + "template": "http://tiger-osm.mapquest.com/tiles/1.0.0/tiger/{z}/{x}/{y}.png", "extent": [ - 24.055, - -124.81, - 49.386, - -66.865 + [ + -124.81, + 24.055 + ], + [ + -66.865, + 49.386 + ] ] }, { "name": "OSM - Tiger Edited Map", - "url": "http://tiger-osm.mapquest.com/tiles/1.0.0/tiger/{z}/{x}/{y}.png", + "template": "http://tiger-osm.mapquest.com/tiles/1.0.0/tiger/{z}/{x}/{y}.png", "extent": [ - 50.858, - -179.754, - 71.463, - -129.899 + [ + -179.754, + 50.858 + ], + [ + -129.899, + 71.463 + ] ] }, { "name": "OSM - Tiger Edited Map", - "url": "http://tiger-osm.mapquest.com/tiles/1.0.0/tiger/{z}/{x}/{y}.png", + "template": "http://tiger-osm.mapquest.com/tiles/1.0.0/tiger/{z}/{x}/{y}.png", "extent": [ - 18.702, - -174.46, - 26.501, - -154.516 + [ + -174.46, + 18.702 + ], + [ + -154.516, + 26.501 + ] ] }, { "name": "OSM US TIGER 2012 Roads Overlay", - "url": "http://{t}.tile.openstreetmap.us/tiger2012_roads_expanded/{z}/{x}/{y}.png", + "template": "http://{t}.tile.openstreetmap.us/tiger2012_roads_expanded/{z}/{x}/{y}.png", "description": "Public domain road data from the US Government.", "scaleExtent": [ 0, @@ -85,15 +97,19 @@ "c" ], "extent": [ - 24.055, - -124.81, - 49.386, - -66.865 + [ + -124.81, + 24.055 + ], + [ + -66.865, + 49.386 + ] ] }, { "name": "OSM US TIGER 2012 Roads Overlay", - "url": "http://{t}.tile.openstreetmap.us/tiger2012_roads_expanded/{z}/{x}/{y}.png", + "template": "http://{t}.tile.openstreetmap.us/tiger2012_roads_expanded/{z}/{x}/{y}.png", "description": "Public domain road data from the US Government.", "scaleExtent": [ 0, @@ -105,15 +121,19 @@ "c" ], "extent": [ - 50.858, - -179.754, - 71.463, - -129.899 + [ + -179.754, + 50.858 + ], + [ + -129.899, + 71.463 + ] ] }, { "name": "OSM US TIGER 2012 Roads Overlay", - "url": "http://{t}.tile.openstreetmap.us/tiger2012_roads_expanded/{z}/{x}/{y}.png", + "template": "http://{t}.tile.openstreetmap.us/tiger2012_roads_expanded/{z}/{x}/{y}.png", "description": "Public domain road data from the US Government.", "scaleExtent": [ 0, @@ -125,75 +145,95 @@ "c" ], "extent": [ - 18.702, - -174.46, - 26.501, - -154.516 + [ + -174.46, + 18.702 + ], + [ + -154.516, + 26.501 + ] ] }, { "name": "OSM US USGS Topographic Maps", - "url": "http://{t}.tile.openstreetmap.us/usgs_scanned_topos/{z}/{x}/{y}.png", + "template": "http://{t}.tile.openstreetmap.us/usgs_scanned_topos/{z}/{x}/{y}.png", "subdomains": [ "a", "b", "c" ], "extent": [ - 24.005, - -125.991, - 50.009, - -65.988 + [ + -125.991, + 24.005 + ], + [ + -65.988, + 50.009 + ] ] }, { "name": "OSM US USGS Topographic Maps", - "url": "http://{t}.tile.openstreetmap.us/usgs_scanned_topos/{z}/{x}/{y}.png", + "template": "http://{t}.tile.openstreetmap.us/usgs_scanned_topos/{z}/{x}/{y}.png", "subdomains": [ "a", "b", "c" ], "extent": [ - 18.902, - -160.579, - 22.508, - -154.793 + [ + -160.579, + 18.902 + ], + [ + -154.793, + 22.508 + ] ] }, { "name": "OSM US USGS Topographic Maps", - "url": "http://{t}.tile.openstreetmap.us/usgs_scanned_topos/{z}/{x}/{y}.png", + "template": "http://{t}.tile.openstreetmap.us/usgs_scanned_topos/{z}/{x}/{y}.png", "subdomains": [ "a", "b", "c" ], "extent": [ - 51.255, - -178.001, - 71.999, - -130.004 + [ + -178.001, + 51.255 + ], + [ + -130.004, + 71.999 + ] ] }, { "name": "OSM US USGS Large Scale Aerial Imagery", - "url": "http://{t}.tile.openstreetmap.us/usgs_large_scale/{z}/{x}/{y}.jpg", + "template": "http://{t}.tile.openstreetmap.us/usgs_large_scale/{z}/{x}/{y}.jpg", "subdomains": [ "a", "b", "c" ], "extent": [ - 24.496, - -124.819, - 49.443, - -66.931 + [ + -124.819, + 24.496 + ], + [ + -66.931, + 49.443 + ] ] }, { "name": "British Columbia bc_mosaic", - "url": "http://{t}.imagery.paulnorman.ca/tiles/bc_mosaic/{z}/{x}/{y}.png", + "template": "http://{t}.imagery.paulnorman.ca/tiles/bc_mosaic/{z}/{x}/{y}.png", "subdomains": [ "a", "b", @@ -201,55 +241,75 @@ "d" ], "extent": [ - 48.995, - -123.441, - 50.426, - -121.346 + [ + -123.441, + 48.995 + ], + [ + -121.346, + 50.426 + ] ], "sourcetag": "bc_mosaic", "terms_url": "http://imagery.paulnorman.ca/tiles/about.html" }, { "name": "OS OpenData Streetview", - "url": "http://os.openstreetmap.org/sv/{z}/{x}/{y}.png", + "template": "http://os.openstreetmap.org/sv/{z}/{x}/{y}.png", "extent": [ - 49.86, - -8.72, - 60.92, - 1.84 + [ + -8.72, + 49.86 + ], + [ + 1.84, + 60.92 + ] ], "sourcetag": "OS_OpenData_StreetView" }, { "name": "OS OpenData Locator", - "url": "http://tiles.itoworld.com/os_locator/{z}/{x}/{y}.png", + "template": "http://tiles.itoworld.com/os_locator/{z}/{x}/{y}.png", "extent": [ - 49.8, - -9, - 61.1, - 1.9 + [ + -9, + 49.8 + ], + [ + 1.9, + 61.1 + ] ], "sourcetag": "OS_OpenData_Locator" }, { "name": "OS 1:25k historic (OSM)", - "url": "http://ooc.openstreetmap.org/os1/{z}/{x}/{y}.jpg", + "template": "http://ooc.openstreetmap.org/os1/{z}/{x}/{y}.jpg", "extent": [ - 49.8, - -9, - 61.1, - 1.9 + [ + -9, + 49.8 + ], + [ + 1.9, + 61.1 + ] ], "sourcetag": "OS 1:25k" }, { "name": "OS 1:25k historic (NLS)", - "url": "http://geo.nls.uk/mapdata2/os/25000/{z}/{x}/{y}.png", + "template": "http://geo.nls.uk/mapdata2/os/25000/{z}/{x}/{y}.png", "extent": [ - 49.8, - -9, - 61.1, - 1.9 + [ + -9, + 49.8 + ], + [ + 1.9, + 61.1 + ] ], "sourcetag": "OS 1:25k", "logo": "icons/logo_nls70-nq8.png", @@ -257,23 +317,31 @@ }, { "name": "OS 7th Series historic (OSM)", - "url": "http://ooc.openstreetmap.org/os7/{z}/{x}/{y}.jpg", + "template": "http://ooc.openstreetmap.org/os7/{z}/{x}/{y}.jpg", "extent": [ - 49.8, - -9, - 61.1, - 1.9 + [ + -9, + 49.8 + ], + [ + 1.9, + 61.1 + ] ], "sourcetag": "OS7" }, { "name": "OS 7th Series historic (NLS)", - "url": "http://geo.nls.uk/mapdata2/os/seventh/{z}/{x}/{y}.png", + "template": "http://geo.nls.uk/mapdata2/os/seventh/{z}/{x}/{y}.png", "extent": [ - 49.8, - -9, - 61.1, - 1.9 + [ + -9, + 49.8 + ], + [ + 1.9, + 61.1 + ] ], "sourcetag": "OS7", "logo": "icons/logo_nls70-nq8.png", @@ -281,111 +349,151 @@ }, { "name": "OS New Popular Edition historic", - "url": "http://ooc.openstreetmap.org/npe/{z}/{x}/{y}.png", + "template": "http://ooc.openstreetmap.org/npe/{z}/{x}/{y}.png", "extent": [ - 49.8, - -5.8, - 55.8, - 1.9 + [ + -5.8, + 49.8 + ], + [ + 1.9, + 55.8 + ] ], "sourcetag": "NPE" }, { "name": "OS Scottish Popular historic", - "url": "http://ooc.openstreetmap.org/npescotland/tiles/{z}/{x}/{y}.jpg", + "template": "http://ooc.openstreetmap.org/npescotland/tiles/{z}/{x}/{y}.jpg", "extent": [ - 54.5, - -7.8, - 61.1, - -1.1 + [ + -7.8, + 54.5 + ], + [ + -1.1, + 61.1 + ] ], "sourcetag": "NPE" }, { "name": "Surrey aerial", - "url": "http://gravitystorm.dev.openstreetmap.org/surrey/{z}/{x}/{y}.png", + "template": "http://gravitystorm.dev.openstreetmap.org/surrey/{z}/{x}/{y}.png", "extent": [ - 51.071, - -0.856, - 51.473, - 0.062 + [ + -0.856, + 51.071 + ], + [ + 0.062, + 51.473 + ] ], "sourcetag": "Surrey aerial" }, { "name": "Haiti - GeoEye Jan 13", - "url": "http://gravitystorm.dev.openstreetmap.org/imagery/haiti/{z}/{x}/{y}.jpg", + "template": "http://gravitystorm.dev.openstreetmap.org/imagery/haiti/{z}/{x}/{y}.jpg", "extent": [ - 17.95, - -74.5, - 20.12, - -71.58 + [ + -74.5, + 17.95 + ], + [ + -71.58, + 20.12 + ] ], "sourcetag": "Haiti GeoEye" }, { "name": "Haiti - GeoEye Jan 13+", - "url": "http://maps.nypl.org/tilecache/1/geoeye/{z}/{x}/{y}.jpg", + "template": "http://maps.nypl.org/tilecache/1/geoeye/{z}/{x}/{y}.jpg", "extent": [ - 17.95, - -74.5, - 20.12, - -71.58 + [ + -74.5, + 17.95 + ], + [ + -71.58, + 20.12 + ] ], "sourcetag": "Haiti GeoEye" }, { "name": "Haiti - DigitalGlobe", - "url": "http://maps.nypl.org/tilecache/1/dg_crisis/{z}/{x}/{y}.jpg", + "template": "http://maps.nypl.org/tilecache/1/dg_crisis/{z}/{x}/{y}.jpg", "extent": [ - 17.95, - -74.5, - 20.12, - -71.58 + [ + -74.5, + 17.95 + ], + [ + -71.58, + 20.12 + ] ], "sourcetag": "Haiti DigitalGlobe" }, { "name": "Haiti - Street names", - "url": "http://hypercube.telascience.org/tiles/1.0.0/haiti-city/{z}/{x}/{y}.jpg", + "template": "http://hypercube.telascience.org/tiles/1.0.0/haiti-city/{z}/{x}/{y}.jpg", "extent": [ - 17.95, - -74.5, - 20.12, - -71.58 + [ + -74.5, + 17.95 + ], + [ + -71.58, + 20.12 + ] ], "sourcetag": "Haiti streetnames" }, { "name": "National Agriculture Imagery Program", - "url": "http://cube.telascience.org/tilecache/tilecache.py/NAIP_ALL/{z}/{x}/{y}.png", + "template": "http://cube.telascience.org/tilecache/tilecache.py/NAIP_ALL/{z}/{x}/{y}.png", "extent": [ - 24.2, - -125.8, - 49.5, - -62.3 + [ + -125.8, + 24.2 + ], + [ + -62.3, + 49.5 + ] ], "sourcetag": "NAIP" }, { "name": "National Agriculture Imagery Program", - "url": "http://cube.telascience.org/tilecache/tilecache.py/NAIP_ALL/{z}/{x}/{y}.png", + "template": "http://cube.telascience.org/tilecache/tilecache.py/NAIP_ALL/{z}/{x}/{y}.png", "extent": [ - 55.3, - -168.5, - 71.5, - -140 + [ + -168.5, + 55.3 + ], + [ + -140, + 71.5 + ] ], "sourcetag": "NAIP" }, { "name": "Ireland - NLS Historic Maps", - "url": "http://geo.nls.uk/maps/ireland/gsgs4136/{z}/{x}/{y}.png", + "template": "http://geo.nls.uk/maps/ireland/gsgs4136/{z}/{x}/{y}.png", "extent": [ - 51.32, - -10.71, - 55.46, - -5.37 + [ + -10.71, + 51.32 + ], + [ + -5.37, + 55.46 + ] ], "sourcetag": "NLS Historic Maps", "logo": "icons/logo_nls70-nq8.png", @@ -393,116 +501,156 @@ }, { "name": "Denmark - Fugro Aerial Imagery", - "url": "http://tile.openstreetmap.dk/fugro2005/{z}/{x}/{y}.jpg", + "template": "http://tile.openstreetmap.dk/fugro2005/{z}/{x}/{y}.jpg", "extent": [ - 54.44, - 7.81, - 57.86, - 15.49 + [ + 7.81, + 54.44 + ], + [ + 15.49, + 57.86 + ] ], "sourcetag": "Fugro (2005)" }, { "name": "Denmark - Stevns Kommune", - "url": "http://tile.openstreetmap.dk/stevns/2009/{z}/{x}/{y}.jpg", + "template": "http://tile.openstreetmap.dk/stevns/2009/{z}/{x}/{y}.jpg", "extent": [ - 55.23403, - 12.09144, - 55.43647, - 12.47712 + [ + 12.09144, + 55.23403 + ], + [ + 12.47712, + 55.43647 + ] ], "sourcetag": "Stevns Kommune (2009)" }, { "name": "Austria - geoimage.at", - "url": "http://geoimage.openstreetmap.at/4d80de696cd562a63ce463a58a61488d/{z}/{x}/{y}.jpg", + "template": "http://geoimage.openstreetmap.at/4d80de696cd562a63ce463a58a61488d/{z}/{x}/{y}.jpg", "extent": [ - 46.33, - 9.36, - 49.09, - 17.28 + [ + 9.36, + 46.33 + ], + [ + 17.28, + 49.09 + ] ], "sourcetag": "geoimage.at" }, { "name": "Russia - Kosmosnimki.ru IRS Satellite", - "url": "http://irs.gis-lab.info/?layers=irs&request=GetTile&z={z}&x={x}&y={y}", + "template": "http://irs.gis-lab.info/?layers=irs&request=GetTile&z={z}&x={x}&y={y}", "extent": [ - 40.96, - 19.02, - 70.48, - 77.34 + [ + 19.02, + 40.96 + ], + [ + 77.34, + 70.48 + ] ], "sourcetag": "Kosmosnimki.ru IRS" }, { "name": "Belarus - Kosmosnimki.ru SPOT4 Satellite", - "url": "http://irs.gis-lab.info/?layers=spot&request=GetTile&z={z}&x={x}&y={y}", + "template": "http://irs.gis-lab.info/?layers=spot&request=GetTile&z={z}&x={x}&y={y}", "extent": [ - 51.25, - 23.16, - 56.19, - 32.83 + [ + 23.16, + 51.25 + ], + [ + 32.83, + 56.19 + ] ], "sourcetag": "Kosmosnimki.ru SPOT4" }, { "name": "Australia - Geographic Reference Image", - "url": "http://agri.openstreetmap.org/{z}/{x}/{y}.png", + "template": "http://agri.openstreetmap.org/{z}/{x}/{y}.png", "extent": [ - -44, - 96, - -9, - 168 + [ + 96, + -44 + ], + [ + 168, + -9 + ] ], "sourcetag": "AGRI" }, { "name": "Switzerland - Canton Aargau - AGIS 25cm 2011", - "url": "http://tiles.poole.ch/AGIS/OF2011/{z}/{x}/{y}.png", + "template": "http://tiles.poole.ch/AGIS/OF2011/{z}/{x}/{y}.png", "extent": [ - 47.13, - 7.69, - 47.63, - 8.48 + [ + 7.69, + 47.13 + ], + [ + 8.48, + 47.63 + ] ], "sourcetag": "AGIS OF2011" }, { "name": "Switzerland - Canton Solothurn - SOGIS 2007", - "url": "http://mapproxy.sosm.ch:8080/tiles/sogis2007/EPSG900913/{z}/{x}/{y}.png?origin=nw", + "template": "http://mapproxy.sosm.ch:8080/tiles/sogis2007/EPSG900913/{z}/{x}/{y}.png?origin=nw", "extent": [ - 47.06, - 7.33, - 47.5, - 8.04 + [ + 7.33, + 47.06 + ], + [ + 8.04, + 47.5 + ] ], "sourcetag": "Orthofoto 2007 WMS Solothurn" }, { "name": "Poland - Media-Lab fleet GPS masstracks", - "url": "http://masstracks.media-lab.com.pl/{z}/{x}/{y}.png", + "template": "http://masstracks.media-lab.com.pl/{z}/{x}/{y}.png", "extent": [ - 48.9, - 14, - 55, - 24.2 + [ + 14, + 48.9 + ], + [ + 24.2, + 55 + ] ], "sourcetag": "masstracks" }, { "name": "South Africa - CD:NGI Aerial", - "url": "http://{t}.aerial.openstreetmap.org.za/ngi-aerial/{z}/{x}/{y}.jpg", + "template": "http://{t}.aerial.openstreetmap.org.za/ngi-aerial/{z}/{x}/{y}.jpg", "subdomains": [ "a", "b", "c" ], "extent": [ - -34.95, - 17.64, - -22.05, - 32.87 + [ + 17.64, + -34.95 + ], + [ + 32.87, + -22.05 + ] ], "sourcetag": "ngi-aerial" } diff --git a/data/imagery_convert.js b/data/imagery_convert.js index a7253aee4..5dc36c502 100644 --- a/data/imagery_convert.js +++ b/data/imagery_convert.js @@ -36,7 +36,7 @@ $('set').each(function(i) { var im = { name: $(this).find('name').first().text(), - url: $(this).find('url').first().text() + template: $(this).find('url').first().text() }; if (censor[im.name]) return; @@ -49,7 +49,8 @@ $('set').each(function(i) { var subdomains = []; - im.url = im.url + im.template = im.template + .replace('$quadkey', '{u}') .replace(/\$(\w)/g, function(m) { return '{' + m[1] + '}'; }) @@ -62,10 +63,10 @@ $('set').each(function(i) { if (elem.attr('minlat')) { im.extent = [ - +elem.attr('minlat'), - +elem.attr('minlon'), - +elem.attr('maxlat'), - +elem.attr('maxlon')]; + [+elem.attr('minlon'), + +elem.attr('minlat')], + [+elem.attr('maxlon'), + +elem.attr('maxlat')]]; } ['default', 'sourcetag', 'logo', 'logo_url', 'terms_url'].forEach(function(a) { diff --git a/js/id/id.js b/js/id/id.js index 3bdeb9a16..20dad70d8 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -92,8 +92,7 @@ window.iD = function () { context.background() .source(_.find(iD.layers, function(l) { - console.log(_.keys(l)); - return l.name === 'Bing aerial imagery'; + return l.data.name === 'Bing aerial imagery'; })); return d3.rebind(context, dispatch, 'on'); diff --git a/js/id/renderer/background_source.js b/js/id/renderer/background_source.js index 7b204d298..3f624e1ba 100644 --- a/js/id/renderer/background_source.js +++ b/js/id/renderer/background_source.js @@ -1,11 +1,7 @@ iD.BackgroundSource = {}; // derive the url of a 'quadkey' style tile from a coordinate object -iD.BackgroundSource.template = function(options) { - var subdomains = options.subdomains || [], - template = options.template, - scaleExtent = options.scaleExtent || [0, 20]; - +iD.BackgroundSource.template = function(data) { var generator = function(coord) { var u = ''; for (var zoom = coord[2]; zoom > 0; zoom--) { @@ -15,22 +11,17 @@ iD.BackgroundSource.template = function(options) { if ((coord[1] & mask) !== 0) byte += 2; u += byte.toString(); } - // distribute requests against multiple domains - var t = subdomains ? - subdomains[coord[2] % subdomains.length] : ''; - return template - .replace('{t}', t) + + return data.template + .replace('{t}', data.subdomains ? + data.subdomains[coord[2] % data.subdomains.length] : '') .replace('{u}', u) .replace('{x}', coord[0]) .replace('{y}', coord[1]) .replace('{z}', coord[2]); }; - for (var k in options) { - generator[k] = options[k]; - console.log(k, generator[k]); - } - + generator.data = data; return generator; }; @@ -38,5 +29,9 @@ iD.BackgroundSource.template = function(options) { iD.BackgroundSource.Custom = function() { var template = window.prompt('Enter a tile template. Valid tokens are {z}, {x}, {y} for Z/X/Y scheme and {u} for quadtile scheme.'); if (!template) return null; - return iD.BackgroundSource.template(template, null, [0, 20]); + return iD.BackgroundSource.template({ + template: template, + name: 'Custom (customized)' + }); }; +iD.BackgroundSource.Custom.data = { 'name': 'Custom' }; diff --git a/js/id/renderer/layers.js b/js/id/renderer/layers.js index 9b14059ab..773e8011e 100644 --- a/js/id/renderer/layers.js +++ b/js/id/renderer/layers.js @@ -1 +1,14 @@ iD.layers = iD.data.imagery.map(iD.BackgroundSource.template); + +iD.layers.push((function() { + function custom() { + var template = window.prompt('Enter a tile template. Valid tokens are {z}, {x}, {y} for Z/X/Y scheme and {u} for quadtile scheme.'); + if (!template) return null; + return iD.BackgroundSource.template({ + template: template, + name: 'Custom (customized)' + }); + } + custom.data = { name: 'Custom' }; + return custom; +})()); diff --git a/js/id/ui/layerswitcher.js b/js/id/ui/layerswitcher.js index d5231d370..88ee45f49 100644 --- a/js/id/ui/layerswitcher.js +++ b/js/id/ui/layerswitcher.js @@ -2,13 +2,13 @@ iD.ui.layerswitcher = function(context) { var event = d3.dispatch('cancel', 'save'), opacities = [1, 0.5, 0]; - var layers = iD.data.imagery.map(iD.BackgroundSource.template); + var layers = iD.layers; function getSources() { var ext = context.map().extent(); return layers.filter(function(layer) { - return !layer.extent || - iD.geo.polygonIntersectsPolygon(layer.extent, ext); + return !layer.data.extent || + iD.geo.Extent(layer.data.extent).intersects(ext); }); } @@ -50,6 +50,17 @@ iD.ui.layerswitcher = function(context) { var opacityList = opa.append('ul') .attr('class', 'opacity-options'); + function setOpacity(d) { + context.map().tilesurface + .transition() + .style('opacity', d) + .attr('data-opacity', d); + opacityList.selectAll('li') + .classed('selected', false); + d3.select(this) + .classed('selected', true); + } + opacityList.selectAll('div.opacity') .data(opacities) .enter() @@ -57,23 +68,12 @@ iD.ui.layerswitcher = function(context) { .attr('data-original-title', function(d) { return t('layerswitcher.percent_brightness', { opacity: (d * 100) }); }) - .on('click.set-opacity', function(d) { - context.map().tilesurface - .transition() - .style('opacity', d) - .attr('data-opacity', d); - opacityList.selectAll('li') - .classed('selected', false); - d3.select(this) - .classed('selected', true); - }) + .on('click.set-opacity', setOpacity) .html("
") .call(bootstrap.tooltip().placement('top')) .append('div') .attr('class', 'opacity') - .style('opacity', function(d) { - return d; - }); + .style('opacity', String); // Make sure there is an active selection by default d3.select('.opacity-options li:nth-child(2)').classed('selected', true); @@ -81,45 +81,54 @@ iD.ui.layerswitcher = function(context) { function selectLayer(d) { content.selectAll('a.layer') .classed('selected', function(d) { - return d.source === context.background().source(); + return d === context.background().source(); }); d3.select('#attribution a') - .attr('href', d.link) - .text('provided by ' + d.name); + .attr('href', d.data.link) + .text('provided by ' + d.data.name); } - content + function clickSetSource(d) { + d3.event.preventDefault(); + if (d.data.name === 'Custom') { + var configured = d(); + if (!configured) return; + d = configured; + } + context.background().source(d); + context.history().imagery_used(d.name); + context.redraw(); + selectLayer(d); + } + + var layerList = content .append('ul') - .attr('class', 'toggle-list fillL') - .selectAll('a.layer') - .data(getSources()) - .enter() + .attr('class', 'toggle-list fillL'); + + function update() { + var layerLinks = layerList.selectAll('a.layer') + .data(getSources(), function(d) { + return d.data.name; + }); + layerLinks.exit().remove(); + layerLinks.enter() .append('li') .append('a') .attr('data-original-title', function(d) { - return d.description || ''; + return d.data.description || ''; }) .attr('href', '#') .attr('class', 'layer') .text(function(d) { - return d.name; + return d.data.name; }) .call(bootstrap.tooltip().placement('right')) - .on('click.set-source', function(d) { - d3.event.preventDefault(); - if (d.name === 'Custom') { - var configured = d.source(); - if (!configured) return; - d.source = configured; - d.name = 'Custom (configured)'; - } - context.background().source(d.source); - context.history().imagery_used(d.name); - context.redraw(); - selectLayer(d); - }) + .on('click.set-source', clickSetSource) .insert('span') .attr('class','icon toggle'); + } + + context.map().on('move.layerswitcher-update', _.debounce(update, 1000)); var adjustments = content .append('div') diff --git a/test/index.html b/test/index.html index 5f7c19b5a..b722274b2 100644 --- a/test/index.html +++ b/test/index.html @@ -35,12 +35,17 @@ + + + + + @@ -132,8 +137,6 @@ - -