[Wiki] Coropletas transparencia
by Francisco
HTML
<script src="http://mapea4-sigc.juntadeandalucia.es/js/mapea-5.0.1.ol.min.js"></script>
<script src="http://mapea4-sigc.juntadeandalucia.es/js/configuration-5.0.1.js"></script>
<link rel="stylesheet" href="http://mapea4-sigc.juntadeandalucia.es/assets/css/mapea-5.0.1.ol.min.css">
<div id="map"></div>
CSS
html,
body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
JavaScript
let mapajs = M.map({
'container': 'map',
"controls": ["layerswitcher"]
});
let lyProv = new M.layer.WFS({
name: "Provincias",
url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/wfs?",
legend: "Provincias - COROPLETAS",
geometry: 'POLYGON',
});
let s1 = new M.style.Polygon({
fill: {
color: '#000000',
opacity: 0.5
},
stroke: {
color: '#000000'
}
});
let s2 = new M.style.Polygon({
fill: {
color: '#000fff',
opacity: 0.5
},
stroke: {
color: '#000000'
}
});
let s3 = new M.style.Polygon({
fill: {
color: '#fff000',
opacity: 0.5
},
stroke: {
color: '#000000'
}
});
//puede observarse como se ignoran los 4 rangos pasados al cuantificador
let choropleth = new M.style.Choropleth('u_cod_prov', [s1, s2, s3], M.style.quantification.QUANTILE(4));
lyProv.setStyle(choropleth);
mapajs.addLayers(lyProv);