Commit c2d6f18a authored by Rodrigo Tapia-McClung's avatar Rodrigo Tapia-McClung

Update to arrow functions

parent b34bf9c4
...@@ -169,7 +169,7 @@ let layer_escuelas = new L.geoJson(null, { ...@@ -169,7 +169,7 @@ let layer_escuelas = new L.geoJson(null, {
attribution: "", attribution: "",
pane: "pane_escuelas", pane: "pane_escuelas",
//onEachFeature: pop_escuelas, //onEachFeature: pop_escuelas,
pointToLayer: function (feature, latlng) { pointToLayer: (feature, latlng) => {
// let context = { // let context = {
// feature: feature, // feature: feature,
// variables: {} // variables: {}
...@@ -196,7 +196,7 @@ let layer_hospitales = new L.geoJson(null, { ...@@ -196,7 +196,7 @@ let layer_hospitales = new L.geoJson(null, {
attribution: "", attribution: "",
pane: "pane_hospitales", pane: "pane_hospitales",
//onEachFeature: pop_hospitales, //onEachFeature: pop_hospitales,
pointToLayer: function (feature, latlng) { pointToLayer: (_feature, latlng) => {
// let context = { // let context = {
// feature: feature, // feature: feature,
// variables: {} // variables: {}
...@@ -224,7 +224,7 @@ let layer_hoteles = new L.geoJson(null, { ...@@ -224,7 +224,7 @@ let layer_hoteles = new L.geoJson(null, {
attribution: "", attribution: "",
pane: "pane_hoteles", pane: "pane_hoteles",
//onEachFeature: pop_hoteles, //onEachFeature: pop_hoteles,
pointToLayer: function (feature, latlng) { pointToLayer: (_feature, latlng) => {
// let context = { // let context = {
// feature: feature, // feature: feature,
// variables: {} // variables: {}
...@@ -251,7 +251,7 @@ let layer_puentes = new L.geoJson(null, { ...@@ -251,7 +251,7 @@ let layer_puentes = new L.geoJson(null, {
attribution: "", attribution: "",
pane: "pane_puentes", pane: "pane_puentes",
//onEachFeature: pop_puentes, //onEachFeature: pop_puentes,
pointToLayer: function (feature, latlng) { pointToLayer: (_feature, latlng) => {
// var context = { // var context = {
// feature: feature, // feature: feature,
// variables: {} // variables: {}
...@@ -279,7 +279,7 @@ let layer_puerto = new L.geoJson(null, { ...@@ -279,7 +279,7 @@ let layer_puerto = new L.geoJson(null, {
attribution: "", attribution: "",
pane: "pane_puerto", pane: "pane_puerto",
//onEachFeature: pop_puerto, //onEachFeature: pop_puerto,
pointToLayer: function (feature, latlng) { pointToLayer: (_feature, latlng) => {
// let context = { // let context = {
// feature: feature, // feature: feature,
// variables: {} // variables: {}
...@@ -307,7 +307,7 @@ let layer_frontera = new L.geoJson(null, { ...@@ -307,7 +307,7 @@ let layer_frontera = new L.geoJson(null, {
pane: "pane_frontera", pane: "pane_frontera",
//onEachFeature: pop_frontera, //onEachFeature: pop_frontera,
styles: null, styles: null,
pointToLayer: function (feature, latlng) { pointToLayer: (_feature, latlng) => {
// let context = { // let context = {
// feature: feature, // feature: feature,
// variables: {} // variables: {}
...@@ -334,7 +334,7 @@ let layer_descargas = new L.geoJson(null, { ...@@ -334,7 +334,7 @@ let layer_descargas = new L.geoJson(null, {
attribution: "", attribution: "",
pane: "pane_descargas", pane: "pane_descargas",
//onEachFeature: pop_descargas, //onEachFeature: pop_descargas,
pointToLayer: function (feature, latlng) { pointToLayer: (_feature, latlng) => {
// let context = { // let context = {
// feature: feature, // feature: feature,
// variables: {} // variables: {}
...@@ -361,7 +361,7 @@ let layer_presas = new L.geoJson(null, { ...@@ -361,7 +361,7 @@ let layer_presas = new L.geoJson(null, {
attribution: "", attribution: "",
pane: "pane_presas", pane: "pane_presas",
//onEachFeature: pop_presas, //onEachFeature: pop_presas,
pointToLayer: function (feature, latlng) { pointToLayer: (_feature, latlng) => {
// let context = { // let context = {
// feature: feature, // feature: feature,
// variables: {} // variables: {}
......
...@@ -282,7 +282,7 @@ const setupMap = (dates) => { ...@@ -282,7 +282,7 @@ const setupMap = (dates) => {
L.control.attribution({position: "bottomright"}).addTo(overlay); L.control.attribution({position: "bottomright"}).addTo(overlay);
// on base layer on main map, change base layer on overlay map // on base layer on main map, change base layer on overlay map
map.on("baselayerchange", function(event) { map.on("baselayerchange", event => {
overlay.eachLayer(l => overlay.removeLayer(l)); overlay.eachLayer(l => overlay.removeLayer(l));
if (event.name == "Carto Dark") { if (event.name == "Carto Dark") {
cartoDarkLayerOverlay.addTo(overlay); cartoDarkLayerOverlay.addTo(overlay);
...@@ -293,9 +293,7 @@ const setupMap = (dates) => { ...@@ -293,9 +293,7 @@ const setupMap = (dates) => {
} }
}); });
map.sync(overlay, {offsetFn: offsetGlobal}); const offsetGlobal = (center, zoom, refMap, tgtMap) => {
function offsetGlobal (center, zoom, refMap, tgtMap) {
var refC = refMap.getContainer(); var refC = refMap.getContainer();
var tgtC = tgtMap.getContainer(); var tgtC = tgtMap.getContainer();
var pt = refMap.project(center, zoom) var pt = refMap.project(center, zoom)
...@@ -306,6 +304,8 @@ const setupMap = (dates) => { ...@@ -306,6 +304,8 @@ const setupMap = (dates) => {
return refMap.unproject(pt, zoom); return refMap.unproject(pt, zoom);
} }
map.sync(overlay, {offsetFn: offsetGlobal});
//console.log(userFiles); //console.log(userFiles);
// query db to get min/max values per month and indicator and store them in an object // query db to get min/max values per month and indicator and store them in an object
queryFiles().then( minmax => { queryFiles().then( minmax => {
......
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