CP-073-02-V4_2_0_MAPEA_choropleth_lin
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 lines = new M.layer.WFS({
name: "Ríos",
url: "https://clientes.guadaltel.es/desarrollo/geossigc/wfs",
namespace: "mapea",
name: "mapb_hs1_100",
legend: "mapb_hs1_100 - COROPLETAS",
getfeatureinfo: "plain",
geometry: 'LINE',
extract: true
});
mapajs.addLayers(lines);
let jenks = M.style.quantification.JENKS;
let quantile = M.style.quantification.QUANTILE;
function lines_jenks() {
let choropleth = new M.style.Choropleth("cod_rio", null, jenks(numClass()));
lines.setStyle(choropleth);
}
function lines_quantile() {
let choropleth = new M.style.Choropleth("cod_rio", null, quantile(numClass()));
lines.setStyle(choropleth);
}
function lines_jenks2() {
let stylesPoint = [
new M.style.Line({
fill: {
color: '33BBFF'
}
}),
new M.style.Line({
fill: {
color: '#FF0099'
}
}),
new M.style.Line({
fill: {
color: '#00AAAA'
}
})
];
let choropleth = new M.style.Choropleth("cod_rio", stylesPoint, M.style.quantification.JENKS()); //M.style.quantification.JENKS() --> f(d, l = 6) --> f(d, 2)
lines.setStyle(choropleth);
}
function lines_quantile2() {
let stylesPoint = [
new M.style.Line({
fill: {
color: '33BBFF'
}
}),
new M.style.Line({
fill: {
color: '#FF0099'
}
}),
new M.style.Line({
fill: {
color: '#00AAAA'
...