Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aire-cdmx
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rodrigo Tapia-McClung
aire-cdmx
Commits
41bb6846
Commit
41bb6846
authored
Mar 09, 2021
by
Rodrigo Tapia-McClung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update baseUrl
parent
29f1e085
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
package-lock.json
package-lock.json
+1
-1
functions.js
public/js/functions.js
+8
-8
No files found.
package-lock.json
View file @
41bb6846
{
{
"name"
:
"aire"
,
"name"
:
"aire
-cdmx
"
,
"version"
:
"1.0.0"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
1
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"requires"
:
true
,
...
...
public/js/functions.js
View file @
41bb6846
...
@@ -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"
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment