Commit 41bb6846 authored by Rodrigo Tapia-McClung's avatar Rodrigo Tapia-McClung

update baseUrl

parent 29f1e085
{ {
"name": "aire", "name": "aire-cdmx",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
/* global mapboxgl, turf */ /* global mapboxgl, turf */
const baseUrl = new URL(window.location.href).href; // returns "http://localhost:8092/" const baseUrl = new URL(window.location.href).origin; // returns "http://localhost:8092"
// use `${baseUrl}something` - don't need `${baseUrl}/something` // use `${baseUrl}something`
let cdmx, estaciones, ozono, fechas, let cdmx, estaciones, ozono, fechas,
slider = document.getElementById("slider"), slider = document.getElementById("slider"),
...@@ -17,11 +17,11 @@ let cdmx, estaciones, ozono, fechas, ...@@ -17,11 +17,11 @@ let cdmx, estaciones, ozono, fechas,
playing = false, playing = false,
animate; animate;
fetch(`${baseUrl}data/cdmx.geojson`) fetch(`${baseUrl}/data/cdmx.geojson`)
.then(response => response.json()) .then(response => response.json())
.then(d => cdmx = d); .then(d => cdmx = d);
fetch(`${baseUrl}data/estaciones.geojson`) fetch(`${baseUrl}/data/estaciones.geojson`)
.then(response => response.json()) .then(response => response.json())
.then(d => estaciones = d); .then(d => estaciones = d);
...@@ -37,9 +37,9 @@ const papaPromise = url => { ...@@ -37,9 +37,9 @@ const papaPromise = url => {
}); });
} }
let ozonoPromise = papaPromise(`${baseUrl}data/ozono.csv`); // ozono es en ppb: 10^12 let ozonoPromise = papaPromise(`${baseUrl}/data/ozono.csv`); // ozono es en ppb: 10^12
// FIXME: check and fix date order in data // FIXME: check and fix date order in data
/*const getOzono = fetch(`${baseUrl}ozono.csv`) /*const getOzono = fetch(`${baseUrl}/ozono.csv`)
.then(response => response.text()) .then(response => response.text())
.then(d => Papa.parse(d)) .then(d => Papa.parse(d))
.catch(err => console.log(err)) .catch(err => console.log(err))
...@@ -136,7 +136,7 @@ map.on("style.load", async () => { ...@@ -136,7 +136,7 @@ map.on("style.load", async () => {
map.addSource("estaciones", { map.addSource("estaciones", {
"type": "vector", "type": "vector",
"tiles": [`${baseUrl}estaciones/mbtiles/{z}/{x}/{y}.pbf`], "tiles": [`${baseUrl}/estaciones/mbtiles/{z}/{x}/{y}.pbf`],
promoteId: "cve_estac" promoteId: "cve_estac"
}); });
...@@ -201,7 +201,7 @@ map.on("style.load", async () => { ...@@ -201,7 +201,7 @@ map.on("style.load", async () => {
map.addSource("cdmx", { map.addSource("cdmx", {
"type": "geojson", "type": "geojson",
//"data": `${baseUrl}estaciones.geojson` //"data": `${baseUrl}/estaciones.geojson`
"data": cdmx, "data": cdmx,
//promoteId: "cve_estac" //promoteId: "cve_estac"
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment