Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DENUE tiles
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
DENUE tiles
Commits
4b5e0dda
Commit
4b5e0dda
authored
Mar 09, 2021
by
Rodrigo Tapia-McClung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update baseUrl and package-lock
parent
83070364
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
+4
-4
functions.js
public/js/functions.js
+5
-5
No files found.
package-lock.json
View file @
4b5e0dda
{
{
"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/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lc
w=="
"integrity"
:
"sha512-
JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxe
w=="
},
},
"ipaddr.js"
:
{
"ipaddr.js"
:
{
"version"
:
"1.9.1"
,
"version"
:
"1.9.1"
,
...
...
public/js/functions.js
View file @
4b5e0dda
...
@@ -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
()
...
...
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