diff --git a/js/ds.js b/js/ds.js index 384c617..d89eb70 100644 --- a/js/ds.js +++ b/js/ds.js @@ -1,5 +1,5 @@ 'use strict'; -const MAPBOX_API_KEY = 'pk.eyJ1IjoiZ2VyYW5nMSIsImEiOiJjbDg5MHZxcG8wMmo3M3BudnphMWhnN2ZrIn0.SsFGVF-EMHwRYTp7njmb_Q'; +const MAPBOX_TOKEN = 'pk.eyJ1Ijoibmljb3BhIiwiYSI6ImNsZmNiZGN0ZTJzbGgzdG8xYnZxOXRvd28ifQ.nvK1VYF6lwPpA094cL83KQ'; /** * @namespace DataSpace */ @@ -25,7 +25,18 @@ DataSpace.OBJECT_ORDER = { "Object Bibliography" : null, }; /* -export const SAMPLE_ORDER = { +DataSpace.CONTEXT_ORDER = { + "Cultural Context Name" : null, + "Cultural Context Typology" : null, + "Cultural Context Chronology" : null, + "Cultural Context Era" : null, + "Cultural Context Surface" : null, + "Cultural Context Square meters" : null, + "Cultural Context Quality of the marble used/extracted" : null, + "Cultural Context Description" : null, + "Cultural Context Traces of extraction tools" : null, + "Cultural Context Amount of debris (cm3)" : null, + "Cultural Context Presence of unfinished materials" : null, }; */ @@ -107,7 +118,7 @@ DataSpace.createObjectShape = function (resource) { return shape; } /** - * @todo Refactor!! + * @todo Refactor!! Make it general... * * @param {object} report The report's JSON object * @param {string[]} images Filenames of images @@ -130,6 +141,7 @@ DataSpace.renderObjectReport = function (report, images) } resType = resKeys[0].split(' ')[0]; + // TODO use match... // TODO check if coordinates exists... const coordinates = resource['Object Coordinates'] @@ -202,7 +214,7 @@ DataSpace.printReport = function () { */ DataSpace.createMap = function (coordinates, htmlId = 'map') { const mapboxAttribution = `© Mapbox`; - const mapboxSat = `https://api.mapbox.com/v4/mapbox.satellite/18/152278/101181.webp?access_token=${MAPBOX_API_KEY}`; + const mapboxSat = `https://api.mapbox.com/v4/{id}/{z}/{x}/{y}@2x.jpg90?access_token=${MAPBOX_TOKEN}`; const streets = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: '© OpenStreetMap' @@ -210,10 +222,11 @@ DataSpace.createMap = function (coordinates, htmlId = 'map') { const satellite = L.tileLayer( mapboxSat, { - id: 'mapbox/satellite-v9', + id: 'mapbox.satellite', tileSize: 512, zoomOffset: -1, - attribution: mapboxAttribution + attribution: mapboxAttribution, + maxZoom: 18 } ); const baseMaps = { diff --git a/report/index.html b/report/index.html index e97a6ca..8528a52 100644 --- a/report/index.html +++ b/report/index.html @@ -2,6 +2,7 @@