CP-073-01-V4_2_0_MAPEA_choropleth_pun

by SIGC GUADALTEL

HTML

<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/geosearchbylocation/geosearchbylocation.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42_dev/assets/css/mapea.ol.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/wfstcontrols/wfstcontrols.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/geosearch/geosearch.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/printer/printer.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/measurebar/measurebar.min.css">
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/streetview/streetview.min.css">
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/vendor/browser-polyfill.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/js/mapea.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/js/configuration.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/geosearchbylocation/geosearchbylocation.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/wfstcontrols/wfstcontrols.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/geosearch/geosearch.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/printer/printer.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/measurebar/measurebar.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/attributetable/attributetable.ol.min.js"></script>
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea42_dev/plugins/attributetable/attributetable.min.css">
<table id="tableStyle">
      <tr>
        <th...

CSS

html,
      body {
        margin: 0;
        padding: 0;
        height: 100%;
        overflow: auto;
      }

      #tableStyle {
        font-family: arial, sans-serif;
        border-collapse: collapse;
        width: 100%;
      }

      table#tableStyle td {
        border: 1px solid #dddddd;
        text-align: left;
        padding: 8px;
      }

      table#tableStyle th {
        border: 1px solid #dddddd;
        text-align: left;
        padding: 8px;
      }

      table#tableStyle tr:nth-child(even) {
        background-color: #dddddd;
      }

      input-group {
        margin: 20%;
      }

      .display-hidden {
        display: none;
      }

JavaScript

let mapajs = M.map({
  container: "map",
  projection: "EPSG:4326*m",
  layers: ["OSM"],
  center: [-6.39404296875,
        36.99377838872517
      ],
  zoom: 5,
  controls: ['layerswitcher', 'overviewmap'],
});

mapajs.addPlugin(new M.plugin.Printer({
  "params": {
    "pages": {
      "clientLogo": "http://www.juntadeandalucia.es/economiayhacienda/images/plantilla/logo_cabecera.gif",
      "creditos": "Impresión generada a través de Mapea"
    },
    "layout": {
      "outputFilename": "mapea_${yyyy-MM-dd_hhmmss}"
    }
  }
}, {
  "options": {
    "legend": "true"
  }
}));

let points = new M.layer.WFS({
  name: "Centros ASSDA - Subtipos",
  url: "https://clientes.guadaltel.es/desarrollo/geossigc/wfs?",
  namespace: "mapea",
  name: "centrosassda",
  legend: "centrosassda",
  geometry: 'POINT',
});;

mapajs.addLayers(points);
let jenks = M.style.quantification.JENKS;
let quantile = M.style.quantification.QUANTILE;

function points_jenks() {
  let choropleth = new M.style.Choropleth("nregin", null, jenks(numClass()));
  points.setStyle(choropleth);
}

function points_quantile() {
  let choropleth = new M.style.Choropleth("nregin", null, quantile(numClass()));
  points.setStyle(choropleth);
}

function points_jenks2() {
  let stylesPoint = [
        new M.style.Point({
      fill: {
        color: '33BBFF'
      },
      radius: 5
    }),
        new M.style.Point({
      fill: {
        color: '#FF0099'
      },
      radius: 6
    }),
        new M.style.Point({
      fill: {
        color: '#00AAAA'
      },
      radius: 7
    })
      ];
  let choropleth = new M.style.Choropleth("nregin", stylesPoint, M.style.quantification.JENKS()); //M.style.quantification.JENKS() --> f(d, l = 6) --> f(d, 2)
  points.setStyle(choropleth);
}

function points_quantile2() {
  let stylesPoint = [
        new M.style.Point({
      fill: {
        color: '33BBFF'
      },
      radius: 5
    }),
        new M.style.Point({
      fill: {
        color: '#FF0099'
      },
     ...