Commit 1eefd883 authored by Rodrigo Tapia-McClung's avatar Rodrigo Tapia-McClung

Upadte folder organization. Fix API call base URLs

parent cda79300
...@@ -6,23 +6,23 @@ ...@@ -6,23 +6,23 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Proyecto FORDECyT 2018 - 10</title> <title>Proyecto FORDECyT 2018 - 10</title>
<link rel="stylesheet" type="text/css" href="../css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous"> integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="../css/cover_style.css"> <link rel="stylesheet" type="text/css" href="css/cover_style.css">
<link rel="icon" href="../img/monitoreo.png" sizes="16x16"> <link rel="icon" href="img/monitoreo.png" sizes="16x16">
</head> </head>
<body> <body>
<nav class="navbar navbar-expand-lg navbar-light bg-light sb-navbar"> <nav class="navbar navbar-expand-lg navbar-light bg-light sb-navbar">
<div class="container"> <div class="container">
<a class="navbar-brand" href="http://www.centrogeo.org.mx/"> <a class="navbar-brand" href="http://www.centrogeo.org.mx/">
<img src="../img/centrogeo.png" height="70" alt="CentroGeo"> <img src="img/centrogeo.png" height="70" alt="CentroGeo">
</a> </a>
<a class="mr-sm-2" href="http://conacyt.gob.mx/"> <a class="mr-sm-2" href="http://conacyt.gob.mx/">
<img src="../img/conacyt.png" height="70" alt="CONACyT"> <img src="img/conacyt.png" height="70" alt="CONACyT">
</a> </a>
</nav> </nav>
...@@ -57,12 +57,12 @@ ...@@ -57,12 +57,12 @@
<div class="card-body"> <div class="card-body">
<div class="hovereffect zoom"> <div class="hovereffect zoom">
<img class="card-img" <img class="card-img"
src="../img/sumidero.jpg" alt="Ca&ntilde;&oacute;n del Sumidero"> src="img/sumidero.jpg" alt="Ca&ntilde;&oacute;n del Sumidero">
<span class="photo-credit">Foto: Gabriela L&oacute;pez</span> <span class="photo-credit">Foto: Gabriela L&oacute;pez</span>
<div class="overlay"> <div class="overlay">
<a class="info" href="../grijalva"> <a class="info" href="grijalva/">
<img class="hoverimg mx-auto d-block" src="../img/cuenca.png" width="325px"> <img class="hoverimg mx-auto d-block" src="img/cuenca.png" width="325px">
<span class="btn btn-primary hoverbtn" href="../grijalva" role="button">Visitar <span class="btn btn-primary hoverbtn" href="grijalva/" role="button">Visitar
sitio</span> sitio</span>
<br><br> <br><br>
</a> </a>
...@@ -77,12 +77,12 @@ ...@@ -77,12 +77,12 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="hovereffect zoom"> <div class="hovereffect zoom">
<img class="card-img" src="../img/centropais.jpg" alt="CMCP"> <img class="card-img" src="img/centropais.jpg" alt="CMCP">
<span class="photo-credit">Foto: Lucy Nieto</span> <span class="photo-credit">Foto: Lucy Nieto</span>
<div class="overlay"> <div class="overlay">
<a class="info" href="../centropais"> <a class="info" href="centropais/">
<img class="hoverimg mx-auto d-block" src="../img/cmcp.png" width="325px"> <img class="hoverimg mx-auto d-block" src="img/cmcp.png" width="325px">
<span class="btn btn-primary hoverbtn" href="../centropais" role="button">Visitar <span class="btn btn-primary hoverbtn" href="centropais/" role="button">Visitar
sitio</span> sitio</span>
<br><br> <br><br>
</a> </a>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<footer class="pt-4 my-md-5 pt-md-5 border-top"> <footer class="pt-4 my-md-5 pt-md-5 border-top">
<div class="row"> <div class="row">
<div class="col-12 col-md"> <div class="col-12 col-md">
<img class="mb-2" src="../img/geoint.png" alt="GeoInt" height="70px"> <img class="mb-2" src="img/geoint.png" alt="GeoInt" height="70px">
<small class="d-block mb-3 text-muted">&copy; 2019</small> <small class="d-block mb-3 text-muted">&copy; 2019</small>
</div> </div>
<div class="col-6 col-md"> <div class="col-6 col-md">
......
...@@ -26,8 +26,9 @@ const getData = async () => { ...@@ -26,8 +26,9 @@ const getData = async () => {
data[indicator].push({name: `${indicator}0`, values: []}); data[indicator].push({name: `${indicator}0`, values: []});
}); });
const userFilePromises = userFiles.map( async monthYear => { const baseUrl = new URL(`/data`, window.location.href).href;
let queryDB = `../data/query/${monthYear}?columns=${queryColumns.join(",")}`; const userFilePromises = userFiles.map( async monthYear => {
let queryDB = `${baseUrl}/query/${monthYear}?columns=${queryColumns.join(",")}`;
const dbData = await d3.json(queryDB); const dbData = await d3.json(queryDB);
return {date: timeParse(monthYear), value: dbData[0]}; return {date: timeParse(monthYear), value: dbData[0]};
}); });
...@@ -56,6 +57,8 @@ const getDataInSelection = async () => { ...@@ -56,6 +57,8 @@ const getDataInSelection = async () => {
data[indicator] = []; data[indicator] = [];
}); });
const baseUrl = new URL(`/data`, window.location.href).href;
// Convert drawn items to GeoJSON and check what's inside each one of them // Convert drawn items to GeoJSON and check what's inside each one of them
const drawnItemPromises = drawnItems.toGeoJSON().features.map( async (item, i) => { const drawnItemPromises = drawnItems.toGeoJSON().features.map( async (item, i) => {
// set SRID fro drawn features // set SRID fro drawn features
...@@ -67,7 +70,7 @@ const getDataInSelection = async () => { ...@@ -67,7 +70,7 @@ const getDataInSelection = async () => {
let filter = `ST_Intersects(geom, (SELECT ST_Multi(ST_GeomFromGeoJSON('${JSON.stringify(geojson.features[i].geometry)}') ) ) )` let filter = `ST_Intersects(geom, (SELECT ST_Multi(ST_GeomFromGeoJSON('${JSON.stringify(geojson.features[i].geometry)}') ) ) )`
const userFilePromises = userFiles.map(async monthYear => { const userFilePromises = userFiles.map(async monthYear => {
let queryData = `../data/query/${monthYear}?columns=${queryColumns.join(",")}&filter=${filter}&group=1%3D1`; let queryData = `${baseUrl}/query/${monthYear}?columns=${queryColumns.join(",")}&filter=${filter}&group=1%3D1`;
const selectionQuery = await d3.json(queryData); const selectionQuery = await d3.json(queryData);
return {date: timeParse(monthYear), value: selectionQuery[0]}; return {date: timeParse(monthYear), value: selectionQuery[0]};
}); });
......
...@@ -99,7 +99,8 @@ const sortInitialDateAscending = (a, b) => { ...@@ -99,7 +99,8 @@ const sortInitialDateAscending = (a, b) => {
// query available dates on DB // query available dates on DB
const setupDates = () => { const setupDates = () => {
return new Promise( resolve => { return new Promise( resolve => {
let layersQuery = "../data/list_layers"; const baseUrl = new URL(`/data`, window.location.href).href;
let layersQuery = `${baseUrl}/list_layers`;
d3.json(layersQuery).then(layers => { d3.json(layersQuery).then(layers => {
layers.forEach(layer => { layers.forEach(layer => {
dateArray.push(timeParse(layer.f_table_name)); // convert filenames to dates dateArray.push(timeParse(layer.f_table_name)); // convert filenames to dates
...@@ -331,7 +332,8 @@ const queryFiles = () => { ...@@ -331,7 +332,8 @@ const queryFiles = () => {
const getMinMax = table => { const getMinMax = table => {
return new Promise( resolve => { return new Promise( resolve => {
let minmaxQuery = `../data/query/${table}?columns=${cols.join(", ")}`; const baseUrl = new URL(`/data`, window.location.href).href;
let minmaxQuery = `${baseUrl}/query/${table}?columns=${cols.join(", ")}`;
d3.json(minmaxQuery).then( minmax => { d3.json(minmaxQuery).then( minmax => {
resolve(minmax[0]); resolve(minmax[0]);
}); });
......
...@@ -151,7 +151,7 @@ let layer_limiteEstatal = new L.tileLayer.wms("http://gaia.inegi.org.mx/NLB/tunn ...@@ -151,7 +151,7 @@ let layer_limiteEstatal = new L.tileLayer.wms("http://gaia.inegi.org.mx/NLB/tunn
transparent: true, transparent: true,
pane: "pane_estatal", pane: "pane_estatal",
attribution: "INEGI 2019" //, attribution: "INEGI 2019" //,
// minZoom: 9 // minZoom: 9
}); });
// // AGEBS RURAL // // AGEBS RURAL
// let agebrur = new L.tileLayer.wms("http://gaia.inegi.org.mx/NLB/tunnel/wms/wms61?", { // let agebrur = new L.tileLayer.wms("http://gaia.inegi.org.mx/NLB/tunnel/wms/wms61?", {
...@@ -250,7 +250,7 @@ let layer_pistasaereas = new L.geoJson(null, { ...@@ -250,7 +250,7 @@ let layer_pistasaereas = new L.geoJson(null, {
borderWidth: 0, borderWidth: 0,
borderColor: "transparent", borderColor: "transparent",
backgroundColor: "transparent" //, backgroundColor: "transparent" //,
// textColor: "#C0C0C0" // textColor: "#C0C0C0"
}); });
return new L.Marker(latlng, { return new L.Marker(latlng, {
icon: avionMarker icon: avionMarker
...@@ -283,7 +283,7 @@ let layer_autobuses = new L.geoJson(null, { ...@@ -283,7 +283,7 @@ let layer_autobuses = new L.geoJson(null, {
borderWidth: 0, borderWidth: 0,
borderColor: "transparent", borderColor: "transparent",
backgroundColor: "transparent" //, backgroundColor: "transparent" //,
// textColor: "#C0C0C0" // textColor: "#C0C0C0"
}); });
return new L.Marker(latlng, { return new L.Marker(latlng, {
icon: busMarker icon: busMarker
...@@ -569,47 +569,47 @@ let layer_hoteles = new L.geoJson(null, { ...@@ -569,47 +569,47 @@ let layer_hoteles = new L.geoJson(null, {
// const style_cuencas = () => { // const style_cuencas = () => {
const style_cuencas = feature => { const style_cuencas = feature => {
switch (String(feature.properties["Subregion"])) { switch (String(feature.properties["Subregion"])) {
case "Bajo Grijalva o Grijalva-Villahermosa": case "Bajo Grijalva o Grijalva-Villahermosa":
return { return {
pane: "pane_cuencas", pane: "pane_cuencas",
opacity: 1, opacity: 1,
color: "rgba(168,0,0,0.2)", color: "rgba(168,0,0,0.2)",
dashArray: "", dashArray: "",
lineCap: "butt", lineCap: "butt",
lineJoin: "miter", lineJoin: "miter",
weight: 1.0, weight: 1.0,
fill: true, fill: true,
fillOpacity: 1, fillOpacity: 1,
fillColor: "rgba(255,255,190,0.2)" fillColor: "rgba(255,255,190,0.2)"
} }
case "Medio Grijalva o Grijalva-Tuxtla Gutiérrez": case "Medio Grijalva o Grijalva-Tuxtla Gutiérrez":
return { return {
pane: "pane_cuencas", pane: "pane_cuencas",
opacity: 1, opacity: 1,
color: "rgba(168,0,0,0.2)", color: "rgba(168,0,0,0.2)",
dashArray: "", dashArray: "",
lineCap: "butt", lineCap: "butt",
lineJoin: "miter", lineJoin: "miter",
weight: 1.0, weight: 1.0,
fill: true, fill: true,
fillOpacity: 1, fillOpacity: 1,
fillColor: "rgba(255,170,0,0.2)" fillColor: "rgba(255,170,0,0.2)"
} }
case "Alto Grijalva o Grijalva-La Concordia": case "Alto Grijalva o Grijalva-La Concordia":
return { return {
pane: "pane_cuencas", pane: "pane_cuencas",
opacity: 1, opacity: 1,
color: "rgba(168,0,0,0.2)", color: "rgba(168,0,0,0.2)",
dashArray: "", dashArray: "",
lineCap: "butt", lineCap: "butt",
lineJoin: "miter", lineJoin: "miter",
weight: 1.0, weight: 1.0,
fill: true, fill: true,
fillOpacity: 1, fillOpacity: 1,
fillColor: "rgba(168,56,0,0.2)" fillColor: "rgba(168,56,0,0.2)"
} }
} }
} }
...@@ -642,34 +642,34 @@ let layer_limZMs = new L.geoJson(null, { ...@@ -642,34 +642,34 @@ let layer_limZMs = new L.geoJson(null, {
const style_ZMs = feature => { const style_ZMs = feature => {
switch (String(feature.properties["ZM_NOMBRE"])) { switch (String(feature.properties["ZM_NOMBRE"])) {
case "Tuxtla Gutiérrez": case "Tuxtla Gutiérrez":
return { return {
pane: "pane_ZMs", pane: "pane_ZMs",
opacity: 1, opacity: 1,
color: "rgba(139,47,0,0.6)", color: "rgba(139,47,0,0.6)",
dashArray: "", dashArray: "",
lineCap: "butt", lineCap: "butt",
lineJoin: "miter", lineJoin: "miter",
weight: 1.0, weight: 1.0,
fill: true, fill: true,
fillOpacity: 1, fillOpacity: 1,
fillColor: "rgba(139,60,0,0.6)" fillColor: "rgba(139,60,0,0.6)"
} }
//break; //break;
case "Villahermosa": case "Villahermosa":
return { return {
pane: "pane_ZMs", pane: "pane_ZMs",
opacity: 1, opacity: 1,
color: "rgba(139,47,0,0.6)", color: "rgba(139,47,0,0.6)",
dashArray: "", dashArray: "",
lineCap: "butt", lineCap: "butt",
lineJoin: "miter", lineJoin: "miter",
weight: 1.0, weight: 1.0,
fill: true, fill: true,
fillOpacity: 1, fillOpacity: 1,
fillColor: "rgba(207,152,62,0.6)" fillColor: "rgba(207,152,62,0.6)"
} }
//break; //break;
} }
} }
...@@ -903,7 +903,7 @@ const makeBaseMap = () => { ...@@ -903,7 +903,7 @@ const makeBaseMap = () => {
zip2Lyr("../riesgos/data/Supermercados y tiendas departamentales.zip", supermercados, layer_supermercados); zip2Lyr("../riesgos/data/Supermercados y tiendas departamentales.zip", supermercados, layer_supermercados);
layerControl.addOverlay(layer_supermercados, "Supermercados y tiendas departamentales<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fa fa-shopping-cart\" style=\"color:#409400;margin-top:3px; margin-left:0px;font-size: 13px;\"></i> Supermercados<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fa fa-shopping-cart\" style=\"color:#df6400;margin-top:3px; margin-left:0px;font-size: 13px;\"></i> Tiendas Departamentales"); layerControl.addOverlay(layer_supermercados, "Supermercados y tiendas departamentales<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fa fa-shopping-cart\" style=\"color:#409400;margin-top:3px; margin-left:0px;font-size: 13px;\"></i> Supermercados<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fa fa-shopping-cart\" style=\"color:#df6400;margin-top:3px; margin-left:0px;font-size: 13px;\"></i> Tiendas Departamentales");
zip2Lyr("../riesgos/data/Bancos.zip", bancos, layer_bancos); zip2Lyr("../riesgos/data/Bancos.zip", bancos, layer_bancos);
layerControl.addOverlay(layer_bancos, "<i class=\"fa fa-dollar\" style=\"color:#7fbd7e;margin-top:3px; margin-left:0px;font-size: 13px;\"></i> Bancos;"); layerControl.addOverlay(layer_bancos, "<i class=\"fa fa-dollar\" style=\"color:#7fbd7e;margin-top:3px; margin-left:0px;font-size: 13px;\"></i> Bancos");
zip2Lyr("../riesgos/data/Aeropuertos y pistas aereas.zip", pistasaereas, layer_pistasaereas); zip2Lyr("../riesgos/data/Aeropuertos y pistas aereas.zip", pistasaereas, layer_pistasaereas);
layerControl.addOverlay(aeropuertosypistasaereas, "Aeropuertos y pistas<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=\"http://gaia.inegi.org.mx/NLB/tunnel/wms/wms61?version=1.3.0&service=WMS&request=GetLegendGraphic&sld_version=1.1.0&layer=c201&format=image/png&STYLE=default\" alt=\"Aeropuertos\"/></i> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fa fa-plane\" style=\"color:#808080;margin-top:3px; margin-left:0px;font-size: 15px;\"></i> &nbsp;&nbsp; &nbsp;&nbsp;Pistas aéreas"); layerControl.addOverlay(aeropuertosypistasaereas, "Aeropuertos y pistas<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=\"http://gaia.inegi.org.mx/NLB/tunnel/wms/wms61?version=1.3.0&service=WMS&request=GetLegendGraphic&sld_version=1.1.0&layer=c201&format=image/png&STYLE=default\" alt=\"Aeropuertos\"/></i> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fa fa-plane\" style=\"color:#808080;margin-top:3px; margin-left:0px;font-size: 15px;\"></i> &nbsp;&nbsp; &nbsp;&nbsp;Pistas aéreas");
zip2Lyr("../riesgos/data/Central de autobuses.zip", autobuses, layer_autobuses); zip2Lyr("../riesgos/data/Central de autobuses.zip", autobuses, layer_autobuses);
...@@ -920,113 +920,113 @@ const makeBaseMap = () => { ...@@ -920,113 +920,113 @@ const makeBaseMap = () => {
// Localize Leaflet.Draw texts // Localize Leaflet.Draw texts
L.drawLocal = { L.drawLocal = {
draw: { draw: {
toolbar: { toolbar: {
actions: { actions: {
title: "Cancelar dibujo", title: "Cancelar dibujo",
text: "Cancelar" text: "Cancelar"
}, },
finish: { finish: {
title: "Terminar dibujo", title: "Terminar dibujo",
text: "Terminar" text: "Terminar"
}, },
undo: { undo: {
title: "Eliminar último punto dibujado", title: "Eliminar último punto dibujado",
text: "Eliminar último punto" text: "Eliminar último punto"
},
buttons: {
polyline: "Dibujar una polilínea",
polygon: "Dibujar un polígono",
rectangle: "Dibujar un rectángulo",
circle: "Dibujar un círculo",
marker: "Dibujar un marcador",
circlemarker: "Dibujar un marcador circular"
}
},
handlers: {
circle: {
tooltip: {
start: "Haz click y arrastra para dibujar un círculo"
}, },
buttons: { radius: "Radio"
polyline: "Dibujar una polilínea", },
polygon: "Dibujar un polígono", circlemarker: {
rectangle: "Dibujar un rectángulo", tooltip: {
circle: "Dibujar un círculo", start: "Haz click en el mapa para ubicar el marcador circular"
marker: "Dibujar un marcador",
circlemarker: "Dibujar un marcador circular"
} }
}, },
handlers: { marker: {
circle: { tooltip: {
tooltip: { start: "Haz click en el mapa para ubicar el marcador"
start: "Haz click y arrastra para dibujar un círculo" }
}, },
radius: "Radio" polygon: {
}, error: "<strong>Error:</strong>",
circlemarker: { tooltip: {
tooltip: { start: "Haz click para empezar a dibujar la figura",
start: "Haz click en el mapa para ubicar el marcador circular" cont: "Haz click para continuar dibujando la figura",
} end: "Haz click en el primer punto para cerrar la figura"
}, }
marker: { },
tooltip: { polyline: {
start: "Haz click en el mapa para ubicar el marcador" error: "<strong>Error:</strong> las líneas no deben cruzarse",
} tooltip: {
}, start: "Haz click para empezar a dibujar la línea",
polygon: { cont: "Haz click para continuar dibujando la línea",
error: "<strong>Error:</strong>", end: "Haz click en el último punto para terminar la línea"
tooltip: { }
start: "Haz click para empezar a dibujar la figura", },
cont: "Haz click para continuar dibujando la figura", rectangle: {
end: "Haz click en el primer punto para cerrar la figura" tooltip: {
} start: "Haz click y arrastra para dibujar un rectángulo"
}, }
polyline: { },
error: "<strong>Error:</strong> las líneas no deben cruzarse", simpleshape: {
tooltip: { tooltip: {
start: "Haz click para empezar a dibujar la línea", end: "Suelta el ratón para terminar de dibujar"
cont: "Haz click para continuar dibujando la línea", }
end: "Haz click en el último punto para terminar la línea" }
} }
},
edit: {
toolbar: {
actions: {
save: {
title: "Guardar los cambios",
text: "Guardar"
}, },
rectangle: { cancel: {
tooltip: { title: "Cancelar la edición, descarta todos los cambios",
start: "Haz click y arrastra para dibujar un rectángulo" text: "Cancelar"
}
}, },
simpleshape: { clearAll: {
tooltip: { title: "Limpiar todas las capas",
end: "Suelta el ratón para terminar de dibujar" text: "Limpiar todo"
}
} }
},
buttons: {
edit: "Editar capas",
editDisabled: "No hay capas que editar",
remove: "Eliminar capas",
removeDisabled: "No hay capas que eliminar"
} }
}, },
edit: { handlers: {
toolbar: { edit: {
actions: { tooltip: {
save: { text: "Arrastra el marcador para editar la figura",
title: "Guardar los cambios", subtext: "Haz click en cancelar para deshacer los cambios"
text: "Guardar"
},
cancel: {
title: "Cancelar la edición, descarta todos los cambios",
text: "Cancelar"
},
clearAll: {
title: "Limpiar todas las capas",
text: "Limpiar todo"
}
},
buttons: {
edit: "Editar capas",
editDisabled: "No hay capas que editar",
remove: "Eliminar capas",
removeDisabled: "No hay capas que eliminar"
} }
}, },
handlers: { remove: {
edit: { tooltip: {
tooltip: { text: "Haz click en una figura para eliminarla"
text: "Arrastra el marcador para editar la figura",
subtext: "Haz click en cancelar para deshacer los cambios"
}
},
remove: {
tooltip: {
text: "Haz click en una figura para eliminarla"
}
} }
} }
} }
} }
// leaflet draw control }
// leaflet draw control
drawnItems = L.featureGroup().addTo(map); drawnItems = L.featureGroup().addTo(map);
let drawControl = new L.Control.Draw({ let drawControl = new L.Control.Draw({
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
<link rel="stylesheet" type="text/css" href="../css/riesgos/style.css"> <link rel="stylesheet" type="text/css" href="../css/riesgos/style.css">
<link rel="stylesheet" type="text/css" href="../css/style.css"> <link rel="stylesheet" type="text/css" href="../css/style.css">
<link rel="icon" href="../img/grijalva.png" sizes="16x16"> <link rel="icon" href="../img/grijalva.png" sizes="16x16">
<!--<link rel="stylesheet" href="./css/map.css" type="text/css">-->
</head> </head>
<body> <body>
...@@ -141,7 +139,6 @@ ...@@ -141,7 +139,6 @@
<script src="../js/Leaflet.BeautifyIcon/leaflet-beautify-marker-icon.js"></script> <script src="../js/Leaflet.BeautifyIcon/leaflet-beautify-marker-icon.js"></script>
<script src="../js/L.VisualClick/L.VisualClick.js"></script> <script src="../js/L.VisualClick/L.VisualClick.js"></script>
<script src="https://api.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.3.1/leaflet-omnivore.min.js"></script> <script src="https://api.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.3.1/leaflet-omnivore.min.js"></script>
<script src="https://unpkg.com/leaflet.vectorgrid@latest/dist/Leaflet.VectorGrid.bundled.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/nezasa/iso8601-js-period/master/iso8601.min.js"></script> <script type="text/javascript" src="https://cdn.rawgit.com/nezasa/iso8601-js-period/master/iso8601.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/socib/Leaflet.TimeDimension/master/dist/leaflet.timedimension.min.js"></script> <script type="text/javascript" src="https://cdn.rawgit.com/socib/Leaflet.TimeDimension/master/dist/leaflet.timedimension.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/2.0.3/chroma.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/2.0.3/chroma.min.js"></script>
...@@ -150,78 +147,10 @@ ...@@ -150,78 +147,10 @@
<script src="https://unpkg.com/mapbox-gl-leaflet/leaflet-mapbox-gl.js"></script> <script src="https://unpkg.com/mapbox-gl-leaflet/leaflet-mapbox-gl.js"></script>
<script type="text/javascript" src="../js/Leaflet.Sync.js"></script> <script type="text/javascript" src="../js/Leaflet.Sync.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.js"></script>
<script src="https://npmcdn.com/@turf/turf/turf.min.js"></script>
<script type="text/javascript" src="../js/jszip.min.js"></script> <script type="text/javascript" src="../js/jszip.min.js"></script>
<script src="../js/grijalva_functions.js"></script> <script src="../js/grijalva_functions.js"></script>
<script src="../js/riesgos_basemap.js"></script> <script src="../js/riesgos_basemap.js"></script>
<script src="../js/grijalva_charts.js"></script> <script src="../js/grijalva_charts.js"></script>
<!--<script>
var map = new mapboxgl.Map({
'container': 'mapmex',
'zoom': 7,
'center': [-92.28, 17.22], // cuenca Grijalva
'style': {
'version': 8,
'sources': {
'carto-dark': {
'type': 'raster',
'tiles': [
"http://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",
"http://b.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",
"http://c.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",
"http://d.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"
]
}
},
'layers': [{
'id': 'carto-dark-layer',
'type': 'raster',
'source': 'carto-dark',
'minzoom': 0,
'maxzoom': 22
}]
}
});
map.addControl(new mapboxgl.NavigationControl());
map.on('load', function() {
map.addLayer({
id: 'abril_2018-tiles',
source: {
type: 'vector',
// "http://localhost:8090/data/" + monthYear + "/mvt/{z}/{x}/{y}?geom_column=geom&columns=" + indicators.join();
tiles: ['http://localhost:8090/data/abril_2018/mvt/{z}/{x}/{y}?geom_column=geom&columns=df'],
maxzoom: 14,
minzoom: 5
},
'source-layer': 'abril_2018',
type: 'fill',
minzoom: 5,
'paint': {
'fill-opacity': 0.7,
'fill-color': [
'interpolate',
['linear'],
['get', 'df'],
1, 'rgba(255, 0, 0, 0.5)', // red
1.3, 'rgba(0, 255, 0, 0.5)', // green
],
'fill-outline-color': [
'interpolate',
['linear'],
['get', 'df'],
1, 'rgba(255, 0, 0, 0.6)', // red
1.3, 'rgba(0, 255, 0, 0.6)', // green
]
}
})
})
</script>-->
</body> </body>
</html> </html>
\ No newline at end of file
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