var InvestigacionesNotas = function(mapid, i) { "use strict"; var a, n = {}, o = {}, t = {}; o.init = function() { if ((s(), void 0 === i)) return !1; var n = function() { var i = $(".wrapper").innerHeight(); $(window).scrollTop() > i + 50 ? $(".B2bNav").addClass("is-visible") : $(".B2bNav").removeClass("is-visible"); // $(".callMapData").on("click", function(i) { // var id = "MapaData"; // $("html,body").animate( // { scrollTop: $("#" + id).offset().top - 40 }, // 800 // ); // }); }; $(window).on("scroll", n), $(window).scroll(function() { checkScroll(this); }); var window_width = $(window).width(); function checkScroll(that) { var scroll_top = $(that).scrollTop(); var window_height = $(that).height(); var ref_line = scroll_top + 0.5 * window_height; var vid = document.getElementById("audio-portada"); $(".slides-map").each(function() { var selector = $(this).find(".slide"); var n = selector.length; selector.each(function(i) { var sec_top = $(this).offset().top - 100; var sec_height = $(this).height(); if (sec_top < ref_line && ref_line < sec_top + sec_height) { $(this) .find(".slide__content") .addClass("visible"); } else { $(this) .find(".slide__content") .removeClass("visible"); } if (i == 0) { if (scroll_top < sec_top) { $(this) .find(".slide__content") .addClass("fit-to-top"); } else { $(this) .find(".slide__content") .removeClass("fit-to-top"); } } if (i == n - 1) { if (scroll_top + window_height > sec_top + sec_height) { $(this) .find(".slide__content") .addClass("fit-to-bottom"); } else { $(this) .find(".slide__content") .removeClass("fit-to-bottom"); } } }); if($(".slide__content_video").hasClass("visible")){ vid.play(); } else{ vid.pause(); } }); } checkScroll(window); // t.loadData(i, function(i) { // "error" !== i && ((a = i), t.watchB2bActivo(a)); // }); }; var s = function() { n.contentList = $(".MainContent-investigaciones"); }; return ( // (t.watchB2bActivo = function(i) { // console.log(i, mapid); // console.log("entra"); // var map; // mapid == "mapid" // ? (map = L.map(mapid).setView([-12.16, -70.97], 6.45)) // : (map = L.map(mapid).setView([-13.16, -71.77], 6.2)); // L.tileLayer( // "https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiZ2VueWxlb25nIiwiYSI6ImNqeTdrMWQweDAwYWUzZXM2ZHUxN3lxcWMifQ.taFCKYjv4VSHhWN86P8N1Q", // { // id: "mapbox.light", // attribution: // 'Map data &cop y; OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox', // maxZoom: 10 // } // ).addTo(map); // map.scrollWheelZoom.disable(); // L.geoJson(i).addTo(map); // function getColor(d, feature) { // console.log(feature) // if(feature.properties.FIRST_NOMB == "AYACUCHO"){ // return d > 100 // ? "#f57f17" // : d > 50 // ? "#fbc02d" // : d > 30 // ? "#fdd835" // : d > 10 // ? "#fff176" // : "#fff59d"; // } // if(feature.properties.FIRST_NOMB == "HUANCAVELICA"){ // return d > 100 // ? "#4a148c" // : d > 50 // ? "#8e24aa" // : d > 30 // ? "#ba68c8" // : d > 10 // ? "#ce93d8" // : "#e1bee7"; // } // if(feature.properties.FIRST_NOMB == "CUSCO"){ // return d > 100 // ? "#1b5e20" // : d > 50 // ? "#388e3c" // : d > 30 // ? "#4caf50" // : d > 10 // ? "#a5d6a7" // : "#c8e6c9"; // } // if(feature.properties.FIRST_NOMB == "APURIMAC"){ // return d > 100 // ? "#004d40" // : d > 50 // ? "#00796b" // : d > 30 // ? "#26a69a" // : d > 10 // ? "#80cbc4" // : "#b2dfdb"; // } // if(feature.properties.FIRST_NOMB == "AREQUIPA"){ // return d > 100 // ? "#bf360c" // : d > 50 // ? "#f4511e" // : d > 30 // ? "#ff7043" // : d > 10 // ? "#ffab91" // : "#ffccbc"; // } // else{ // return d > 100 // ? "#b71c1c" // : d > 50 // ? "#d32f2f" // : d > 30 // ? "#f44336" // : d > 10 // ? "#e57373" // : "#ef9a9a"; // } // } // function style(feature) { // console.log(feature); // var getMap; // if ($(".filter_puno.active").attr("attr") == "tasa_mayor") { // getMap = feature.properties.tasa_neumonia_mayor; // } // if ($(".filter_puno.active").attr("attr") == "tasa_menor") { // getMap = feature.properties.tasa_neumonia_menor; // } // return { // fillColor: getColor(getMap, feature), // weight: 2, // opacity: 1, // color: "white", // dashArray: "3", // fillOpacity: 0.5 // }; // } // var geojson = L.geoJson(i, { style: style }).addTo(map); // function highlightFeature(e) { // console.log(e); // var layer = e.target; // layer.setStyle({ // weight: 3, // color: "#000", // dashArray: "", // fillOpacity: 0.5 // }); // if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { // layer.bringToFront(); // } // // console.log(layer.feature.properties) // map.dragging.enable(); // info.update(layer.feature.properties); // } // function resetHighlight(e) { // map.dragging.disable(); // geojson.resetStyle(e.target); // info.update(); // } // function zoomToFeature(e) { // map.fitBounds(e.target.getBounds()); // } // function onEachFeature(feature, layer) { // layer.remove(); // layer.on({ // mouseover: highlightFeature, // mouseout: resetHighlight, // click: zoomToFeature // }); // } // geojson = L.geoJson(i, { // style: style, // onEachFeature: onEachFeature // }).addTo(map); // $(".filter_puno").click(function(e) { // geojson.remove(); // e.preventDefault(); // var self = $(this); // $(".filter_puno").removeClass("active"); // self.addClass("active"); // geojson = L.geoJson(i, { // style: style, // onEachFeature: onEachFeature // }).addTo(map); // }); // $(".filter_regiones").click(function(e) { // e.preventDefault(); // var self = $(this); // self.addClass("active"); // $(".mapperucontainer").fadeIn(); // setTimeout(function() { // map.invalidateSize(); // }, 1); // }); // $(".filter_regiones_close").click(function(e) { // $(".filter_regiones").removeClass("active"); // $(".mapperucontainer").fadeOut(); // }); // $(window).scroll(function() { // checkScroll(this); // }); // var window_width = $(window).width(); // function checkScroll(that) { // var scroll_top = $(that).scrollTop(); // var window_height = $(that).height(); // var ref_line = scroll_top + 0.5 * window_height; // $(".slides-map").each(function() { // var selector = $(this).find(".slide"); // var n = selector.length; // selector.each(function(i) { // var sec_top = $(this).offset().top - 100; // var sec_height = $(this).height(); // if (sec_top < ref_line && ref_line < sec_top + sec_height) { // $(this) // .find(".slide__content") // .addClass("visible"); // } else { // $(this) // .find(".slide__content") // .removeClass("visible"); // } // if (i == 0) { // if (scroll_top < sec_top) { // $(this) // .find(".slide__content") // .addClass("fit-to-top"); // } else { // $(this) // .find(".slide__content") // .removeClass("fit-to-top"); // } // } // if (i == n - 1) { // if (scroll_top + window_height > sec_top + sec_height) { // $(this) // .find(".slide__content") // .addClass("fit-to-bottom"); // } else { // $(this) // .find(".slide__content") // .removeClass("fit-to-bottom"); // } // } // }); // }); // } // checkScroll(window); // var info = L.control(); // info.onAdd = function(map) { // this._div = L.DomUtil.create("div", "info"); // create a div with a class "info" // this.update(); // return this._div; // }; // info.update = function(props) { // if ($(".filter_puno.active").attr("attr") == "tasa_mayor") { // this._div.innerHTML = props // ? '

' + // props.FIRST_NOMB + // " - " + // props.NOMBPROV + // '

Número de casos de neumonía (Cases of Neumonía): ' + // props.tasa_neumonia_mayor + // "

" // : '

Elige una región para ver (Choose a region)

'; // } // if ($(".filter_puno.active").attr("attr") == "tasa_menor") { // this._div.innerHTML = props // ? '

' + // props.FIRST_NOMB + // " - " + // props.NOMBPROV + // '

Número de casos de neumonía (Cases of Neumonía): ' + // props.tasa_neumonia_menor + // "

Número de casos de mortandad (Cases of deaths): ' + // props.tasa_mortandad_menor + // "