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",
"lockfileVersion": 1,
"requires": true,
......
......@@ -7,8 +7,8 @@
/* global mapboxgl, turf */
const baseUrl = new URL(window.location.href).href; // returns "http://localhost:8092/"
// use `${baseUrl}something` - don't need `${baseUrl}/something`
const baseUrl = new URL(window.location.href).origin; // returns "http://localhost:8092"
// use `${baseUrl}something`
let cdmx, estaciones, ozono, fechas,
slider = document.getElementById("slider"),
......@@ -17,11 +17,11 @@ let cdmx, estaciones, ozono, fechas,
playing = false,
animate;
fetch(`${baseUrl}data/cdmx.geojson`)
fetch(`${baseUrl}/data/cdmx.geojson`)
.then(response => response.json())
.then(d => cdmx = d);
fetch(`${baseUrl}data/estaciones.geojson`)
fetch(`${baseUrl}/data/estaciones.geojson`)
.then(response => response.json())
.then(d => estaciones = d);
......@@ -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
/*const getOzono = fetch(`${baseUrl}ozono.csv`)
/*const getOzono = fetch(`${baseUrl}/ozono.csv`)
.then(response => response.text())
.then(d => Papa.parse(d))
.catch(err => console.log(err))
......@@ -136,7 +136,7 @@ map.on("style.load", async () => {
map.addSource("estaciones", {
"type": "vector",
"tiles": [`${baseUrl}estaciones/mbtiles/{z}/{x}/{y}.pbf`],
"tiles": [`${baseUrl}/estaciones/mbtiles/{z}/{x}/{y}.pbf`],
promoteId: "cve_estac"
});
......@@ -201,7 +201,7 @@ map.on("style.load", async () => {
map.addSource("cdmx", {
"type": "geojson",
//"data": `${baseUrl}estaciones.geojson`
//"data": `${baseUrl}/estaciones.geojson`
"data": cdmx,
//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