Style Category
by SIGC GUADALTEL
HTML
<link rel="stylesheet" href="https://sigc-dev.desarrollo.guadaltel.es/mapea5/assets/css/mapea-5.2.0.ol.min.css">
<script src="https://sigc-dev.desarrollo.guadaltel.es/mapea5/js/mapea-5.2.0.ol.min.js"></script>
<script src="https://sigc-dev.desarrollo.guadaltel.es/mapea5/js/configuration-5.2.0.js"></script>
<div id="map">
</div>
CSS
html,
body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
JavaScript
var map = M.map({
'container': 'map',
"controls": ["layerswitcher"],
layers: ["OSM"]
});
let centros = new M.layer.WFS({
name: "Provincias",
url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/wfs",
namespace: "tematicos"
});
map.addLayers(centros);
let style = new M.style.Category("tipologia", {
"CENTRO RESIDENCIAL": new M.style.Point({
fill: {
color: "red"
},
radius: 10
}),
"CENTRO DE DÍA": new M.style.Point({
fill: {
color: "black",
},
radius: 12
}),
"other": new M.style.Point({
fill: {
color: "blue"
},
radius: 8
})
});
centros.setStyle(style);