Commit 4b5e0dda authored by Rodrigo Tapia-McClung's avatar Rodrigo Tapia-McClung

update baseUrl and package-lock

parent 83070364
{ {
"name": "pgserver", "name": "denue-tiles",
"version": "0.0.0", "version": "0.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
...@@ -4015,9 +4015,9 @@ ...@@ -4015,9 +4015,9 @@
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.8",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
}, },
"ipaddr.js": { "ipaddr.js": {
"version": "1.9.1", "version": "1.9.1",
......
...@@ -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:8093/" const baseUrl = new URL(window.location.href).origin; // returns "http://localhost:8093"
// use `${baseUrl}something` - don't need `${baseUrl}/something` // use `${baseUrl}/something`
//let selectedMunis = [{id: "09002", geom: { coordinates: [[ -99.25958633422852, 19.34791392861453 ]], type: "Polygon" }}, {id: "09012", geom: { coordinates: [[ -99.25958633422852, 19.34791392861453 ]], type: "Polygon" }}], //let selectedMunis = [{id: "09002", geom: { coordinates: [[ -99.25958633422852, 19.34791392861453 ]], type: "Polygon" }}, {id: "09012", geom: { coordinates: [[ -99.25958633422852, 19.34791392861453 ]], type: "Polygon" }}],
// selectedIDs = selectedMunis.map(m => m.id); // selectedIDs = selectedMunis.map(m => m.id);
...@@ -24,7 +24,7 @@ const tileSource = (mbtiles, minZoom, maxZoom) => { ...@@ -24,7 +24,7 @@ const tileSource = (mbtiles, minZoom, maxZoom) => {
// if serving directly from PostGIS, use "source-layer": table, if using mbtiles, use "source-layer": "denue" // if serving directly from PostGIS, use "source-layer": table, if using mbtiles, use "source-layer": "denue"
let pbfSource = { let pbfSource = {
"type": "vector", "type": "vector",
"tiles": [`${baseUrl}${mbtiles}/mbtiles/{z}/{x}/{y}.pbf`], "tiles": [`${baseUrl}/${mbtiles}/mbtiles/{z}/{x}/{y}.pbf`],
"minzoom": minZoom, "minzoom": minZoom,
"maxzoom": maxZoom, "maxzoom": maxZoom,
/*"type": "symbol", /*"type": "symbol",
...@@ -68,7 +68,7 @@ map.on("style.load", async () => { ...@@ -68,7 +68,7 @@ map.on("style.load", async () => {
// add municipios source // add municipios source
map.addSource("dim_municipio", { map.addSource("dim_municipio", {
"type": "vector", "type": "vector",
"tiles": [`${baseUrl}dim_municipio/mvt/{z}/{x}/{y}?geom_column=municipio_geom_4326&columns=municipio_cvegeo`], "tiles": [`${baseUrl}/dim_municipio/mvt/{z}/{x}/{y}?geom_column=municipio_geom_4326&columns=municipio_cvegeo`],
"maxzoom": 14, "maxzoom": 14,
"minzoom": 8, "minzoom": 8,
"promoteId": {"dim_municipio": "municipio_cvegeo"} "promoteId": {"dim_municipio": "municipio_cvegeo"}
...@@ -238,7 +238,7 @@ map.on("click", "denue", async e => { ...@@ -238,7 +238,7 @@ map.on("click", "denue", async e => {
let features = map.queryRenderedFeatures(e.point, { layers: ["denue"] }); let features = map.queryRenderedFeatures(e.point, { layers: ["denue"] });
if (features.length != 0) { if (features.length != 0) {
let denue_cve = features[0].properties["denue_cve"]; let denue_cve = features[0].properties["denue_cve"];
let denueQuery = `${baseUrl}query/dim_denue2019?columns=denue_nombre&filter=denue_cve=${denue_cve}`; let denueQuery = `${baseUrl}/query/dim_denue2019?columns=denue_nombre&filter=denue_cve=${denue_cve}`;
const response = await fetch(denueQuery); const response = await fetch(denueQuery);
const denueData = await response.json(); const denueData = await response.json();
new mapboxgl.Popup() new mapboxgl.Popup()
......
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