diff --git a/lib/mapbox-mock.js b/lib/mapbox-mock.js index 7d213fdb..eeec9ae9 100644 --- a/lib/mapbox-mock.js +++ b/lib/mapbox-mock.js @@ -17,6 +17,9 @@ module.exports = function(app) { // Mocks the Mapbox tile API. app.get('/v4/:mapid.json', oauth, function(req, res, next) { var filepath = path.resolve(path.join(__dirname,'..','test','fixtures-mapboxapi',req.params.mapid + '.json')); + if (!fs.existsSync(filepath)) { + throw new Error("fixture missing for " + filepath); + } try { var json = JSON.parse(fs.readFileSync(filepath)); } catch(err) { diff --git a/package.json b/package.json index d75233cb..3eeaf6c3 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "mapnik-omnivore": "~6.3.0", "gdal": "0.7.0", "abaculus": "1.2.1", - "mapbox-machine-styles": "2.3.1", + "mapbox-machine-styles": "4.0.3", "mapbox-studio-pro-fonts": "https://mapbox-npm.s3.amazonaws.com/package/mapbox-studio-pro-fonts-1.0.0-9870a90b713f307b9391829602f4d5857e419615.tgz", "mapbox-studio-default-fonts": "https://mapbox-npm.s3.amazonaws.com/package/mapbox-studio-default-fonts-0.0.4-4afb5235f457bd1c1a5a70fce6c2aa83bf7a851e.tgz", "mapbox-studio-default-style": "1.0.0", diff --git a/test/fixtures-mapboxapi/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6.json b/test/fixtures-mapboxapi/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6.json new file mode 100644 index 00000000..c962881c --- /dev/null +++ b/test/fixtures-mapboxapi/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6.json @@ -0,0 +1 @@ +{"attribution":"© Mapbox © OpenStreetMap Improve this map","bounds":[-180,-85.0511,180,85.0511],"center":[0,0,0],"format":"pbf","maxzoom":15,"minzoom":0,"name":"Mapbox Streets V6 + Vector Terrain V2","scheme":"xyz","tilejson":"2.0.0","tiles":["http://a.tiles.mapbox.com/v4/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibHhiYXJ0aCIsImEiOiJFVXdYcUlvIn0.bbaHTEWlnAwGgyVwJngMdQ","http://b.tiles.mapbox.com/v4/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibHhiYXJ0aCIsImEiOiJFVXdYcUlvIn0.bbaHTEWlnAwGgyVwJngMdQ"],"vector_layers":[{"description":"Generalized landcover classification","fields":{"class":"One of: wood, scrub, grass, crop, snow"},"id":"landcover","maxzoom":22,"minzoom":0,"source":"mapbox.mapbox-terrain-v2"},{"description":"","fields":{"class":"One of: shadow, highlight","level":"Brightness %. One of: 94, 90, 89, 78, 67, 56"},"id":"hillshade","maxzoom":22,"minzoom":0,"source":"mapbox.mapbox-terrain-v2"},{"description":"Elevation contour polygons","fields":{"ele":"Integer. The elevation of the contour in meters","index":"Indicator for every 2nd, 5th, or 10th contour. Coastlines are given -1. One of: 2, 5, 10, -1, null"},"id":"contour","maxzoom":22,"minzoom":0,"source":"mapbox.mapbox-terrain-v2"},{"description":"","fields":{"class":"One of: park, cemetery, hospital, school, industrial, parking, pitch, piste, agriculture, wood, scrub, grass, sand, rock, glacier","osm_id":"Unique OSM ID number","type":"OSM tag, more specific than class"},"id":"landuse","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: river, canal, stream, stream_intermittent, ditch, drain","osm_id":"Unique OSM ID number","type":"One of: river, canal, stream, ditch, drain"},"id":"waterway","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"osm_id":"Unique OSM ID number"},"id":"water","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"osm_id":"Unique OSM ID number","type":"One of: runway, taxiway, apron"},"id":"aeroway","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: fence, hedge, cliff, gate, land","osm_id":"Unique OSM ID number"},"id":"barrier_line","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"osm_id":"Unique OSM ID number"},"id":"building","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: wetland, wetland_noveg","osm_id":"Unique OSM ID number"},"id":"landuse_overlay","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path, major_rail, minor_rail","layer":"Number used for ordering overlapping tunnels. May be any integer, but most common values are -1 to -5","oneway":"Number. Oneway roads are 1, all others are 0","osm_id":"Unique OSM ID number","type":"The value of the tunnel's highway tag"},"id":"tunnel","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path, major_rail, minor_rail","oneway":"Number. Oneway roads are 1, all others are 0","osm_id":"Unique OSM ID number","type":"The value of the road's highway tag"},"id":"road","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path, major_rail, minor_rail, aerialway","layer":"Number used for ordering overlapping bridges. May be any integer, but most common values are 1 to 5","oneway":"Number. Oneway bridges are 1, all others are 0","osm_id":"Unique OSM ID number","type":"The value of the bridge's highway tag"},"id":"bridge","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"admin_level":"The OSM administrative level of the boundary. One of: 2, 3, 4","disputed":"Number. Disputed boundaries are 1, all others are 0","maritime":"Number. Maritime boundaries are 1, all others are 0"},"id":"admin","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"code":"ISO 3166-1 Alpha-2 code","name":"Local name of the country","name_de":"German name of the country","name_en":"English name of the country","name_es":"Spanish name of the country","name_fr":"French name of the country","name_ru":"Russian name of the country","name_zh":"Chinese name of the country","osm_id":"Unique OSM ID number","parent":"ISO 3166-1 Alpha-2 code of the administering/parent state, if any","scalerank":"Number, 1-6. Useful for styling text sizes","type":"One of: country, territory, disputed territory, sar"},"id":"country_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"labelrank":"Number, 1-6. Useful for styling text sizes","name":"Local or international name of the water body","name_de":"German name of the water body","name_en":"English name of the water body","name_es":"Spanish name of the water body","name_fr":"French name of the water body","name_ru":"Russian name of the water body","name_zh":"Chinese name of the water body","placement":"One of: point, line"},"id":"marine_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"abbr":"Abbreviated state name","area":"The area of the state in kilometers²","name":"Local name of the state","name_de":"German name of the state","name_en":"English name of the state","name_es":"Spanish name of the state","name_fr":"French name of the state","name_ru":"Russian name of the state","name_zh":"Chinese name of the state","osm_id":"Unique OSM ID number"},"id":"state_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"capital":"Admin level the city is a capital of, if any. One of: 2, 3, 4, null","ldir":"A hint for label placement at low zoom levels. One of: N, E, S, W, NE, SE, SW, NW, null","localrank":"Number. Priority relative to nearby places. Useful for limiting label density","name":"Local name of the place","name_de":"German name of the place","name_en":"English name of the place","name_es":"Spanish name of the place","name_fr":"French name of the place","name_ru":"Russian name of the place","name_zh":"Chinese name of the place","osm_id":"Unique OSM ID number","scalerank":"Number, 0-9 or null. Useful for styling text & marker sizes","type":"One of: city, town, village, hamlet, suburb, neighbourhood"},"id":"place_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"area":"The area of the water polygon in Mercator meters²","name":"Local name of the water body","name_de":"German name of the water body","name_en":"English name of the water body","name_es":"Spanish name of the water body","name_fr":"French name of the water body","name_ru":"Russian name of the water body","name_zh":"Chinese name of the water body","osm_id":"Unique OSM ID number"},"id":"water_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"address":"Street address of the POI","localrank":"Number. Priority relative to nearby POIs. Useful for limiting label density","maki":"The name of the Maki icon that should be used for the POI","name":"Local name of the POI","name_de":"German name of the POI","name_en":"English name of the POI","name_es":"Spanish name of the POI","name_fr":"French name of the POI","name_ru":"Russian name of the POI","name_zh":"Chinese name of the POI","network":"For rail stations, the network(s) that the station serves. Useful for icon styling","osm_id":"Unique OSM ID number","ref":"Short reference code, if any","scalerank":"Number. 1-4. Useful for styling icon sizes and minimum zoom levels","type":"The original OSM tag value","website":"URL of the POI"},"id":"poi_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path","len":"Number. Length of the road segment in Mercator meters","localrank":"Number. Used for shield points only. Priority relative to nearby shields. Useful for limiting shield density","name":"Local name of the road","name_de":"German name of the road","name_en":"English name of the road","name_es":"Spanish name of the road","name_fr":"French name of the road","name_ru":"Russian name of the road","name_zh":"Chinese name of the road","osm_id":"Unique OSM ID number","ref":"Route number of the road","reflen":"Number. How many characters long the ref tag is. Useful for shield styling","shield":"The shield style to use. One of: default, mx-federal, mx-state, us-highway, us-highway-alternate, us-highway-business, us-highway-duplex, us-interstate, us-interstate-business, us-interstate-duplex, us-interstate-truck, us-state"},"id":"road_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: river, canal, stream, stream_intermittent","name":"Local name of the waterway","name_de":"German name of the waterway","name_en":"English name of the waterway","name_es":"Spanish name of the waterway","name_fr":"French name of the waterway","name_ru":"Russian name of the waterway","name_zh":"Chinese name of the waterway","osm_id":"Unique OSM ID number","type":"One of: river, canal, stream"},"id":"waterway_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"house_num":"House number","osm_id":"Unique OSM ID number"},"id":"housenum_label","source":"mapbox.mapbox-streets-v6"}]} \ No newline at end of file diff --git a/test/fixtures-mapboxapi/mapbox.satellite,mapbox.mapbox-streets-v6.json b/test/fixtures-mapboxapi/mapbox.satellite,mapbox.mapbox-streets-v6.json new file mode 100644 index 00000000..645780cf --- /dev/null +++ b/test/fixtures-mapboxapi/mapbox.satellite,mapbox.mapbox-streets-v6.json @@ -0,0 +1 @@ +{"attribution":"© Mapbox © OpenStreetMap Improve this map © DigitalGlobe","autoscale":true,"bounds":[-180,-85,180,85],"center":[0,0,0],"format":"pbf","maxzoom":19,"minzoom":0,"name":"Mapbox Streets V6 + Watermask + Satellite (open) + Satellite","scheme":"xyz","tilejson":"2.0.0","tiles":["http://a.tiles.mapbox.com/v4/mapbox.satellite,mapbox.mapbox-streets-v6/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibHhiYXJ0aCIsImEiOiJFVXdYcUlvIn0.bbaHTEWlnAwGgyVwJngMdQ","http://b.tiles.mapbox.com/v4/mapbox.satellite,mapbox.mapbox-streets-v6/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibHhiYXJ0aCIsImEiOiJFVXdYcUlvIn0.bbaHTEWlnAwGgyVwJngMdQ"],"vector_layers":[{"fields":{},"id":"mapbox_satellite_full","source":"mapbox.satellite-full"},{"fields":{},"id":"mapbox_satellite_plus","source":"mapbox.satellite-plus"},{"fields":{},"id":"mapbox_satellite_open","source":"mapbox.satellite-open"},{"fields":{},"id":"mapbox_satellite_watermask","source":"mapbox.satellite-watermask"},{"description":"","fields":{"class":"One of: park, cemetery, hospital, school, industrial, parking, pitch, piste, agriculture, wood, scrub, grass, sand, rock, glacier","osm_id":"Unique OSM ID number","type":"OSM tag, more specific than class"},"id":"landuse","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: river, canal, stream, stream_intermittent, ditch, drain","osm_id":"Unique OSM ID number","type":"One of: river, canal, stream, ditch, drain"},"id":"waterway","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"osm_id":"Unique OSM ID number"},"id":"water","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"osm_id":"Unique OSM ID number","type":"One of: runway, taxiway, apron"},"id":"aeroway","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: fence, hedge, cliff, gate, land","osm_id":"Unique OSM ID number"},"id":"barrier_line","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"osm_id":"Unique OSM ID number"},"id":"building","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: wetland, wetland_noveg","osm_id":"Unique OSM ID number"},"id":"landuse_overlay","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path, major_rail, minor_rail","layer":"Number used for ordering overlapping tunnels. May be any integer, but most common values are -1 to -5","oneway":"Number. Oneway roads are 1, all others are 0","osm_id":"Unique OSM ID number","type":"The value of the tunnel's highway tag"},"id":"tunnel","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path, major_rail, minor_rail","oneway":"Number. Oneway roads are 1, all others are 0","osm_id":"Unique OSM ID number","type":"The value of the road's highway tag"},"id":"road","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path, major_rail, minor_rail, aerialway","layer":"Number used for ordering overlapping bridges. May be any integer, but most common values are 1 to 5","oneway":"Number. Oneway bridges are 1, all others are 0","osm_id":"Unique OSM ID number","type":"The value of the bridge's highway tag"},"id":"bridge","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"admin_level":"The OSM administrative level of the boundary. One of: 2, 3, 4","disputed":"Number. Disputed boundaries are 1, all others are 0","maritime":"Number. Maritime boundaries are 1, all others are 0"},"id":"admin","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"code":"ISO 3166-1 Alpha-2 code","name":"Local name of the country","name_de":"German name of the country","name_en":"English name of the country","name_es":"Spanish name of the country","name_fr":"French name of the country","name_ru":"Russian name of the country","name_zh":"Chinese name of the country","osm_id":"Unique OSM ID number","parent":"ISO 3166-1 Alpha-2 code of the administering/parent state, if any","scalerank":"Number, 1-6. Useful for styling text sizes","type":"One of: country, territory, disputed territory, sar"},"id":"country_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"labelrank":"Number, 1-6. Useful for styling text sizes","name":"Local or international name of the water body","name_de":"German name of the water body","name_en":"English name of the water body","name_es":"Spanish name of the water body","name_fr":"French name of the water body","name_ru":"Russian name of the water body","name_zh":"Chinese name of the water body","placement":"One of: point, line"},"id":"marine_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"abbr":"Abbreviated state name","area":"The area of the state in kilometers²","name":"Local name of the state","name_de":"German name of the state","name_en":"English name of the state","name_es":"Spanish name of the state","name_fr":"French name of the state","name_ru":"Russian name of the state","name_zh":"Chinese name of the state","osm_id":"Unique OSM ID number"},"id":"state_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"capital":"Admin level the city is a capital of, if any. One of: 2, 3, 4, null","ldir":"A hint for label placement at low zoom levels. One of: N, E, S, W, NE, SE, SW, NW, null","localrank":"Number. Priority relative to nearby places. Useful for limiting label density","name":"Local name of the place","name_de":"German name of the place","name_en":"English name of the place","name_es":"Spanish name of the place","name_fr":"French name of the place","name_ru":"Russian name of the place","name_zh":"Chinese name of the place","osm_id":"Unique OSM ID number","scalerank":"Number, 0-9 or null. Useful for styling text & marker sizes","type":"One of: city, town, village, hamlet, suburb, neighbourhood"},"id":"place_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"area":"The area of the water polygon in Mercator meters²","name":"Local name of the water body","name_de":"German name of the water body","name_en":"English name of the water body","name_es":"Spanish name of the water body","name_fr":"French name of the water body","name_ru":"Russian name of the water body","name_zh":"Chinese name of the water body","osm_id":"Unique OSM ID number"},"id":"water_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"address":"Street address of the POI","localrank":"Number. Priority relative to nearby POIs. Useful for limiting label density","maki":"The name of the Maki icon that should be used for the POI","name":"Local name of the POI","name_de":"German name of the POI","name_en":"English name of the POI","name_es":"Spanish name of the POI","name_fr":"French name of the POI","name_ru":"Russian name of the POI","name_zh":"Chinese name of the POI","network":"For rail stations, the network(s) that the station serves. Useful for icon styling","osm_id":"Unique OSM ID number","ref":"Short reference code, if any","scalerank":"Number. 1-4. Useful for styling icon sizes and minimum zoom levels","type":"The original OSM tag value","website":"URL of the POI"},"id":"poi_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path","len":"Number. Length of the road segment in Mercator meters","localrank":"Number. Used for shield points only. Priority relative to nearby shields. Useful for limiting shield density","name":"Local name of the road","name_de":"German name of the road","name_en":"English name of the road","name_es":"Spanish name of the road","name_fr":"French name of the road","name_ru":"Russian name of the road","name_zh":"Chinese name of the road","osm_id":"Unique OSM ID number","ref":"Route number of the road","reflen":"Number. How many characters long the ref tag is. Useful for shield styling","shield":"The shield style to use. One of: default, mx-federal, mx-state, us-highway, us-highway-alternate, us-highway-business, us-highway-duplex, us-interstate, us-interstate-business, us-interstate-duplex, us-interstate-truck, us-state"},"id":"road_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: river, canal, stream, stream_intermittent","name":"Local name of the waterway","name_de":"German name of the waterway","name_en":"English name of the waterway","name_es":"Spanish name of the waterway","name_fr":"French name of the waterway","name_ru":"Russian name of the waterway","name_zh":"Chinese name of the waterway","osm_id":"Unique OSM ID number","type":"One of: river, canal, stream"},"id":"waterway_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"house_num":"House number","osm_id":"Unique OSM ID number"},"id":"housenum_label","source":"mapbox.mapbox-streets-v6"}]} \ No newline at end of file diff --git a/test/fixtures-mapboxapi/mapbox.satellite,mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6.json b/test/fixtures-mapboxapi/mapbox.satellite,mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6.json new file mode 100644 index 00000000..a2d7faf0 --- /dev/null +++ b/test/fixtures-mapboxapi/mapbox.satellite,mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6.json @@ -0,0 +1 @@ +{"attribution":"© Mapbox © OpenStreetMap Improve this map © DigitalGlobe","autoscale":true,"bounds":[-180,-85,180,85],"center":[0,0,0],"format":"pbf","maxzoom":19,"minzoom":0,"name":"Mapbox Streets V6 + Vector Terrain V2 + Watermask + Satellite (open) + Satellite","scheme":"xyz","tilejson":"2.0.0","tiles":["http://a.tiles.mapbox.com/v4/mapbox.satellite,mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibHhiYXJ0aCIsImEiOiJFVXdYcUlvIn0.bbaHTEWlnAwGgyVwJngMdQ","http://b.tiles.mapbox.com/v4/mapbox.satellite,mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibHhiYXJ0aCIsImEiOiJFVXdYcUlvIn0.bbaHTEWlnAwGgyVwJngMdQ"],"vector_layers":[{"fields":{},"id":"mapbox_satellite_full","source":"mapbox.satellite-full"},{"fields":{},"id":"mapbox_satellite_plus","source":"mapbox.satellite-plus"},{"fields":{},"id":"mapbox_satellite_open","source":"mapbox.satellite-open"},{"fields":{},"id":"mapbox_satellite_watermask","source":"mapbox.satellite-watermask"},{"description":"Generalized landcover classification","fields":{"class":"One of: wood, scrub, grass, crop, snow"},"id":"landcover","maxzoom":22,"minzoom":0,"source":"mapbox.mapbox-terrain-v2"},{"description":"","fields":{"class":"One of: shadow, highlight","level":"Brightness %. One of: 94, 90, 89, 78, 67, 56"},"id":"hillshade","maxzoom":22,"minzoom":0,"source":"mapbox.mapbox-terrain-v2"},{"description":"Elevation contour polygons","fields":{"ele":"Integer. The elevation of the contour in meters","index":"Indicator for every 2nd, 5th, or 10th contour. Coastlines are given -1. One of: 2, 5, 10, -1, null"},"id":"contour","maxzoom":22,"minzoom":0,"source":"mapbox.mapbox-terrain-v2"},{"description":"","fields":{"class":"One of: park, cemetery, hospital, school, industrial, parking, pitch, piste, agriculture, wood, scrub, grass, sand, rock, glacier","osm_id":"Unique OSM ID number","type":"OSM tag, more specific than class"},"id":"landuse","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: river, canal, stream, stream_intermittent, ditch, drain","osm_id":"Unique OSM ID number","type":"One of: river, canal, stream, ditch, drain"},"id":"waterway","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"osm_id":"Unique OSM ID number"},"id":"water","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"osm_id":"Unique OSM ID number","type":"One of: runway, taxiway, apron"},"id":"aeroway","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: fence, hedge, cliff, gate, land","osm_id":"Unique OSM ID number"},"id":"barrier_line","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"osm_id":"Unique OSM ID number"},"id":"building","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: wetland, wetland_noveg","osm_id":"Unique OSM ID number"},"id":"landuse_overlay","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path, major_rail, minor_rail","layer":"Number used for ordering overlapping tunnels. May be any integer, but most common values are -1 to -5","oneway":"Number. Oneway roads are 1, all others are 0","osm_id":"Unique OSM ID number","type":"The value of the tunnel's highway tag"},"id":"tunnel","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path, major_rail, minor_rail","oneway":"Number. Oneway roads are 1, all others are 0","osm_id":"Unique OSM ID number","type":"The value of the road's highway tag"},"id":"road","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path, major_rail, minor_rail, aerialway","layer":"Number used for ordering overlapping bridges. May be any integer, but most common values are 1 to 5","oneway":"Number. Oneway bridges are 1, all others are 0","osm_id":"Unique OSM ID number","type":"The value of the bridge's highway tag"},"id":"bridge","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"admin_level":"The OSM administrative level of the boundary. One of: 2, 3, 4","disputed":"Number. Disputed boundaries are 1, all others are 0","maritime":"Number. Maritime boundaries are 1, all others are 0"},"id":"admin","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"code":"ISO 3166-1 Alpha-2 code","name":"Local name of the country","name_de":"German name of the country","name_en":"English name of the country","name_es":"Spanish name of the country","name_fr":"French name of the country","name_ru":"Russian name of the country","name_zh":"Chinese name of the country","osm_id":"Unique OSM ID number","parent":"ISO 3166-1 Alpha-2 code of the administering/parent state, if any","scalerank":"Number, 1-6. Useful for styling text sizes","type":"One of: country, territory, disputed territory, sar"},"id":"country_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"labelrank":"Number, 1-6. Useful for styling text sizes","name":"Local or international name of the water body","name_de":"German name of the water body","name_en":"English name of the water body","name_es":"Spanish name of the water body","name_fr":"French name of the water body","name_ru":"Russian name of the water body","name_zh":"Chinese name of the water body","placement":"One of: point, line"},"id":"marine_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"abbr":"Abbreviated state name","area":"The area of the state in kilometers²","name":"Local name of the state","name_de":"German name of the state","name_en":"English name of the state","name_es":"Spanish name of the state","name_fr":"French name of the state","name_ru":"Russian name of the state","name_zh":"Chinese name of the state","osm_id":"Unique OSM ID number"},"id":"state_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"capital":"Admin level the city is a capital of, if any. One of: 2, 3, 4, null","ldir":"A hint for label placement at low zoom levels. One of: N, E, S, W, NE, SE, SW, NW, null","localrank":"Number. Priority relative to nearby places. Useful for limiting label density","name":"Local name of the place","name_de":"German name of the place","name_en":"English name of the place","name_es":"Spanish name of the place","name_fr":"French name of the place","name_ru":"Russian name of the place","name_zh":"Chinese name of the place","osm_id":"Unique OSM ID number","scalerank":"Number, 0-9 or null. Useful for styling text & marker sizes","type":"One of: city, town, village, hamlet, suburb, neighbourhood"},"id":"place_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"area":"The area of the water polygon in Mercator meters²","name":"Local name of the water body","name_de":"German name of the water body","name_en":"English name of the water body","name_es":"Spanish name of the water body","name_fr":"French name of the water body","name_ru":"Russian name of the water body","name_zh":"Chinese name of the water body","osm_id":"Unique OSM ID number"},"id":"water_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"address":"Street address of the POI","localrank":"Number. Priority relative to nearby POIs. Useful for limiting label density","maki":"The name of the Maki icon that should be used for the POI","name":"Local name of the POI","name_de":"German name of the POI","name_en":"English name of the POI","name_es":"Spanish name of the POI","name_fr":"French name of the POI","name_ru":"Russian name of the POI","name_zh":"Chinese name of the POI","network":"For rail stations, the network(s) that the station serves. Useful for icon styling","osm_id":"Unique OSM ID number","ref":"Short reference code, if any","scalerank":"Number. 1-4. Useful for styling icon sizes and minimum zoom levels","type":"The original OSM tag value","website":"URL of the POI"},"id":"poi_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: motorway, motorway_link, main, street, street_limited, service, driveway, path","len":"Number. Length of the road segment in Mercator meters","localrank":"Number. Used for shield points only. Priority relative to nearby shields. Useful for limiting shield density","name":"Local name of the road","name_de":"German name of the road","name_en":"English name of the road","name_es":"Spanish name of the road","name_fr":"French name of the road","name_ru":"Russian name of the road","name_zh":"Chinese name of the road","osm_id":"Unique OSM ID number","ref":"Route number of the road","reflen":"Number. How many characters long the ref tag is. Useful for shield styling","shield":"The shield style to use. One of: default, mx-federal, mx-state, us-highway, us-highway-alternate, us-highway-business, us-highway-duplex, us-interstate, us-interstate-business, us-interstate-duplex, us-interstate-truck, us-state"},"id":"road_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"class":"One of: river, canal, stream, stream_intermittent","name":"Local name of the waterway","name_de":"German name of the waterway","name_en":"English name of the waterway","name_es":"Spanish name of the waterway","name_fr":"French name of the waterway","name_ru":"Russian name of the waterway","name_zh":"Chinese name of the waterway","osm_id":"Unique OSM ID number","type":"One of: river, canal, stream"},"id":"waterway_label","source":"mapbox.mapbox-streets-v6"},{"description":"","fields":{"house_num":"House number","osm_id":"Unique OSM ID number"},"id":"housenum_label","source":"mapbox.mapbox-streets-v6"}]} \ No newline at end of file diff --git a/test/middleware.test.js b/test/middleware.test.js index c0592d61..a1329ab0 100644 --- a/test/middleware.test.js +++ b/test/middleware.test.js @@ -171,7 +171,9 @@ test('examples: gets style info', function(t) { 'mapbox-studio-pirates', 'mapbox-studio-run-bike-hike', 'mapbox-studio-satellite-afternoon', + 'mapbox-studio-satellite-outdoors', 'mapbox-studio-streets-basic', + 'mapbox-studio-streets-overlay', 'mapbox-studio-streets-satellite', 'mapbox-studio-streets', 'mapbox-studio-wheatpaste' diff --git a/test/style-examples.test.js b/test/style-examples.test.js index b6b48641..c99f3d92 100644 --- a/test/style-examples.test.js +++ b/test/style-examples.test.js @@ -29,7 +29,9 @@ for (var key in style.examples) (function(key) { test(key, function(t) { style(style.examples[key], function(err, s) { t.ifError(err); - t.ok(!s.data._prefs.mapid, 'no mapid set'); + if (!err && !s) { + t.ok(!s.data._prefs.mapid, 'no mapid set'); + } t.end(); }); });