CP-090-03
Mixto clasificar tipología cluster tipología
by SIGC
HTML
<script src="https://sigc.desarrollo.guadaltel.es/mapea5/js/mapea.ol.min.js"></script>
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea5/assets/css/mapea.ol.min.css">
<script src="https://sigc.desarrollo.guadaltel.es/mapea5/js/configuration.js"></script>
<div id="map"></div>
<button onclick="setCategoríaStyle()">Clasificar por Tipología</button>
<button onclick="setCluster()">Cluster Tipología</button>
CSS
<style rel="stylesheet"> html,
body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
JavaScript
var mapajs = M.map({
'container': 'map',
"controls": ["layerswitcher", "mouse", "scale", "overviewmap", "panzoombar", "scaleline", ],
"getfeatureinfo": "plain"
});
var centros = new M.layer.WFS({
name: "Centros ASSDA",
url: "https://clientes.guadaltel.es/desarrollo/geossigc/wfs?",
namespace: "mapea",
name: "centrosassda",
legend: "centrosassda",
getfeatureinfo: "plain",
geometry: 'POINT',
extract: true,
});
mapajs.addLayers(centros);
mapajs.addPlugin(new M.plugin.AttributeTable());
let estiloSubtipoDefPink = new M.style.Point({
fill: {
color: 'red'
},
stroke: {
color: 'red',
width: 5
},
radius: 15
});
let verde = new M.style.Point({
fill: {
color: 'green'
},
stroke: {
color: 'green',
width: 1
},
radius: 13
});
let amarillo = new M.style.Point({
fill: {
color: 'yellow'
},
stroke: {
color: 'yellow',
width: 1
},
radius: 13
});
let rojo = new M.style.Point({
fill: {
color: 'red'
},
stroke: {
color: 'red',
width: 1
},
radius: 13
});
let azul = new M.style.Point({
fill: {
color: 'blue'
},
stroke: {
color: 'blue',
width: 1
},
radius: 13
});
let categoryStyle = new M.style.Category("tipologia", {
"CENTRO DE DÍA": verde,
"CENTRO DE NOCHE": rojo,
"CENTRO DE PARTICIPACIÓN ACTIVA DE PERSONAS MAYORES": rojo,
"CENTRO DE SERVICIOS SOCIALES COMUNITARIOS": rojo,
"CENTRO RESIDENCIAL": amarillo,
"CENTRO SOCIAL": azul,
"CENTRO SOCIOCULTURAL GITANO": azul,
"COMEDOR": azul,
"CONSULTAR A LA COORDINACIÓN": azul
});
// CONFIGURACIÓN PARÁMETROS CLUSTER
var options = {
ranges: [
/*{min:1, max:1, style: new M.style.Point({
fill: {
color: 'red'
},
radius: 15
})},*/
{
min: 2,
max: 3,
style: new M.style.Point({
stroke: {
color: '#1306ce'
},
fill: {
color: '#1306ce'
},
radius: 20
})
}, {
...